|
|
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, Menus;
|
|
|
|
|
|
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;
|
|
|
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;
|
|
|
DBEdit3: TDBEdit;
|
|
|
Label5: TLabel;
|
|
|
dxDBGrid1: TdxDBGrid;
|
|
|
dxDBGrid1Column1: TdxDBGridColumn;
|
|
|
dxDBGrid1Column2: TdxDBGridColumn;
|
|
|
dxDBGrid1Column3: TdxDBGridColumn;
|
|
|
dxDBGrid1Column4: TdxDBGridColumn;
|
|
|
dxDBGrid1Column5: TdxDBGridColumn;
|
|
|
bsSkinTabSheet7: TbsSkinTabSheet;
|
|
|
DBGridEh1: TDBGridEh;
|
|
|
t_code_stlmode: TADOQuery;
|
|
|
t_code_stlmode1: TDataSource;
|
|
|
Edit1: TEdit;
|
|
|
Label15: TLabel;
|
|
|
Label16: TLabel;
|
|
|
Edit2: TEdit;
|
|
|
Label17: TLabel;
|
|
|
Edit3: TEdit;
|
|
|
bsSkinButton8: TbsSkinButton;
|
|
|
bsSkinButton1: TbsSkinButton;
|
|
|
DBNavigator1: TDBNavigator;
|
|
|
bsSkinComboBox1: TbsSkinComboBox;
|
|
|
Label6: TLabel;
|
|
|
PopupMenu1: TPopupMenu;
|
|
|
N1: TMenuItem;
|
|
|
bsSkinTabSheet8: TbsSkinTabSheet;
|
|
|
dxDBGrid2: TdxDBGrid;
|
|
|
dxDBGridColumn1: TdxDBGridColumn;
|
|
|
dxDBGridColumn2: TdxDBGridColumn;
|
|
|
t_crm_client_acc1: TDataSource;
|
|
|
t_crm_client_acc: TADOQuery;
|
|
|
dxDBGrid2Column3: TdxDBGridColumn;
|
|
|
bsSkinTabSheet9: TbsSkinTabSheet;
|
|
|
bsSkinTabSheet10: TbsSkinTabSheet;
|
|
|
t_code_trade: TADOQuery;
|
|
|
t_code_trade1: TDataSource;
|
|
|
t_code_airtrade: TADOQuery;
|
|
|
t_code_airtrade1: TDataSource;
|
|
|
DBGridEh7: TDBGridEh;
|
|
|
DBGridEh8: TDBGridEh;
|
|
|
dxDBGrid1Column6: TdxDBGridColumn;
|
|
|
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);
|
|
|
procedure ACCITEMSAfterInsert(DataSet: TDataSet);
|
|
|
procedure bsSkinButton8Click(Sender: TObject);
|
|
|
procedure dxDBGrid1CustomDraw(Sender: TObject; ACanvas: TCanvas;
|
|
|
ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxDBTreeListColumn;
|
|
|
const AText: String; AFont: TFont; var AColor: TColor; ASelected,
|
|
|
AFocused: Boolean; var ADone: Boolean);
|
|
|
procedure N1Click(Sender: TObject);
|
|
|
procedure t_crm_client_accAfterInsert(DataSet: TDataSet);
|
|
|
procedure DBGridEh5DblClick(Sender: TObject);
|
|
|
procedure t_crm_client_accBeforeDelete(DataSet: TDataSet);
|
|
|
private
|
|
|
{ Private declarations }
|
|
|
public
|
|
|
{ Public declarations }
|
|
|
function GetCorpUseStatus(sname:string):boolean;
|
|
|
function GetAccCorpUseStatus(CORPID:string):boolean;
|
|
|
end;
|
|
|
|
|
|
var
|
|
|
frm_cw_kemu: Tfrm_cw_kemu;
|
|
|
|
|
|
implementation
|
|
|
|
|
|
uses u_main, my_sys_function, u_data_share;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
function Tfrm_cw_kemu.GetCorpUseStatus(sname:string):boolean;
|
|
|
var aAdoQuery:TAdoQuery;
|
|
|
begin
|
|
|
Result:=false;
|
|
|
aAdoQuery:=CreateAdoQuery;
|
|
|
with aAdoQuery do
|
|
|
try
|
|
|
Close;SQL.Clear;
|
|
|
SQL.Add('select top 1 <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> from t_ch_fee');
|
|
|
SQL.Add('where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+sname+'''');
|
|
|
Open;
|
|
|
Result:=RecordCount>=1;
|
|
|
finally
|
|
|
Free;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
function Tfrm_cw_kemu.GetAccCorpUseStatus(CORPID:string):boolean;
|
|
|
var aAdoQuery:TAdoQuery;
|
|
|
begin
|
|
|
Result:=false;
|
|
|
aAdoQuery:=CreateAdoQuery;
|
|
|
with aAdoQuery do
|
|
|
try
|
|
|
Close;SQL.Clear;
|
|
|
SQL.Add('select top 1 CORPID from vouItems');
|
|
|
SQL.Add('where CORPID='+''''+CORPID+'''');
|
|
|
Open;
|
|
|
Result:=RecordCount>=1;
|
|
|
finally
|
|
|
Free;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
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);
|
|
|
// 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
|
|
|
if t_crm_client.state in [dsedit,dsinsert] then t_crm_client.post;
|
|
|
{
|
|
|
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;
|
|
|
|
|
|
if not t_code_stlmode.Active then
|
|
|
t_code_stlmode.Open;
|
|
|
|
|
|
|
|
|
if not t_crm_client_acc.Active then
|
|
|
t_crm_client_acc.Open;
|
|
|
|
|
|
if not t_code_airtrade.Active then
|
|
|
t_code_airtrade.Open;
|
|
|
|
|
|
if not t_code_trade.Active then
|
|
|
t_code_trade.Open;
|
|
|
|
|
|
{
|
|
|
|
|
|
with t_crm_client do
|
|
|
begin
|
|
|
First;
|
|
|
while not eof do
|
|
|
begin
|
|
|
if not FieldByName('<27>Ƿ<EFBFBD>ʹ<EFBFBD><CAB9>').AsBoolean then
|
|
|
begin
|
|
|
if GetCorpUseStatus(FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring) then
|
|
|
begin
|
|
|
Edit;
|
|
|
FieldByName('<27>Ƿ<EFBFBD>ʹ<EFBFBD><CAB9>').AsBoolean:=true;
|
|
|
post;
|
|
|
end;
|
|
|
end;
|
|
|
Next;
|
|
|
end;
|
|
|
end;
|
|
|
}
|
|
|
dxDBGrid1Column1.ReadOnly:=true;
|
|
|
dxDBGrid1Column2.ReadOnly:=true;
|
|
|
dxDBGrid1Column3.ReadOnly:=true;
|
|
|
|
|
|
dxDBGrid2Column3.ReadOnly:=true;
|
|
|
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;
|
|
|
|
|
|
if t_code_stlmode.state in [dsedit] then
|
|
|
t_code_stlmode.post;
|
|
|
t_code_stlmode.close;
|
|
|
|
|
|
CanClose:=true;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_cw_kemu.ACCITEMSAfterInsert(DataSet: TDataSet);
|
|
|
begin
|
|
|
ACCITEMS['DETAILED']:='T';
|
|
|
ACCITEMS['DC']:='D';
|
|
|
ACCITEMS['FCY']:='F';
|
|
|
ACCITEMS['DEPTACC']:='F';
|
|
|
ACCITEMS['EMPLACC']:='F';
|
|
|
ACCITEMS['CORPACC']:='F';
|
|
|
ACCITEMS['ITEMACC']:='F';
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_cw_kemu.bsSkinButton8Click(Sender: TObject);
|
|
|
var
|
|
|
str:widestring;
|
|
|
begin
|
|
|
|
|
|
if t_crm_client.state in [dsedit,dsinsert] then t_crm_client.post;
|
|
|
|
|
|
str:='where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><>'+''''+'Ŀ<><C4BF>'+'''';
|
|
|
if Edit1.text<>''then
|
|
|
begin
|
|
|
str:=str+' and <20><><EFBFBD><EFBFBD> like '+''''+'%'+Edit1.text+'%'+'''';
|
|
|
end;
|
|
|
if Edit2.text<>''then
|
|
|
begin
|
|
|
str:=str+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> like '+''''+'%'+Edit2.text+'%'+'''';
|
|
|
end;
|
|
|
if Edit3.text<>''then
|
|
|
begin
|
|
|
str:=str+' and <20>ͻ<EFBFBD>ȫ<EFBFBD><C8AB> like '+''''+'%'+Edit3.text+'%'+'''';
|
|
|
end;
|
|
|
|
|
|
case bsSkinComboBox1.ItemIndex of
|
|
|
0: begin
|
|
|
str:=str+' and (((<28><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD>ʿ<EFBFBD><CABF><EFBFBD><EFBFBD><EFBFBD>='''') or (<28><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD>ʿ<EFBFBD><CABF><EFBFBD><EFBFBD><EFBFBD> is null)) and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> in (select <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> from t_ch_fee where <20><><EFBFBD><EFBFBD>=''<27><>''))';
|
|
|
end;
|
|
|
1: begin
|
|
|
str:=str+' and (((<28><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD>ʿ<EFBFBD><CABF><EFBFBD><EFBFBD><EFBFBD>='''') or (<28><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD>ʿ<EFBFBD><CABF><EFBFBD><EFBFBD><EFBFBD> is null)) and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> in (select <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> from t_ch_fee where <20><><EFBFBD><EFBFBD>=''<27><>''))';
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
t_crm_client.close;
|
|
|
t_crm_client.sql.clear;
|
|
|
t_crm_client.sql.add('select * from t_crm_client '+str+' order by <20><><EFBFBD><EFBFBD>');
|
|
|
t_crm_client.open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_cw_kemu.dxDBGrid1CustomDraw(Sender: TObject;
|
|
|
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
|
|
|
AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont;
|
|
|
var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean);
|
|
|
begin
|
|
|
{
|
|
|
if UpperCase(ANode.Strings[dxDBGrid1Column6.Index])='TRUE' then
|
|
|
begin
|
|
|
if (trim(ANode.Strings[dxDBGrid1Column4.Index])='') and (trim(ANode.Strings[dxDBGrid1Column4.Index])='') then
|
|
|
AFont.Color:=clRed;
|
|
|
end
|
|
|
else
|
|
|
AFont.Color:=clblack;
|
|
|
}
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_cw_kemu.N1Click(Sender: TObject);
|
|
|
begin
|
|
|
grid_save_xls(dxdbgrid1);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_cw_kemu.t_crm_client_accAfterInsert(DataSet: TDataSet);
|
|
|
begin
|
|
|
if Trim(ACCITEMS.FieldByName('ACCID').AsString)<>'' then
|
|
|
begin
|
|
|
t_crm_client_acc['Accid']:=Trim(ACCITEMS.FieldByName('ACCID').AsString);
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
ShowMessage('<27><>Ӧ<EFBFBD>Ŀ<EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
Abort;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_cw_kemu.DBGridEh5DblClick(Sender: TObject);
|
|
|
begin
|
|
|
bsSkinPageControl1.ActivePageIndex:=6;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_cw_kemu.t_crm_client_accBeforeDelete(DataSet: TDataSet);
|
|
|
begin
|
|
|
if GetAccCorpUseStatus(t_crm_client_acc.FieldByName('<27><><EFBFBD><EFBFBD>').AsString) then
|
|
|
begin
|
|
|
Showmessage('<27>ͻ<EFBFBD>:'+t_crm_client_acc.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString+'<27>Ѿ<EFBFBD>ʹ<EFBFBD><CAB9>,<2C><><EFBFBD><EFBFBD><EFBFBD>Ļ<DEB8>ɾ<EFBFBD><C9BE>');
|
|
|
Abort;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
end.
|