|
|
|
|
unit u_edi_cangdan_weihu;
|
|
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
|
|
Dialogs, dxExEdtr, wwdbdatetimepicker, StdCtrls, dxDBTLCl, dxGrClms,
|
|
|
|
|
dxTL, dxDBCtrl, dxDBGrid, DB, ADODB, dxCntner, bsSkinCtrls, ExtCtrls,
|
|
|
|
|
dxGrClEx, DBCtrls, Mask, RxLookup, wwdblook, Grids, Wwdbigrd, Wwdbgrid,
|
|
|
|
|
dxLayout, Menus, wwdbedit, Wwdotdot, Wwdbcomb;
|
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
Tfrm_edi_cangdan_weihu = class(TForm)
|
|
|
|
|
bsSkinPanel1: TbsSkinPanel;
|
|
|
|
|
Panel1: TPanel;
|
|
|
|
|
bsSkinButton1: TbsSkinButton;
|
|
|
|
|
bsSkinButton2: TbsSkinButton;
|
|
|
|
|
bsSkinButton4: TbsSkinButton;
|
|
|
|
|
bsSkinButton3: TbsSkinButton;
|
|
|
|
|
bsSkinButton5: TbsSkinButton;
|
|
|
|
|
bsSkinPanel2: TbsSkinPanel;
|
|
|
|
|
code_price_edi: TADOQuery;
|
|
|
|
|
ds_code_price_edi: TDataSource;
|
|
|
|
|
bsSkinPanel3: TbsSkinPanel;
|
|
|
|
|
Label1: TLabel;
|
|
|
|
|
Edit1: TEdit;
|
|
|
|
|
Label2: TLabel;
|
|
|
|
|
Edit2: TEdit;
|
|
|
|
|
wwDBDateTimePicker1: TwwDBDateTimePicker;
|
|
|
|
|
Label3: TLabel;
|
|
|
|
|
bsSkinButton6: TbsSkinButton;
|
|
|
|
|
code_emf_type: TADOQuery;
|
|
|
|
|
ds_code_emf_type: TDataSource;
|
|
|
|
|
code_emf_typeDSDesigner: TAutoIncField;
|
|
|
|
|
code_emf_typeDSDesigner2: TStringField;
|
|
|
|
|
code_emf_typeDSDesigner3: TDateTimeField;
|
|
|
|
|
code_emf_typeDSDesigner4: TBooleanField;
|
|
|
|
|
code_emf_typeDSDesigner5: TStringField;
|
|
|
|
|
code_emf_typeDSDesigner6: TStringField;
|
|
|
|
|
Label4: TLabel;
|
|
|
|
|
RxDBLookupCombo1: TRxDBLookupCombo;
|
|
|
|
|
dxDBGrid1: TdxDBGrid;
|
|
|
|
|
dxDBGridLayoutList1: TdxDBGridLayoutList;
|
|
|
|
|
dxDBGrid1Column1: TdxDBGridMaskColumn;
|
|
|
|
|
dxDBGrid1Column2: TdxDBGridMaskColumn;
|
|
|
|
|
dxDBGrid1Column4: TdxDBGridCurrencyColumn;
|
|
|
|
|
dxDBGrid1Column3: TdxDBGridExtLookupColumn;
|
|
|
|
|
dxDBGridLayoutList1Item1: TdxDBGridLayout;
|
|
|
|
|
bsSkinButton7: TbsSkinButton;
|
|
|
|
|
dxDBGrid1Column5: TdxDBGridExtLookupColumn;
|
|
|
|
|
wwDBGrid1: TwwDBGrid;
|
|
|
|
|
RxDBLookupCombo28: TRxDBLookupCombo;
|
|
|
|
|
RxDBLookupCombo8: TRxDBLookupCombo;
|
|
|
|
|
t_crm_client_daili1: TDataSource;
|
|
|
|
|
t_crm_client_daili: TADOQuery;
|
|
|
|
|
wwDBComboBox44: TwwDBComboBox;
|
|
|
|
|
procedure bsSkinButton1Click(Sender: TObject);
|
|
|
|
|
procedure bsSkinButton2Click(Sender: TObject);
|
|
|
|
|
procedure bsSkinButton4Click(Sender: TObject);
|
|
|
|
|
procedure bsSkinButton3Click(Sender: TObject);
|
|
|
|
|
procedure bsSkinButton5Click(Sender: TObject);
|
|
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
|
|
procedure bsSkinButton6Click(Sender: TObject);
|
|
|
|
|
procedure code_price_ediBeforePost(DataSet: TDataSet);
|
|
|
|
|
procedure bsSkinButton7Click(Sender: TObject);
|
|
|
|
|
private
|
|
|
|
|
{ Private declarations }
|
|
|
|
|
public
|
|
|
|
|
{ Public declarations }
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
var
|
|
|
|
|
frm_edi_cangdan_weihu: Tfrm_edi_cangdan_weihu;
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
uses u_data_share, my_sys_function, u_main, u_sys_progress,u_edi_cangdan_type;
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_edi_cangdan_weihu.bsSkinButton1Click(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
code_price_edi.Append;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_edi_cangdan_weihu.bsSkinButton2Click(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
table_post(code_price_edi);
|
|
|
|
|
code_price_edi.Requery();
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_edi_cangdan_weihu.bsSkinButton4Click(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
table_delete(code_price_edi);
|
|
|
|
|
code_price_edi.Requery();
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_edi_cangdan_weihu.bsSkinButton3Click(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
table_Cancel(code_price_edi);
|
|
|
|
|
code_price_edi.Requery();
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_edi_cangdan_weihu.bsSkinButton5Click(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
Close;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_edi_cangdan_weihu.FormShow(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
with code_emf_type do
|
|
|
|
|
begin
|
|
|
|
|
Close;
|
|
|
|
|
SQL.Clear;
|
|
|
|
|
SQL.Add('select * from code_emf_type order by <20><><EFBFBD><EFBFBD>');
|
|
|
|
|
Open;
|
|
|
|
|
end;
|
|
|
|
|
with code_price_edi do
|
|
|
|
|
begin
|
|
|
|
|
Close;
|
|
|
|
|
SQL.Clear;
|
|
|
|
|
SQL.Add('select * from code_price_edi where EDI<44><49><EFBFBD><EFBFBD>=''<27>յ<EFBFBD>'' order by <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,¼<><C2BC>ʱ<EFBFBD><CAB1> ');
|
|
|
|
|
Open;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_edi_cangdan_weihu.bsSkinButton6Click(Sender: TObject);
|
|
|
|
|
var
|
|
|
|
|
SQLStr,s:string ;
|
|
|
|
|
begin
|
|
|
|
|
s:='';
|
|
|
|
|
if Trim(Edit1.Text)<>'' then s:=s+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> like ''%'+Trim(Edit1.Text)+'%''';
|
|
|
|
|
if Trim(Edit1.Text)<>'' then s:=s+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> like ''%'+Trim(Edit2.Text)+'%''';
|
|
|
|
|
if Trim(RxDBLookupCombo1.DisplayValue)<>'' then s:=s+' and <20>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> = '''+Trim(RxDBLookupCombo1.DisplayValue)+'''';
|
|
|
|
|
if wwDBDateTimePicker1.Text<>'' then s:=s+' and ¼<><C2BC>ʱ<EFBFBD><CAB1> >'''+wwDBDateTimePicker1.Text +'''';
|
|
|
|
|
SQLStr:=' select * from code_price_edi where EDI<44><49><EFBFBD><EFBFBD>=''<27>յ<EFBFBD>'' '+s+' order by <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,¼<><C2BC>ʱ<EFBFBD><CAB1>';
|
|
|
|
|
with code_price_edi do
|
|
|
|
|
begin
|
|
|
|
|
Close;
|
|
|
|
|
SQL.Clear;
|
|
|
|
|
SQL.Add(SQLStr);
|
|
|
|
|
Open;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_edi_cangdan_weihu.code_price_ediBeforePost(
|
|
|
|
|
DataSet: TDataSet);
|
|
|
|
|
var
|
|
|
|
|
aQuery:Tadoquery;
|
|
|
|
|
begin
|
|
|
|
|
code_price_edi.FieldByName('EDI<44><49><EFBFBD><EFBFBD>').AsString:='<27>յ<EFBFBD>';
|
|
|
|
|
code_price_edi.FieldByName('¼<><C2BC><EFBFBD><EFBFBD>').AsString:= employee;
|
|
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
|
|
with aQuery do
|
|
|
|
|
begin
|
|
|
|
|
Close;
|
|
|
|
|
sql.Clear;
|
|
|
|
|
sql.Add('select * from code_price_edi where EDI<44><49><EFBFBD><EFBFBD>=''<27>յ<EFBFBD>'' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+QuotedStr(code_price_edi.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString)
|
|
|
|
|
+' and <20>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+QuotedStr(code_price_edi.FieldByName('<27>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString));
|
|
|
|
|
Open;
|
|
|
|
|
end;
|
|
|
|
|
{ if aQuery.RecordCount>0 then
|
|
|
|
|
begin
|
|
|
|
|
ShowMessage('<27>ͻ<EFBFBD>'+code_price_edi.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString+'<27>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD>'+code_price_edi.FieldByName('<27>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+'!');
|
|
|
|
|
abort;
|
|
|
|
|
end; }
|
|
|
|
|
if code_price_edi.FieldByName('<27><><EFBFBD><EFBFBD>').AsString='' then
|
|
|
|
|
begin
|
|
|
|
|
ShowMessage('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
Abort;
|
|
|
|
|
end;
|
|
|
|
|
FreeAndNil(aQuery);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_edi_cangdan_weihu.bsSkinButton7Click(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
if not assigned(frm_edi_cangdan_type) then frm_edi_cangdan_type:=Tfrm_edi_cangdan_type.Create(self);
|
|
|
|
|
frm_edi_cangdan_type.ShowModal;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end.
|