You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

146 lines
4.0 KiB
Plaintext

11 months ago
unit u_edi_vgm_weihu;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, dxExEdtr, wwdbdatetimepicker, StdCtrls, dxCntner, dxTL,
dxDBCtrl, dxDBGrid, bsSkinCtrls, ExtCtrls, DB, ADODB, dxDBTLCl, dxGrClms;
type
Tfrm_edi_vgm_weihu = class(TForm)
code_price_edi: TADOQuery;
ds_code_price_edi: TDataSource;
bsSkinPanel1: TbsSkinPanel;
Panel1: TPanel;
bsSkinButton1: TbsSkinButton;
bsSkinButton2: TbsSkinButton;
bsSkinButton4: TbsSkinButton;
bsSkinButton3: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
bsSkinButton6: TbsSkinButton;
bsSkinPanel2: TbsSkinPanel;
dxDBGrid1: TdxDBGrid;
bsSkinPanel3: TbsSkinPanel;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Edit1: TEdit;
Edit2: TEdit;
wwDBDateTimePicker1: TwwDBDateTimePicker;
dxDBGrid1Column1: TdxDBGridMaskColumn;
dxDBGrid1Column2: TdxDBGridMaskColumn;
dxDBGrid1Column3: TdxDBGridMaskColumn;
dxDBGrid1EDI: TdxDBGridMaskColumn;
dxDBGrid1Column5: TdxDBGridMaskColumn;
dxDBGrid1Column6: TdxDBGridCurrencyColumn;
dxDBGrid1Column7: TdxDBGridDateColumn;
dxDBGrid1Column8: TdxDBGridCheckColumn;
dxDBGrid1Column9: TdxDBGridMaskColumn;
procedure FormShow(Sender: TObject);
procedure code_price_ediBeforePost(DataSet: TDataSet);
procedure bsSkinButton6Click(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
procedure bsSkinButton2Click(Sender: TObject);
procedure bsSkinButton4Click(Sender: TObject);
procedure bsSkinButton3Click(Sender: TObject);
procedure bsSkinButton5Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frm_edi_vgm_weihu: Tfrm_edi_vgm_weihu;
implementation
uses u_data_share, my_sys_function, u_main, u_sys_progress;
{$R *.dfm}
procedure Tfrm_edi_vgm_weihu.FormShow(Sender: TObject);
begin
with code_price_edi do
begin
Close;
SQL.Clear;
SQL.Add('select * from code_price_edi where EDI<44><49><EFBFBD><EFBFBD>=''VGM'' order by <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><><C2BC>ʱ<EFBFBD><CAB1> ');
Open;
end;
end;
procedure Tfrm_edi_vgm_weihu.code_price_ediBeforePost(DataSet: TDataSet);
var
aQuery:Tadoquery;
begin
code_price_edi.FieldByName('EDI<44><49><EFBFBD><EFBFBD>').AsString:='VGM';
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>=''VGM'' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+QuotedStr(code_price_edi.FieldByName('<27>ͻ<EFBFBD><CDBB><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>VGM<47><4D><EFBFBD>ۣ<EFBFBD>');
// 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_vgm_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 wwDBDateTimePicker1.Text<>'' then s:=s+' and ¼<><C2BC>ʱ<EFBFBD><CAB1> >'''+wwDBDateTimePicker1.Text +'''';
SQLStr:=' select * from code_price_edi where EDI<44><49><EFBFBD><EFBFBD>=''VGM'' '+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_vgm_weihu.bsSkinButton1Click(Sender: TObject);
begin
code_price_edi.Append;
end;
procedure Tfrm_edi_vgm_weihu.bsSkinButton2Click(Sender: TObject);
begin
table_post(code_price_edi);
code_price_edi.Requery();
end;
procedure Tfrm_edi_vgm_weihu.bsSkinButton4Click(Sender: TObject);
begin
table_delete(code_price_edi);
code_price_edi.Requery();
end;
procedure Tfrm_edi_vgm_weihu.bsSkinButton3Click(Sender: TObject);
begin
table_Cancel(code_price_edi);
code_price_edi.Requery();
end;
procedure Tfrm_edi_vgm_weihu.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
end.