unit u_cw_kemu; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, DB, ADODB, dxExEdtr, dxCntner, dxTL, dxDBCtrl, dxDBGrid, bsSkinCtrls, StdCtrls, RxLookup, ExtCtrls, ComCtrls, bsSkinTabs, Mask, wwdbedit, Wwdotdot, Wwdbcomb, bsSkinBoxCtrls, CheckLst, DBCtrls, bsdbctrls, Grids, DBGridEh; type Tfrm_cw_kemu = class(TForm) t_crm_client: TADOQuery; t_crm_client1: TDataSource; t_sys_bank: TADOQuery; t_sys_bank1: TDataSource; bsSkinPageControl1: TbsSkinPageControl; bsSkinTabSheet1: TbsSkinTabSheet; bsSkinTabSheet2: TbsSkinTabSheet; Label4: TLabel; bsSkinTabSheet3: TbsSkinTabSheet; DBGridEh1: TDBGridEh; DBGridEh2: TDBGridEh; bsSkinTabSheet4: TbsSkinTabSheet; t_sys_department: TADOQuery; t_sys_department1: TDataSource; DBGridEh3: TDBGridEh; t_sys_employee: TADOQuery; t_sys_employee1: TDataSource; DBGridEh4: TDBGridEh; bsSkinTabSheet5: TbsSkinTabSheet; ACCITEMS: TADOQuery; DataSource1: TDataSource; DBGridEh5: TDBGridEh; bsSkinPanel1: TbsSkinPanel; bsSkinButton5: TbsSkinButton; Label1: TLabel; bsSkinPanel2: TbsSkinPanel; bsSkinTabSheet6: TbsSkinTabSheet; t_code_currency: TADOQuery; t_code_currency1: TDataSource; DBGridEh6: TDBGridEh; bsSkinButton9: TbsSkinButton; bsSkinPanel3: TbsSkinPanel; lbl1: TLabel; t_cw_design1: TDataSource; t_cw_design: TADOQuery; DBEdit5: TDBEdit; Label2: TLabel; DBEdit1: TDBEdit; DBEdit2: TDBEdit; Label3: TLabel; procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure bsSkinButton5Click(Sender: TObject); procedure bsSkinButton1Click(Sender: TObject); procedure bsSkinButton2Click(Sender: TObject); procedure bsSkinButton6Click(Sender: TObject); procedure t_cw_kemu_seaeAfterInsert(DataSet: TDataSet); procedure t_cw_kemu_seaiAfterInsert(DataSet: TDataSet); procedure t_cw_kemu_aireAfterInsert(DataSet: TDataSet); procedure t_cw_kemu_airiAfterInsert(DataSet: TDataSet); procedure t_cw_kemu_seaeBeforeInsert(DataSet: TDataSet); procedure bsSkinButton4Click(Sender: TObject); procedure bsSkinButton7Click(Sender: TObject); procedure bsSkinButton3Click(Sender: TObject); procedure wwDBComboBox1Enter(Sender: TObject); procedure bsSkinButton10Click(Sender: TObject); procedure bsSkinButton12Click(Sender: TObject); procedure bsSkinButton18Click(Sender: TObject); procedure bsSkinButton14Click(Sender: TObject); procedure bsSkinButton9Click(Sender: TObject); procedure bsSkinButton11Click(Sender: TObject); procedure bsSkinButton17Click(Sender: TObject); procedure bsSkinButton13Click(Sender: TObject); procedure t_cw_kemuPostError(DataSet: TDataSet; E: EDatabaseError; var Action: TDataAction); procedure t_cw_kemu_seaePostError(DataSet: TDataSet; E: EDatabaseError; var Action: TDataAction); procedure t_cw_kemu_seaiPostError(DataSet: TDataSet; E: EDatabaseError; var Action: TDataAction); procedure t_cw_kemu_airePostError(DataSet: TDataSet; E: EDatabaseError; var Action: TDataAction); procedure t_cw_kemu_airiPostError(DataSet: TDataSet; E: EDatabaseError; var Action: TDataAction); procedure FormShow(Sender: TObject); procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); private { Private declarations } public { Public declarations } end; var frm_cw_kemu: Tfrm_cw_kemu; implementation uses u_main, my_sys_function, u_data_share; {$R *.dfm} procedure Tfrm_cw_kemu.FormClose(Sender: TObject; var Action: TCloseAction); begin frm_cw_kemu.Hide; frm_cw_kemu.ManualFloat(frm_cw_kemu.BoundsRect ); frm_main.freeTabs('frm_cw_kemu'); action:=cafree; frm_cw_kemu:=nil; end; procedure Tfrm_cw_kemu.bsSkinButton5Click(Sender: TObject); begin close; end; procedure Tfrm_cw_kemu.bsSkinButton1Click(Sender: TObject); begin // table_post(t_cw_design); end; procedure Tfrm_cw_kemu.bsSkinButton2Click(Sender: TObject); begin // table_cancel(t_cw_design); end; procedure Tfrm_cw_kemu.bsSkinButton6Click(Sender: TObject); begin // table_delete(t_cw_kemu); end; procedure Tfrm_cw_kemu.t_cw_kemu_seaeAfterInsert(DataSet: TDataSet); begin { t_cw_kemu_seae['业务种类']:='海运出口'; t_cw_kemu_seae['科目类别']:=t_cw_kemu['科目类别']; } end; procedure Tfrm_cw_kemu.t_cw_kemu_seaiAfterInsert(DataSet: TDataSet); begin { t_cw_kemu_seai['业务种类']:='海运进口'; t_cw_kemu_seai['科目类别']:=t_cw_kemu['科目类别']; } end; procedure Tfrm_cw_kemu.t_cw_kemu_aireAfterInsert(DataSet: TDataSet); begin { t_cw_kemu_aire['业务种类']:='空运出口'; t_cw_kemu_aire['科目类别']:=t_cw_kemu['科目类别']; } end; procedure Tfrm_cw_kemu.t_cw_kemu_airiAfterInsert(DataSet: TDataSet); begin { t_cw_kemu_airi['业务种类']:='空运进口'; t_cw_kemu_airi['科目类别']:=t_cw_kemu['科目类别']; } end; procedure Tfrm_cw_kemu.t_cw_kemu_seaeBeforeInsert(DataSet: TDataSet); begin { if t_cw_kemu.IsEmpty then exit; table_post(t_cw_kemu); } end; procedure Tfrm_cw_kemu.bsSkinButton4Click(Sender: TObject); begin // table_post(t_cw_kemu); end; procedure Tfrm_cw_kemu.bsSkinButton7Click(Sender: TObject); begin // table_cancel(t_cw_kemu); end; procedure Tfrm_cw_kemu.bsSkinButton3Click(Sender: TObject); begin // t_cw_kemu.insert; end; procedure Tfrm_cw_kemu.wwDBComboBox1Enter(Sender: TObject); begin { if t_cw_kemu_seae.IsEmpty and t_cw_kemu_seai.IsEmpty and t_cw_kemu_aire.IsEmpty and t_cw_kemu_airi.IsEmpty then begin wwDBComboBox1.ReadOnly:=false; end else begin wwDBComboBox1.ReadOnly:=true; end; } end; procedure Tfrm_cw_kemu.bsSkinButton10Click(Sender: TObject); begin //table_delete(t_cw_kemu_seae); end; procedure Tfrm_cw_kemu.bsSkinButton12Click(Sender: TObject); begin // table_delete(t_cw_kemu_seai); end; procedure Tfrm_cw_kemu.bsSkinButton18Click(Sender: TObject); begin // table_delete(t_cw_kemu_aire); end; procedure Tfrm_cw_kemu.bsSkinButton14Click(Sender: TObject); begin // table_delete(t_cw_kemu_airi); end; procedure Tfrm_cw_kemu.bsSkinButton9Click(Sender: TObject); begin sys_print('客户财务代码',2,nil,nil, nil,nil,nil,t_crm_client1,nil,nil,nil,nil,nil); { if not t_cw_kemu_seae.Locate('费用类别',frm_data_share.t_code_fee_type.fieldbyname('费用类别').asstring,[])then begin t_cw_kemu_seae.insert; t_cw_kemu_seae['费用类别']:=frm_data_share.t_code_fee_type.fieldbyname('费用类别').asstring; t_cw_kemu_seae.post; end; } end; procedure Tfrm_cw_kemu.bsSkinButton11Click(Sender: TObject); begin { if not t_cw_kemu_seai.Locate('费用类别',frm_data_share.t_code_fee_type.fieldbyname('费用类别').asstring,[])then begin t_cw_kemu_seai.insert; t_cw_kemu_seai['费用类别']:=frm_data_share.t_code_fee_type.fieldbyname('费用类别').asstring; t_cw_kemu_seai.post; end; } end; procedure Tfrm_cw_kemu.bsSkinButton17Click(Sender: TObject); begin { if not t_cw_kemu_aire.Locate('费用类别',frm_data_share.t_code_fee_type.fieldbyname('费用类别').asstring,[])then begin t_cw_kemu_aire.insert; t_cw_kemu_aire['费用类别']:=frm_data_share.t_code_fee_type.fieldbyname('费用类别').asstring; t_cw_kemu_aire.post; end; } end; procedure Tfrm_cw_kemu.bsSkinButton13Click(Sender: TObject); begin { if not t_cw_kemu_airi.Locate('费用类别',frm_data_share.t_code_fee_type.fieldbyname('费用类别').asstring,[])then begin t_cw_kemu_airi.insert; t_cw_kemu_airi['费用类别']:=frm_data_share.t_code_fee_type.fieldbyname('费用类别').asstring; t_cw_kemu_airi.post; end; } end; procedure Tfrm_cw_kemu.t_cw_kemuPostError(DataSet: TDataSet; E: EDatabaseError; var Action: TDataAction); begin if pos('科目代码',UpperCase(E.Message))<>0 then begin showmessage('你所输入的科目代码重复请重新输入!'); abort; end; end; procedure Tfrm_cw_kemu.t_cw_kemu_seaePostError(DataSet: TDataSet; E: EDatabaseError; var Action: TDataAction); begin { if pos('PRIMARY',UpperCase(E.Message))<>0 then begin showmessage('你所输入的费用类别重复请重新输入!'); t_cw_kemu_seae.cancel; abort; end; } end; procedure Tfrm_cw_kemu.t_cw_kemu_seaiPostError(DataSet: TDataSet; E: EDatabaseError; var Action: TDataAction); begin { if pos('PRIMARY',UpperCase(E.Message))<>0 then begin showmessage('你所输入的费用类别重复请重新输入!'); t_cw_kemu_seai.cancel; abort; end; } end; procedure Tfrm_cw_kemu.t_cw_kemu_airePostError(DataSet: TDataSet; E: EDatabaseError; var Action: TDataAction); begin { if pos('PRIMARY',UpperCase(E.Message))<>0 then begin showmessage('你所输入的费用类别重复请重新输入!'); t_cw_kemu_aire.cancel; abort; end; } end; procedure Tfrm_cw_kemu.t_cw_kemu_airiPostError(DataSet: TDataSet; E: EDatabaseError; var Action: TDataAction); begin { if pos('PRIMARY',UpperCase(E.Message))<>0 then begin showmessage('你所输入的费用类别重复请重新输入!'); t_cw_kemu_airi.cancel; abort; end; } end; procedure Tfrm_cw_kemu.FormShow(Sender: TObject); begin if not t_crm_client.Active then t_crm_client.open; if not t_sys_department.Active then t_sys_department.open; if not t_sys_employee.Active then t_sys_employee.open; if not t_sys_bank.Active then t_sys_bank.open; if not accitems.Active then accitems.open; if not t_sys_bank.Active then t_sys_bank.open; if not t_code_currency.Active then t_code_currency.Open; if not t_cw_design.Active then t_cw_design.Open; end; procedure Tfrm_cw_kemu.FormCloseQuery(Sender: TObject; var CanClose: Boolean); begin if t_crm_client.state in [dsedit] then t_crm_client.post; t_crm_client.close; if t_sys_department.state in [dsedit] then t_sys_department.post; t_sys_department.close; if t_sys_employee.state in [dsedit] then t_sys_employee.post; t_sys_employee.close; if t_sys_bank.state in [dsedit] then t_sys_bank.post; t_sys_bank.close; if accitems.state in [dsedit] then accitems.post; accitems.close; if t_sys_bank.state in [dsedit] then t_sys_bank.post; t_sys_bank.close; if t_code_currency.state in [dsedit] then t_code_currency.post; t_code_currency.close; if t_cw_design.state in [dsedit] then t_cw_design.post; t_cw_design.close; CanClose:=true; end; end.