|
|
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['ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>';
|
|
|
t_cw_kemu_seae['<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>']:=t_cw_kemu['<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>'];
|
|
|
}
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_cw_kemu.t_cw_kemu_seaiAfterInsert(DataSet: TDataSet);
|
|
|
begin
|
|
|
{
|
|
|
t_cw_kemu_seai['ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='<27><><EFBFBD>˽<EFBFBD><CBBD><EFBFBD>';
|
|
|
t_cw_kemu_seai['<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>']:=t_cw_kemu['<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>'];
|
|
|
}
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_cw_kemu.t_cw_kemu_aireAfterInsert(DataSet: TDataSet);
|
|
|
begin
|
|
|
{
|
|
|
t_cw_kemu_aire['ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>';
|
|
|
t_cw_kemu_aire['<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>']:=t_cw_kemu['<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>'];
|
|
|
}
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_cw_kemu.t_cw_kemu_airiAfterInsert(DataSet: TDataSet);
|
|
|
begin
|
|
|
{
|
|
|
t_cw_kemu_airi['ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='<27><><EFBFBD>˽<EFBFBD><CBBD><EFBFBD>';
|
|
|
t_cw_kemu_airi['<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>']:=t_cw_kemu['<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>'];
|
|
|
}
|
|
|
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('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',2,nil,nil,
|
|
|
nil,nil,nil,t_crm_client1,nil,nil,nil,nil,nil);
|
|
|
{
|
|
|
if not t_cw_kemu_seae.Locate('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',frm_data_share.t_code_fee_type.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,[])then
|
|
|
begin
|
|
|
t_cw_kemu_seae.insert;
|
|
|
t_cw_kemu_seae['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=frm_data_share.t_code_fee_type.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
t_cw_kemu_seae.post;
|
|
|
end;
|
|
|
}
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_cw_kemu.bsSkinButton11Click(Sender: TObject);
|
|
|
begin
|
|
|
{
|
|
|
if not t_cw_kemu_seai.Locate('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',frm_data_share.t_code_fee_type.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,[])then
|
|
|
begin
|
|
|
t_cw_kemu_seai.insert;
|
|
|
t_cw_kemu_seai['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=frm_data_share.t_code_fee_type.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
t_cw_kemu_seai.post;
|
|
|
end;
|
|
|
}
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_cw_kemu.bsSkinButton17Click(Sender: TObject);
|
|
|
begin
|
|
|
{
|
|
|
if not t_cw_kemu_aire.Locate('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',frm_data_share.t_code_fee_type.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,[])then
|
|
|
begin
|
|
|
t_cw_kemu_aire.insert;
|
|
|
t_cw_kemu_aire['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=frm_data_share.t_code_fee_type.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
t_cw_kemu_aire.post;
|
|
|
end;
|
|
|
}
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_cw_kemu.bsSkinButton13Click(Sender: TObject);
|
|
|
begin
|
|
|
{
|
|
|
if not t_cw_kemu_airi.Locate('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',frm_data_share.t_code_fee_type.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,[])then
|
|
|
begin
|
|
|
t_cw_kemu_airi.insert;
|
|
|
t_cw_kemu_airi['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=frm_data_share.t_code_fee_type.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').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('<27><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>',UpperCase(E.Message))<>0 then
|
|
|
begin
|
|
|
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룡');
|
|
|
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('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><C4B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룡');
|
|
|
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('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><C4B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룡');
|
|
|
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('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><C4B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룡');
|
|
|
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('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><C4B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룡');
|
|
|
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.
|