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.

271 lines
8.3 KiB
Plaintext

This file contains ambiguous Unicode 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_op_kuaidi_manage;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, bsSkinCtrls, ExtCtrls, DB, ADODB, dxExEdtr, dxCntner, dxTL,
dxDBCtrl, dxDBGrid, dxDBTLCl, dxGrClms, wwdbdatetimepicker, RxLookup,
StdCtrls, Mask, wwdbedit, Wwdotdot, Wwdbcomb;
type
Tfrm_op_kuaidi_manage = class(TForm)
Panel1: TPanel;
bsSkinButton7: TbsSkinButton;
bsSkinButton6: TbsSkinButton;
bsSkinButton1: TbsSkinButton;
bsSkinButton2: TbsSkinButton;
bsSkinButton3: TbsSkinButton;
bsSkinButton4: TbsSkinButton;
bsSkinButton9: TbsSkinButton;
t_op_kuaidi_manage: TADOQuery;
t_op_kuaidi_manage1: TDataSource;
dxDBGrid1: TdxDBGrid;
dxDBGrid1Column1: TdxDBGridMaskColumn;
dxDBGrid1Column2: TdxDBGridMaskColumn;
dxDBGrid1Column3: TdxDBGridMaskColumn;
dxDBGrid1Column4: TdxDBGridMaskColumn;
dxDBGrid1Column5: TdxDBGridMaskColumn;
dxDBGrid1Column6: TdxDBGridMaskColumn;
dxDBGrid1Column8: TdxDBGridMaskColumn;
dxDBGrid1Column9: TdxDBGridDateColumn;
dxDBGrid1Column10: TdxDBGridMaskColumn;
dxDBGrid1Column7: TdxDBGridColumn;
bsSkinButton8: TbsSkinButton;
bsSkinPanel1: TbsSkinPanel;
bsSkinButton5: TbsSkinButton;
dxDBGrid1Column11: TdxDBGridColumn;
dxDBGrid1Column12: TdxDBGridColumn;
Label1: TLabel;
Label7: TLabel;
wwDBComboBox1: TwwDBComboBox;
Label9: TLabel;
RxDBLookupCombo2: TRxDBLookupCombo;
Label3: TLabel;
RxDBLookupCombo1: TRxDBLookupCombo;
Label2: TLabel;
Label5: TLabel;
wwDBComboBox2: TwwDBComboBox;
Label13: TLabel;
RxDBLookupCombo5: TRxDBLookupCombo;
Label11: TLabel;
wwDBDateTimePicker4: TwwDBDateTimePicker;
Label8: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Label4: TLabel;
wwDBDateTimePicker1: TwwDBDateTimePicker;
Label6: TLabel;
wwDBDateTimePicker2: TwwDBDateTimePicker;
wwDBDateTimePicker3: TwwDBDateTimePicker;
Label10: TLabel;
dxDBGrid1Column13: TdxDBGridColumn;
procedure bsSkinButton7Click(Sender: TObject);
procedure bsSkinButton6Click(Sender: TObject);
procedure bsSkinButton4Click(Sender: TObject);
procedure bsSkinButton9Click(Sender: TObject);
procedure t_op_kuaidi_manageAfterInsert(DataSet: TDataSet);
procedure t_op_kuaidi_manageBeforePost(DataSet: TDataSet);
procedure bsSkinButton2Click(Sender: TObject);
procedure bsSkinButton3Click(Sender: TObject);
procedure bsSkinButton8Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormShow(Sender: TObject);
procedure Panel1Resize(Sender: TObject);
procedure bsSkinButton5Click(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
procedure t_op_kuaidi_manageBeforeEdit(DataSet: TDataSet);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frm_op_kuaidi_manage: Tfrm_op_kuaidi_manage;
implementation
uses u_main, u_op_kuaidi_manage_modify, my_sys_function;
{$R *.dfm}
procedure Tfrm_op_kuaidi_manage.bsSkinButton7Click(Sender: TObject);
begin
table_Prior(frm_op_kuaidi_manage.t_op_kuaidi_manage);
end;
procedure Tfrm_op_kuaidi_manage.bsSkinButton6Click(Sender: TObject);
begin
table_next(frm_op_kuaidi_manage.t_op_kuaidi_manage);
end;
procedure Tfrm_op_kuaidi_manage.bsSkinButton4Click(Sender: TObject);
begin
table_delete(frm_op_kuaidi_manage.t_op_kuaidi_manage);
end;
procedure Tfrm_op_kuaidi_manage.bsSkinButton9Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_op_kuaidi_manage.t_op_kuaidi_manageAfterInsert(
DataSet: TDataSet);
begin
t_op_kuaidi_manage['<27><><EFBFBD>ѷ<EFBFBD>ʽ']:='Ԥ<><D4A4>';
t_op_kuaidi_manage['<27><><EFBFBD><EFBFBD>']:=0;
t_op_kuaidi_manage['<27>շ<EFBFBD><D5B7><EFBFBD>Ա']:=employee;
t_op_kuaidi_manage['<27>շ<EFBFBD>ʱ<EFBFBD><CAB1>']:=date;
t_op_kuaidi_manage['¼<><C2BC><EFBFBD><EFBFBD>']:=employee;
t_op_kuaidi_manage['¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=date;
end;
procedure Tfrm_op_kuaidi_manage.t_op_kuaidi_manageBeforePost(
DataSet: TDataSet);
begin
table_before_post(t_op_kuaidi_manage,'<27><><EFBFBD>ݱ<EFBFBD><DDB1><EFBFBD>');
table_before_post(t_op_kuaidi_manage,'<27>շ<EFBFBD><D5B7><EFBFBD><EFBFBD><EFBFBD>');
table_before_post(t_op_kuaidi_manage,'<27><><EFBFBD>ݹ<EFBFBD>˾');
table_before_post(t_op_kuaidi_manage,'ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
table_before_post(t_op_kuaidi_manage,'<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
table_before_post(t_op_kuaidi_manage,'<27><><EFBFBD>ѷ<EFBFBD>ʽ');
table_before_post(t_op_kuaidi_manage,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
table_before_post(t_op_kuaidi_manage,'<27>շ<EFBFBD><D5B7><EFBFBD>Ա');
table_before_post(t_op_kuaidi_manage,'<27>շ<EFBFBD>ʱ<EFBFBD><CAB1>');
end;
procedure Tfrm_op_kuaidi_manage.bsSkinButton2Click(Sender: TObject);
begin
try
frm_op_kuaidi_manage_modify:=tfrm_op_kuaidi_manage_modify.Create (self);
t_op_kuaidi_manage.insert;
frm_op_kuaidi_manage_modify.ShowModal;
finally
frm_op_kuaidi_manage_modify.Free;
frm_op_kuaidi_manage_modify:=nil;
end;
end;
procedure Tfrm_op_kuaidi_manage.bsSkinButton3Click(Sender: TObject);
begin
if t_op_kuaidi_manage.IsEmpty then
exit;
try
frm_op_kuaidi_manage_modify:=tfrm_op_kuaidi_manage_modify.Create (self);
frm_op_kuaidi_manage_modify.ShowModal;
finally
frm_op_kuaidi_manage_modify.Free;
frm_op_kuaidi_manage_modify:=nil;
end;
end;
procedure Tfrm_op_kuaidi_manage.bsSkinButton8Click(Sender: TObject);
begin
sys_print('<27><><EFBFBD><EFBFBD><EFBFBD>ո<EFBFBD><D5B8>Ǽ<EFBFBD>',2,nil,nil,nil,nil,t_op_kuaidi_manage1,nil,nil,nil,nil,nil,nil);
end;
procedure Tfrm_op_kuaidi_manage.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
savereggrid(dxdbgrid1,caption);
frm_op_kuaidi_manage.Hide;
frm_op_kuaidi_manage.ManualFloat(frm_op_kuaidi_manage.BoundsRect );
frm_main.freeTabs('frm_op_kuaidi_manage');
action:=cafree;
frm_op_kuaidi_manage:=nil;
end;
procedure Tfrm_op_kuaidi_manage.FormShow(Sender: TObject);
begin
loadreggrid(dxdbgrid1,false,caption);
t_op_kuaidi_manage.close;
t_op_kuaidi_manage.Parameters.ParamByName('¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').value:=date-7;
t_op_kuaidi_manage.Parameters.ParamByName('¼<><C2BC><EFBFBD><EFBFBD>').value:=employee;
t_op_kuaidi_manage.open;
end;
procedure Tfrm_op_kuaidi_manage.Panel1Resize(Sender: TObject);
var
i:integer;
begin
i:=round(Panel1.width/9);
bsSkinButton7.width:=i;
bsSkinButton6.width:=i;
bsSkinButton8.width:=i;
bsSkinButton2.width:=i;
bsSkinButton3.width:=i;
bsSkinButton4.width:=i;
bsSkinButton5.width:=i;
bsSkinButton1.width:=i;
end;
procedure Tfrm_op_kuaidi_manage.bsSkinButton5Click(Sender: TObject);
begin
Edit1.text:='';
wwDBComboBox1.text:='';
wwDBComboBox2.text:='';
Edit2.text:='';
RxDBLookupCombo2.ClearValue;
RxDBLookupCombo1.ClearValue;
RxDBLookupCombo5.ClearValue;
Edit3.text:='';
wwDBDateTimePicker4.text:='';
wwDBDateTimePicker1.text:='';
wwDBDateTimePicker3.text:='';
wwDBDateTimePicker2.text:='';
end;
procedure Tfrm_op_kuaidi_manage.bsSkinButton1Click(Sender: TObject);
var
str:widestring;
begin
if Edit1.text<>''then
str:=str+' and <20><><EFBFBD>ݱ<EFBFBD><DDB1><EFBFBD> like '+''''+'%'+Edit1.text+'%'+'''';
if wwDBComboBox1.text<>''then
str:=str+' and <20>շ<EFBFBD><D5B7><EFBFBD><EFBFBD><EFBFBD>='+''''+wwDBComboBox1.text+'''';
if wwDBComboBox2.text<>''then
str:=str+' and <20><><EFBFBD>ѷ<EFBFBD>ʽ='+''''+wwDBComboBox2.text+'''';
if Edit2.text<>''then
str:=str+' and ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> like '+''''+'%'+Edit2.text+'%'+'''';
if RxDBLookupCombo2.DisplayValue<>''then
str:=str+' and <20><><EFBFBD>ݹ<EFBFBD>˾='+''''+RxDBLookupCombo2.DisplayValues[1]+'''';
if RxDBLookupCombo1.DisplayValue<>''then
str:=str+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo1.DisplayValues[1]+'''';
if RxDBLookupCombo5.DisplayValue<>''then
str:=str+' and <20>շ<EFBFBD><D5B7><EFBFBD>Ա='+''''+RxDBLookupCombo5.DisplayValue+'''';
if Edit3.text<>''then
str:=str+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> like '+''''+'%'+Edit3.text+'%'+'''';
if wwDBDateTimePicker4.text<>''then
str:=str+' and <20>շ<EFBFBD>ʱ<EFBFBD><CAB1>>='+''''+wwDBDateTimePicker4.text+'''';
if wwDBDateTimePicker1.text<>''then
str:=str+' and <20>շ<EFBFBD>ʱ<EFBFBD><CAB1><='+''''+wwDBDateTimePicker1.text+'''';
if wwDBDateTimePicker3.text<>''then
str:=str+' and ¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker3.text+'''';
if wwDBDateTimePicker2.text<>''then
str:=str+' and ¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker2.text+'''';
if str<>''then
begin
STR:=COPY(STR,5,LENGTH(STR)-4);
STR:='WHERE '+STR;
end;
str:='select * from t_op_kuaidi_manage '+str+' order by <20><><EFBFBD>ݱ<EFBFBD><DDB1><EFBFBD>';
t_op_kuaidi_manage.close;
t_op_kuaidi_manage.SQL.clear;
t_op_kuaidi_manage.sql.add(str);
t_op_kuaidi_manage.open;
end;
procedure Tfrm_op_kuaidi_manage.t_op_kuaidi_manageBeforeEdit(
DataSet: TDataSet);
begin
if t_op_kuaidi_manage.fieldbyname('¼<><C2BC><EFBFBD><EFBFBD>').asstring<>employee then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD>޸<EFBFBD><DEB8><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD>');
abort;
end;
end;
end.