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

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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ÀàÐÍ=''VGM'' order by ¿Í»§¼ò³Æ,¼Èëʱ¼ä ');
Open;
end;
end;
procedure Tfrm_edi_vgm_weihu.code_price_ediBeforePost(DataSet: TDataSet);
var
aQuery:Tadoquery;
begin
code_price_edi.FieldByName('EDIÀàÐÍ').AsString:='VGM';
code_price_edi.FieldByName('¼ÈëÈË').AsString:= employee;
aQuery:=CreateAdoQuery;
with aQuery do
begin
Close;
sql.Clear;
sql.Add('select * from code_price_edi where EDIÀàÐÍ=''VGM'' and ¿Í»§¼ò³Æ='+QuotedStr(code_price_edi.FieldByName('¿Í»§¼ò³Æ').AsString) );
Open;
end;
{if aQuery.RecordCount>0 then
begin
ShowMessage('¿Í»§'+code_price_edi.FieldByName('¿Í»§¼ò³Æ').AsString+'ÒѾ­´æÔÚVGMµ¥¼Û£¡');
// abort;
end; }
if code_price_edi.FieldByName('µ¥¼Û').AsString='' then
begin
ShowMessage('µ¥¼Û²»ÄÜΪ¿Õ£¡');
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 ¿Í»§¼ò³Æ like ''%'+Trim(Edit1.Text)+'%''';
if Trim(Edit1.Text)<>'' then s:=s+' and À¿»õÈË like ''%'+Trim(Edit2.Text)+'%''';
if wwDBDateTimePicker1.Text<>'' then s:=s+' and ¼Èëʱ¼ä >'''+wwDBDateTimePicker1.Text +'''';
SQLStr:=' select * from code_price_edi where EDIÀàÐÍ=''VGM'' '+s+' order by ¿Í»§¼ò³Æ,¼Èëʱ¼ä';
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.