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.

804 lines
26 KiB
Plaintext

11 months ago
unit u_code_fee_project_auto;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, BusinessSkinForm, DB, ADODB, bsSkinCtrls, ExtCtrls, Grids,
Wwdbigrd, Wwdbgrid, StdCtrls, Mask, wwdbedit, Wwdotdot, Wwdbcomb,
wwdblook, RxMemDS, DBCtrls, ComCtrls, bsSkinTabs, dxExEdtr, dxTL,
dxDBCtrl, dxDBGrid, dxCntner, wwdbdatetimepicker, dxDBTLCl, dxGrClms,
bsdbctrls, RxLookup,ComObj;
type
Tfrm_code_fee_project_auto = class(TForm)
t_ch_project: TADOQuery;
t_ch_project1: TDataSource;
t_ch_project_fee: TADOQuery;
t_ch_project_fee1: TDataSource;
t_bz_balance: TRxMemoryData;
t_bz_client: TRxMemoryData;
Panel3: TPanel;
bsSkinButton1: TbsSkinButton;
bsSkinButton2: TbsSkinButton;
bsSkinButton4: TbsSkinButton;
bsSkinButton3: TbsSkinButton;
bsSkinRadioGroup1: TbsSkinRadioGroup;
bsSkinPanel2: TbsSkinPanel;
bsSkinPanel3: TbsSkinPanel;
dxDBGrid1: TdxDBGrid;
bsSkinPanel4: TbsSkinPanel;
Label1: TLabel;
DBEdit2: TDBEdit;
Label8: TLabel;
wwDBDateTimePicker2: TwwDBDateTimePicker;
Label9: TLabel;
wwDBDateTimePicker1: TwwDBDateTimePicker;
Label2: TLabel;
DBEdit1: TDBEdit;
Label3: TLabel;
DBEdit3: TDBEdit;
bsSkinGroupBox1: TbsSkinGroupBox;
bsSkinPanel5: TbsSkinPanel;
bsSkinButton21: TbsSkinButton;
bsSkinButton20: TbsSkinButton;
bsSkinButton19: TbsSkinButton;
bsSkinButton17: TbsSkinButton;
t_ch_project_Condition1: TDataSource;
t_ch_project_Condition: TADOQuery;
bsSkinDBCheckRadioBox1: TbsSkinDBCheckRadioBox;
dxDBGrid1Column1: TdxDBGridColumn;
dxDBGrid1Column2: TdxDBGridColumn;
dxDBGrid1Column3: TdxDBGridColumn;
dxDBGrid1Column4: TdxDBGridColumn;
dxDBGrid1Column5: TdxDBGridCheckColumn;
bsSkinGroupBox2: TbsSkinGroupBox;
Panel2: TPanel;
Panel4: TPanel;
bsSkinButton5: TbsSkinButton;
bsSkinButton6: TbsSkinButton;
bsSkinButton7: TbsSkinButton;
bsSkinButton8: TbsSkinButton;
wwDBGrid2: TwwDBGrid;
wwDBLookupCombo2: TwwDBLookupCombo;
wwDBLookupCombo3: TwwDBLookupCombo;
wwDBLookupCombo1: TwwDBLookupCombo;
wwDBLookupCombo6: TwwDBLookupCombo;
DBEdit4: TDBEdit;
wwDBLookupCombo5: TwwDBLookupCombo;
wwDBLookupCombo4: TwwDBLookupCombo;
bsSkinButton10: TbsSkinButton;
wwDBComboBox2: TwwDBComboBox;
bsSkinPanel1: TbsSkinPanel;
dxDBGrid2: TdxDBGrid;
dxDBGridColumn1: TdxDBGridColumn;
dxDBGridColumn2: TdxDBGridColumn;
dxDBGridColumn3: TdxDBGridColumn;
bsSkinButton9: TbsSkinButton;
bsSkinPanel6: TbsSkinPanel;
bsSkinButton44: TbsSkinButton;
RxDBLookupCombo57: TRxDBLookupCombo;
Label213: TLabel;
Label17: TLabel;
RxDBLookupCombo7: TRxDBLookupCombo;
Label12: TLabel;
RxDBLookupCombo1: TRxDBLookupCombo;
wwDBComboBox1: TwwDBComboBox;
Label4: TLabel;
bsSkinButton11: TbsSkinButton;
Label5: TLabel;
wwDBComboBox3: TwwDBComboBox;
dxDBGrid1Column6: TdxDBGridColumn;
dxDBGrid1Column7: TdxDBGridColumn;
dxDBGrid1Column8: TdxDBGridColumn;
Label6: TLabel;
DBEdit5: TDBEdit;
bsSkinDBCheckRadioBox2: TbsSkinDBCheckRadioBox;
Edit1: TEdit;
bsSkinPageControl1: TbsSkinPageControl;
bsSkinTabSheet1: TbsSkinTabSheet;
bsSkinTabSheet2: TbsSkinTabSheet;
Panel1: TPanel;
bsSkinButton12: TbsSkinButton;
bsSkinButton13: TbsSkinButton;
bsSkinButton14: TbsSkinButton;
bsSkinButton15: TbsSkinButton;
bsSkinButton16: TbsSkinButton;
dxDBGrid3: TdxDBGrid;
dxDBGridMaskColumn2: TdxDBGridMaskColumn;
RxDBLookupCombo2: TRxDBLookupCombo;
Label7: TLabel;
t_ch_project_Cust1: TDataSource;
t_ch_project_Cust: TADOQuery;
dxDBGrid3Column2: TdxDBGridColumn;
dxDBGrid3Column3: TdxDBGridColumn;
DBEdit6: TDBEdit;
Label10: TLabel;
Label11: TLabel;
DBEdit7: TDBEdit;
OpenDialog1: TOpenDialog;
bsSkinButton18: TbsSkinButton;
bsSkinButton22: TbsSkinButton;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormShow(Sender: TObject);
procedure Panel3Resize(Sender: TObject);
procedure bsSkinButton9Click(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
procedure bsSkinButton2Click(Sender: TObject);
procedure bsSkinButton4Click(Sender: TObject);
procedure bsSkinButton3Click(Sender: TObject);
procedure bsSkinButton5Click(Sender: TObject);
procedure bsSkinButton6Click(Sender: TObject);
procedure bsSkinButton7Click(Sender: TObject);
procedure bsSkinButton8Click(Sender: TObject);
procedure t_ch_projectAfterInsert(DataSet: TDataSet);
procedure t_ch_projectBeforePost(DataSet: TDataSet);
procedure t_ch_project_feeBeforePost(DataSet: TDataSet);
procedure t_ch_project_feeBeforeInsert(DataSet: TDataSet);
procedure t_ch_project_standardBeforeInsert(DataSet: TDataSet);
procedure wwDBLookupCombo1Change(Sender: TObject);
procedure t_ch_projectBeforeEdit(DataSet: TDataSet);
procedure t_ch_projectPostError(DataSet: TDataSet; E: EDatabaseError;
var Action: TDataAction);
procedure wwDBLookupCombo2Enter(Sender: TObject);
procedure t_ch_project_feeAfterOpen(DataSet: TDataSet);
procedure bsSkinRadioGroup1Checked(Sender: TObject);
procedure bsSkinButton17Click(Sender: TObject);
procedure bsSkinButton19Click(Sender: TObject);
procedure bsSkinButton20Click(Sender: TObject);
procedure bsSkinButton21Click(Sender: TObject);
procedure bsSkinButton10Click(Sender: TObject);
procedure t_ch_project_ConditionBeforeInsert(DataSet: TDataSet);
procedure t_ch_project_ConditionBeforePost(DataSet: TDataSet);
procedure bsSkinButton44Click(Sender: TObject);
procedure bsSkinButton11Click(Sender: TObject);
procedure dxDBGrid2DblClick(Sender: TObject);
procedure bsSkinButton16Click(Sender: TObject);
procedure bsSkinButton12Click(Sender: TObject);
procedure bsSkinButton13Click(Sender: TObject);
procedure bsSkinButton14Click(Sender: TObject);
procedure bsSkinButton15Click(Sender: TObject);
procedure t_ch_project_CustAfterInsert(DataSet: TDataSet);
procedure RxDBLookupCombo2Enter(Sender: TObject);
procedure RxDBLookupCombo2Exit(Sender: TObject);
procedure bsSkinButton18Click(Sender: TObject);
procedure bsSkinButton22Click(Sender: TObject);
private
procedure t_ch_feecurrcharge(Sender: TField);
{ Private declarations }
public
{ Public declarations }
end;
var
frm_code_fee_project_auto: Tfrm_code_fee_project_auto;
implementation
uses u_main, u_data_share, my_sys_function, u_code_fee_project_copy,
u_code_fee_project_auto_condition;
{$R *.dfm}
procedure Tfrm_code_fee_project_auto.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
frm_code_fee_project_auto.Hide;
frm_code_fee_project_auto.ManualFloat(frm_code_fee_project_auto.BoundsRect );
frm_main.freeTabs('frm_code_fee_project_auto');
action:=cafree;
frm_code_fee_project_auto:=nil;
end;
procedure Tfrm_code_fee_project_auto.FormShow(Sender: TObject);
var
i:integer;
begin
frm_data_share.t_code_fee_unit.Filtered:=false;
frm_data_share.t_code_fee_unit.Filter:='<27><><EFBFBD><EFBFBD>=1';
frm_data_share.t_code_fee_unit.Filtered:=true;
t_bz_balance.close;
t_bz_balance.open;
t_bz_balance.Append;
t_bz_balance['one']:='1-<2D><>Ʊ';
t_bz_balance['two']:='<27><>Ʊ';
t_bz_balance['three']:='<27><>Ʊ';
t_bz_balance.post;
t_bz_balance.Append;
t_bz_balance['one']:='2-<2D><><EFBFBD><EFBFBD>';
t_bz_balance['two']:='<27><><EFBFBD><EFBFBD>';
t_bz_balance['three']:='<27><><EFBFBD><EFBFBD>';
t_bz_balance.post;
t_bz_balance.Append;
t_bz_balance['one']:='3-<2D><><EFBFBD><EFBFBD>';
t_bz_balance['two']:='<27><><EFBFBD><EFBFBD>';
t_bz_balance['three']:='<27><><EFBFBD><EFBFBD>';
t_bz_balance.post;
t_bz_balance.Append;
t_bz_balance['one']:='4-<2D>ƷѶ<C6B7>';
t_bz_balance['two']:='<27>ƷѶ<C6B7>';
t_bz_balance['three']:='<27>ƷѶ<C6B7>';
t_bz_balance.Append;
t_bz_balance['one']:='5-TEU';
t_bz_balance['two']:='TEU';
t_bz_balance['three']:='TEU';
t_bz_balance.Append;
t_bz_balance['one']:='6-<2D><><EFBFBD><EFBFBD>';
t_bz_balance['two']:='<27><><EFBFBD><EFBFBD>';
t_bz_balance['three']:='<27><><EFBFBD><EFBFBD>';
t_bz_balance.Append;
t_bz_balance['one']:='7-<2D>յ<EFBFBD>Ʊ<EFBFBD><C6B1>';
t_bz_balance['two']:='<27>յ<EFBFBD>Ʊ<EFBFBD><C6B1>';
t_bz_balance['three']:='<27>յ<EFBFBD>Ʊ<EFBFBD><C6B1>';
t_bz_balance.Append;
t_bz_balance['one']:='8-<2D>յ<EFBFBD><D5B5><EFBFBD>Ʊ';
t_bz_balance['two']:='<27>յ<EFBFBD><D5B5><EFBFBD>Ʊ';
t_bz_balance['three']:='<27>յ<EFBFBD><D5B5><EFBFBD>Ʊ';
t_bz_balance.Append;
t_bz_balance['one']:='9-<2D><><EFBFBD><EFBFBD>СƱ<D0A1><C6B1>';
t_bz_balance['two']:='<27><><EFBFBD><EFBFBD>СƱ<D0A1><C6B1>';
t_bz_balance['three']:='<27><><EFBFBD><EFBFBD>СƱ<D0A1><C6B1>';
t_bz_balance.Append;
t_bz_balance['one']:='10-<2D><><EFBFBD><EFBFBD>СƱ<D0A1><C6B1>';
t_bz_balance['two']:='<27><><EFBFBD><EFBFBD>СƱ<D0A1><C6B1>';
t_bz_balance['three']:='<27><><EFBFBD><EFBFBD>СƱ<D0A1><C6B1>';
t_bz_balance.Append;
t_bz_balance['one']:='11-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>СƱ<D0A1><C6B1>';
t_bz_balance['two']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>СƱ<D0A1><C6B1>';
t_bz_balance['three']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>СƱ<D0A1><C6B1>';
frm_data_share.t_code_ctn.First;
while not frm_data_share.t_code_ctn.eof do begin
t_bz_balance.Append;
t_bz_balance['one']:=frm_data_share.t_code_ctn['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ'];
t_bz_balance['two']:=frm_data_share.t_code_ctn['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ'];
t_bz_balance['three']:=0;
t_bz_balance.post;
frm_data_share.t_code_ctn.next;
end;
t_bz_client.close;
t_bz_client.open;
t_bz_client.Append;
t_bz_client['one']:='0-ί<>е<EFBFBD>λ';
t_bz_client['two']:='ί<>е<EFBFBD>λ';
t_bz_client.post;
t_bz_client.Append;
t_bz_client['one']:='1-<2D><> <20><> ˾';
t_bz_client['two']:='<27><><EFBFBD><EFBFBD>˾';
t_bz_client.post;
t_bz_client.Append;
t_bz_client['one']:='2-<2D><> վ';
t_bz_client['two']:='<27><>վ';
t_bz_client.post;
t_bz_client.Append;
t_bz_client['one']:='3-<2D><> <20><>';
t_bz_client['two']:='<27><><EFBFBD><EFBFBD>';
t_bz_client.post;
t_bz_client.Append;
t_bz_client['one']:='4-<2D><> <20><> <20><>';
t_bz_client['two']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
t_bz_client.post;
t_bz_client.Append;
t_bz_client['one']:='5-<2D><> <20><>';
t_bz_client['two']:='<27><><EFBFBD><EFBFBD>';
t_bz_client.post;
t_bz_client.Append;
t_bz_client['one']:='6-<2D><> <20><>';
t_bz_client['two']:='<27><><EFBFBD><EFBFBD>';
t_bz_client.post;
t_bz_client.Append;
t_bz_client['one']:='7-<2D><> <20><>';
t_bz_client['two']:='<27><><EFBFBD><EFBFBD>';
t_bz_client.post;
{
t_bz_client.Append;
t_bz_client['one']:='7-<2D><> <20><> <20><>';
t_bz_client['two']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
t_bz_client.post;
t_bz_client.Append;
t_bz_client['one']:='8-<2D><> <20><> <20><>';
t_bz_client['two']:='<27>ջ<EFBFBD><D5BB><EFBFBD>';
t_bz_client.post;
t_bz_client.Append;
t_bz_client['one']:='9-ͨ ֪ <20><>';
t_bz_client['two']:='֪ͨ<CDA8><D6AA>';
t_bz_client.post;
t_bz_client.Append;
t_bz_client['one']:='10-<2D><> <20><>';
t_bz_client['two']:='<27><><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD>';
t_bz_client.post;
}
frm_data_share.t_code_fee.Filtered:=false;
frm_data_share.t_code_fee.Filter:='<27><><EFBFBD><EFBFBD>=1';
frm_data_share.t_code_fee.Filtered:=true;
t_ch_project.SQL.clear;
t_ch_project.sql.add('select * from t_ch_project_auto ');
t_ch_project.SQL.Add(' where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><>վ'' and '+open_data('8005','¼<><C2BC><EFBFBD><EFBFBD>','no','no','no','no')
+' order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
t_ch_project.open;
t_ch_project_fee.open;
t_ch_project_Condition.Open;
frm_data_share.t_code_fee.requery;
frm_data_share.t_crm_client.requery;
frm_data_share.t_code_currency.requery;
frm_data_share.t_code_ctn.requery;
t_ch_project_Cust.Open;
end;
procedure Tfrm_code_fee_project_auto.Panel3Resize(Sender: TObject);
var
i:integer;
begin
i:=round(Panel3.width/7);
bsSkinButton1.width:=i;
bsSkinButton2.width:=i;
bsSkinButton4.width:=i;
bsSkinButton3.width:=i;
bsSkinButton11.Width:=i;
end;
procedure Tfrm_code_fee_project_auto.bsSkinButton9Click(Sender: TObject);
begin
if not (t_ch_project_Condition.State in [dsedit]) then t_ch_project_Condition.Edit;
try
frm_code_fee_project_auto_condition:=tfrm_code_fee_project_auto_condition.Create (self);
frm_code_fee_project_auto_condition.ShowModal;
finally
frm_code_fee_project_auto_condition.Free;
end;
end;
procedure Tfrm_code_fee_project_auto.bsSkinButton1Click(Sender: TObject);
begin
t_ch_project.insert;
end;
procedure Tfrm_code_fee_project_auto.t_ch_feecurrcharge(Sender: TField);
begin
if (t_ch_project_fee.state=dsedit)or(t_ch_project_fee.state=dsinsert)then
begin
if t_ch_project_fee.FieldByName('<27>ұ<EFBFBD>').AsString='RMB' then begin
t_ch_project_fee.FieldByName('<27><><EFBFBD><EFBFBD>').Asfloat:=1;
end else begin
IF frm_data_share.t_code_currency.Locate('<27>ұ<EFBFBD>',t_ch_project_fee.FieldByName('<27>ұ<EFBFBD>').AsString,[])then
t_ch_project_fee['<27><><EFBFBD><EFBFBD>']:=frm_data_share.t_code_currency.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat;
end;
end;
end;
procedure Tfrm_code_fee_project_auto.bsSkinButton2Click(Sender: TObject);
begin
table_post(t_ch_project);
end;
procedure Tfrm_code_fee_project_auto.bsSkinButton4Click(Sender: TObject);
begin
table_delete(t_ch_project);
end;
procedure Tfrm_code_fee_project_auto.bsSkinButton3Click(Sender: TObject);
begin
table_cancel(t_ch_project);
end;
procedure Tfrm_code_fee_project_auto.bsSkinButton5Click(Sender: TObject);
begin
t_ch_project_fee.insert;
end;
procedure Tfrm_code_fee_project_auto.bsSkinButton6Click(Sender: TObject);
begin
table_post(t_ch_project_fee);
end;
procedure Tfrm_code_fee_project_auto.bsSkinButton7Click(Sender: TObject);
begin
table_delete(t_ch_project_fee);
end;
procedure Tfrm_code_fee_project_auto.bsSkinButton8Click(Sender: TObject);
begin
table_cancel(t_ch_project_fee);
end;
procedure Tfrm_code_fee_project_auto.t_ch_projectAfterInsert(DataSet: TDataSet);
var
feestr:string;
begin
feestr:=bsSkinRadioGroup1.Items[bsSkinRadioGroup1.ItemIndex];
t_ch_project['¼<><C2BC><EFBFBD><EFBFBD>']:=employee;
t_ch_project['¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=date;
if (feestr<>'ȫ<><C8AB>') then
t_ch_project['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=feestr;
t_ch_project['Ĭ<>Ϸ<EFBFBD><CFB7><EFBFBD>']:=1;
t_ch_project['<27><><EFBFBD>ȼ<EFBFBD>']:=0;
t_ch_project['<27>ո<EFBFBD><D5B8><EFBFBD><EFBFBD><EFBFBD>']:='ȫ<><C8AB>';
end;
procedure Tfrm_code_fee_project_auto.t_ch_projectBeforePost(DataSet: TDataSet);
begin
table_before_post(t_ch_project,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
table_before_post(t_ch_project,'<27>ո<EFBFBD><D5B8><EFBFBD><EFBFBD><EFBFBD>');
table_before_post(t_ch_project,'<27><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>');
// table_before_post(t_ch_project,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_code_fee_project_auto.t_ch_project_feeBeforePost(
DataSet: TDataSet);
begin
table_before_post(t_ch_project_fee,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
table_before_post(t_ch_project_fee,'<27>ұ<EFBFBD>');
table_before_post(t_ch_project_fee,'<27><><EFBFBD><EFBFBD>');
table_before_post(t_ch_project_fee,'<27><>׼');
end;
procedure Tfrm_code_fee_project_auto.t_ch_project_feeBeforeInsert(
DataSet: TDataSet);
begin
table_before_insert(t_ch_project);
end;
procedure Tfrm_code_fee_project_auto.t_ch_project_standardBeforeInsert(
DataSet: TDataSet);
begin
if do_data('8005',t_ch_project.fieldbyname('¼<><C2BC><EFBFBD><EFBFBD>').asstring,'','','','','')=false then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD>޸Ĵ<DEB8><C4B4><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD>');
abort;
end;
table_before_insert(t_ch_project_fee);
end;
procedure Tfrm_code_fee_project_auto.wwDBLookupCombo1Change(Sender: TObject);
begin
if (t_ch_project_fee.state=dsinsert)or(t_ch_project_fee.state=dsedit) then
begin
t_ch_project_fee['<27>ұ<EFBFBD>']:=frm_data_share.t_code_fee.fieldbyname('Ĭ<>ϱұ<CFB1>').asstring;
end;
end;
procedure Tfrm_code_fee_project_auto.t_ch_projectBeforeEdit(DataSet: TDataSet);
begin
if do_data('8005', t_ch_project.fieldbyname('¼<><C2BC><EFBFBD><EFBFBD>').asstring,'','','','','')=false then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD>޸Ĵ<DEB8><C4B4><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD>');
abort;
end;
end;
procedure Tfrm_code_fee_project_auto.t_ch_projectPostError(DataSet: TDataSet;
E: EDatabaseError; var Action: TDataAction);
begin
table_post_error_primary('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',E);
end;
procedure Tfrm_code_fee_project_auto.wwDBLookupCombo2Enter(Sender: TObject);
begin
if t_ch_project_fee.FieldByName('<27><><EFBFBD>㵥λ').asstring<>''then
begin
frm_data_share.t_crm_client.Filtered:=false;
frm_data_share.t_crm_client.Filter:=t_ch_project_fee.FieldByName('<27><><EFBFBD>㵥λ').asstring+'=1';
frm_data_share.t_crm_client.Filtered:=true;
end;
end;
procedure Tfrm_code_fee_project_auto.t_ch_project_feeAfterOpen(
DataSet: TDataSet);
begin
t_ch_project_fee.FieldByName('<27>ұ<EFBFBD>').OnChange:=t_ch_feecurrcharge;
end;
procedure Tfrm_code_fee_project_auto.bsSkinRadioGroup1Checked(
Sender: TObject);
var
feestr:string;
begin
feestr:=bsSkinRadioGroup1.Items[bsSkinRadioGroup1.ItemIndex];
if (feestr='ȫ<><C8AB>') then begin
t_ch_project.Close;
t_ch_project.SQL.clear;
t_ch_project.sql.add('select * from t_ch_project_auto ');
t_ch_project.SQL.Add(' where '+open_data('8005','¼<><C2BC><EFBFBD><EFBFBD>','no','no','no','no')
+' order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
t_ch_project.open;
end else begin
t_ch_project.Close;
t_ch_project.SQL.clear;
t_ch_project.sql.add('select * from t_ch_project_auto ');
t_ch_project.SQL.Add(' where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+feestr+''' and '+open_data('8005','¼<><C2BC><EFBFBD><EFBFBD>','no','no','no','no')
+' order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
t_ch_project.open;
end;
end;
procedure Tfrm_code_fee_project_auto.bsSkinButton17Click(Sender: TObject);
begin
t_ch_project_Condition.Insert;
try
frm_code_fee_project_auto_condition:=tfrm_code_fee_project_auto_condition.Create (self);
frm_code_fee_project_auto_condition.ShowModal;
finally
frm_code_fee_project_auto_condition.Free;
end;
end;
procedure Tfrm_code_fee_project_auto.bsSkinButton19Click(Sender: TObject);
begin
table_post(t_ch_project_Condition);
end;
procedure Tfrm_code_fee_project_auto.bsSkinButton20Click(Sender: TObject);
begin
table_delete(t_ch_project_Condition);
end;
procedure Tfrm_code_fee_project_auto.bsSkinButton21Click(Sender: TObject);
begin
table_Cancel(t_ch_project_Condition);
end;
procedure Tfrm_code_fee_project_auto.bsSkinButton10Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_code_fee_project_auto.t_ch_project_ConditionBeforeInsert(
DataSet: TDataSet);
begin
table_before_insert(t_ch_project);
end;
procedure Tfrm_code_fee_project_auto.t_ch_project_ConditionBeforePost(
DataSet: TDataSet);
begin
table_before_post(t_ch_project_Condition,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
table_before_post(t_ch_project_Condition,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ');
table_before_post(t_ch_project_Condition,'<27><><EFBFBD><EFBFBD>ֵ');
end;
procedure Tfrm_code_fee_project_auto.bsSkinButton44Click(Sender: TObject);
var
feestr,str:string;
begin
feestr:=bsSkinRadioGroup1.Items[bsSkinRadioGroup1.ItemIndex];
str:=' 1=1 ';
if RxDBLookupCombo57.Text<>'<<3C><>>' then begin
str:=str+' and (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''ί<>е<EFBFBD>λ'' and <20><><EFBFBD><EFBFBD>ֵ='''+RxDBLookupCombo57.DisplayValues[1]+''') ';
end;
if RxDBLookupCombo7.Text<>'<<3C><>>' then begin
str:=str+' and (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><>վ'' and <20><><EFBFBD><EFBFBD>ֵ='''+RxDBLookupCombo7.DisplayValues[1]+''') ';
end;
if RxDBLookupCombo1.Text<>'<<3C><>>' then begin
str:=str+' and (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><><EFBFBD><EFBFBD>˾'' and <20><><EFBFBD><EFBFBD>ֵ='''+RxDBLookupCombo1.DisplayValues[1]+''') ';
end;
if (feestr='ȫ<><C8AB>') then begin
t_ch_project.Close;
t_ch_project.SQL.clear;
t_ch_project.sql.add('select * from t_ch_project_auto ');
t_ch_project.SQL.Add(' where '+open_data('8005','¼<><C2BC><EFBFBD><EFBFBD>','no','no','no','no'));
if (str<>' 1=1 ') then
t_ch_project.SQL.Add(' and EXISTS (select 1 from t_ch_project_Condition c where c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=t_ch_project_auto.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and '+str+') ');
t_ch_project.SQL.Add(' order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
t_ch_project.open;
end else begin
t_ch_project.Close;
t_ch_project.SQL.clear;
t_ch_project.sql.add('select * from t_ch_project_auto ');
t_ch_project.SQL.Add(' where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+feestr+''' and '+open_data('8005','¼<><C2BC><EFBFBD><EFBFBD>','no','no','no','no'));
if (str<>' 1=1 ') then
t_ch_project.SQL.Add(' and EXISTS (select 1 from t_ch_project_Condition c where c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=t_ch_project_auto.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and '+str+') ');
t_ch_project.SQL.Add(' order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
t_ch_project.open;
end;
end;
procedure Tfrm_code_fee_project_auto.bsSkinButton11Click(Sender: TObject);
var
aQuery:TADOQuery;
i,fadm:Integer;
begin
if t_ch_project.IsEmpty then exit;
fadm:=t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger;
aQuery:=CreateAdoQuery;
try
with aQuery do begin
close;SQL.Clear;
SQL.Add('select * from t_ch_project_auto where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+IntToStr(fadm));
Open;
t_ch_project.Insert;
t_ch_project['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=aQuery['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
t_ch_project['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=aQuery['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
t_ch_project['<27>ո<EFBFBD><D5B8><EFBFBD><EFBFBD><EFBFBD>']:=aQuery['<27>ո<EFBFBD><D5B8><EFBFBD><EFBFBD><EFBFBD>'];
t_ch_project['Ĭ<>Ϸ<EFBFBD><CFB7><EFBFBD>']:=aQuery['Ĭ<>Ϸ<EFBFBD><CFB7><EFBFBD>'];
t_ch_project['<27><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>']:=aQuery['<27><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>'];
t_ch_project['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=aQuery['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
t_ch_project.Post;
close;SQL.Clear;
SQL.Add('select * from t_ch_project_auto_fee where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+IntToStr(fadm));
Open;
First;
while not eof do begin
t_ch_project_fee.Insert;
t_ch_project_fee['<27><><EFBFBD><EFBFBD>']:=aQuery['<27><><EFBFBD><EFBFBD>'];
t_ch_project_fee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=aQuery['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
t_ch_project_fee['<27><><EFBFBD>㵥λ']:=aQuery['<27><><EFBFBD>㵥λ'];
t_ch_project_fee['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>']:=aQuery['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>'];
t_ch_project_fee['<27>ұ<EFBFBD>']:=aQuery['<27>ұ<EFBFBD>'];
t_ch_project_fee['<27><><EFBFBD><EFBFBD>']:=aQuery['<27><><EFBFBD><EFBFBD>'];
t_ch_project_fee['<27><>׼']:=aQuery['<27><>׼'];
t_ch_project_fee['<27><><EFBFBD><EFBFBD>']:=aQuery['<27><><EFBFBD><EFBFBD>'];
t_ch_project_fee['<27><><EFBFBD>ñ<EFBFBD>ע']:=aQuery['<27><><EFBFBD>ñ<EFBFBD>ע'];
t_ch_project_fee['<27><><EFBFBD>۹<EFBFBD>ʽ']:=aQuery['<27><><EFBFBD>۹<EFBFBD>ʽ'];
t_ch_project_fee['˳<><CBB3>']:=aQuery['˳<><CBB3>'];
t_ch_project_fee['˰<><CBB0>']:=aQuery['˰<><CBB0>'];
t_ch_project_fee.Post;
Next;
end;
close;SQL.Clear;
SQL.Add('select * from t_ch_project_Condition where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+IntToStr(fadm));
Open;
First;
while not eof do begin
t_ch_project_Condition.Insert;
t_ch_project_Condition['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=aQuery['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
t_ch_project_Condition['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ']:=aQuery['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ'];
t_ch_project_Condition['<27><><EFBFBD><EFBFBD>ֵ']:=aQuery['<27><><EFBFBD><EFBFBD>ֵ'];
t_ch_project_Condition.Post;
Next;
end;
end;
finally
FreeAndNil(aQuery);
end;
end;
procedure Tfrm_code_fee_project_auto.dxDBGrid2DblClick(Sender: TObject);
begin
if not (t_ch_project_Condition.State in [dsedit]) then t_ch_project_Condition.Edit;
try
frm_code_fee_project_auto_condition:=tfrm_code_fee_project_auto_condition.Create (self);
frm_code_fee_project_auto_condition.ShowModal;
finally
frm_code_fee_project_auto_condition.Free;
end;
end;
procedure Tfrm_code_fee_project_auto.bsSkinButton16Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_code_fee_project_auto.bsSkinButton12Click(Sender: TObject);
begin
t_ch_project_Cust.Insert;
end;
procedure Tfrm_code_fee_project_auto.bsSkinButton13Click(Sender: TObject);
begin
table_post(t_ch_project_Cust);
end;
procedure Tfrm_code_fee_project_auto.bsSkinButton14Click(Sender: TObject);
begin
table_delete(t_ch_project_Cust);
end;
procedure Tfrm_code_fee_project_auto.bsSkinButton15Click(Sender: TObject);
begin
table_Cancel(t_ch_project_Cust);
end;
procedure Tfrm_code_fee_project_auto.t_ch_project_CustAfterInsert(
DataSet: TDataSet);
begin
t_ch_project_Cust['¼<><C2BC><EFBFBD><EFBFBD>']:=employee;
t_ch_project_Cust['¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=Now;
end;
procedure Tfrm_code_fee_project_auto.RxDBLookupCombo2Enter(
Sender: TObject);
begin
RxLookupComboEnter(RxDBLookupCombo2);
end;
procedure Tfrm_code_fee_project_auto.RxDBLookupCombo2Exit(Sender: TObject);
begin
RxLookupComboExit(RxDBLookupCombo2);
end;
procedure Tfrm_code_fee_project_auto.bsSkinButton18Click(Sender: TObject);
var
Ext,adate,bsno,corp,vslvoy:String;
ExcelTemplet:Variant;
i,j:integer;
M,D,Y:Word;
imp:boolean;
begin
if OpenDialog1.Execute then
begin
Ext:=lowercase(ExtractFileExt(OpenDialog1.FileName));
if Ext='.xls' then begin
ExcelTemplet:= CreateOleObject('Excel.Application');
try
ExcelTemplet.Workbooks.Open(OpenDialog1.FileName);
imp:=true;
I:=2;
while VartoStr(ExcelTemplet.ActiveSheet.Cells[I,1].Value)<>'' do begin
t_ch_project_fee.insert;
t_ch_project_fee['<27><><EFBFBD><EFBFBD>']:=VarTostr(ExcelTemplet.ActiveSheet.Cells[i,1].Value);
t_ch_project_fee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=VarTostr(ExcelTemplet.ActiveSheet.Cells[i,2].Value);
t_ch_project_fee['<27><><EFBFBD>㵥λ']:=VarTostr(ExcelTemplet.ActiveSheet.Cells[i,3].Value);
t_ch_project_fee['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>']:=VarTostr(ExcelTemplet.ActiveSheet.Cells[i,4].Value);
t_ch_project_fee['<27>ұ<EFBFBD>']:=VarTostr(ExcelTemplet.ActiveSheet.Cells[i,5].Value);
if (VartoStr(ExcelTemplet.ActiveSheet.Cells[I,6].Value)<>'') then
t_ch_project_fee['<27><><EFBFBD><EFBFBD>']:=StrToFloat(VarTostr(ExcelTemplet.ActiveSheet.Cells[i,6].Value));
t_ch_project_fee['<27><>׼']:=VarTostr(ExcelTemplet.ActiveSheet.Cells[i,7].Value);
if (VartoStr(ExcelTemplet.ActiveSheet.Cells[I,8].Value)<>'') then
t_ch_project_fee['<27><><EFBFBD><EFBFBD>']:=StrToFloat(VarTostr(ExcelTemplet.ActiveSheet.Cells[i,8].Value));
t_ch_project_fee['<27><><EFBFBD>۹<EFBFBD>ʽ']:=VarTostr(ExcelTemplet.ActiveSheet.Cells[i,9].Value);
t_ch_project_fee['<27><><EFBFBD>ñ<EFBFBD>ע']:=VarTostr(ExcelTemplet.ActiveSheet.Cells[i,10].Value);
t_ch_project_fee['<27><><EFBFBD><EFBFBD>Ӣ<EFBFBD><D3A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=VarTostr(ExcelTemplet.ActiveSheet.Cells[i,11].Value);
if (VartoStr(ExcelTemplet.ActiveSheet.Cells[I,12].Value)<>'') then
t_ch_project_fee['˳<><CBB3>']:=StrToInt64(VarTostr(ExcelTemplet.ActiveSheet.Cells[i,12].Value));
t_ch_project_fee.post;
i:=i+1;
end;
finally
ExcelTemplet.DisplayAlerts := false;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
ExcelTemplet.Quit;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD>
end;
end;
end;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD>', mtConfirmation, [mbYes],0);
end;
procedure Tfrm_code_fee_project_auto.bsSkinButton22Click(Sender: TObject);
var
aQuery:TADOQuery;
i:Integer;
begin
if wwDBGrid2.SelectedList.Count>=1 then
begin
aQuery:=CreateAdoQuery;
aQuery.SQL.Text:='select top 1 * from t_ch_project_auto_fee ';
aQuery.Open;
try
for i:=0 to wwDBGrid2.SelectedList.Count-1 do
begin
t_ch_project_fee.GotoBookmark(pointer(wwDBGrid2.SelectedList[i]));
aQuery.Insert;
aQuery['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_ch_project_fee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
aQuery['<27><><EFBFBD><EFBFBD>']:=t_ch_project_fee['<27><><EFBFBD><EFBFBD>'];
aQuery['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_ch_project_fee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
aQuery['<27><><EFBFBD>㵥λ']:=t_ch_project_fee['<27><><EFBFBD>㵥λ'];
aQuery['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>']:=t_ch_project_fee['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>'];
aQuery['<27>ұ<EFBFBD>']:=t_ch_project_fee['<27>ұ<EFBFBD>'];
aQuery['<27><><EFBFBD><EFBFBD>']:=t_ch_project_fee['<27><><EFBFBD><EFBFBD>'];
aQuery['<27><>׼']:=t_ch_project_fee['<27><>׼'];
aQuery['<27><><EFBFBD><EFBFBD>']:=t_ch_project_fee['<27><><EFBFBD><EFBFBD>'];
aQuery['<27><><EFBFBD>۹<EFBFBD>ʽ']:=t_ch_project_fee['<27><><EFBFBD>۹<EFBFBD>ʽ'];
aQuery['<27><><EFBFBD>ñ<EFBFBD>ע']:=t_ch_project_fee['<27><><EFBFBD>ñ<EFBFBD>ע'];
aQuery['<27><><EFBFBD><EFBFBD>Ӣ<EFBFBD><D3A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_ch_project_fee['<27><><EFBFBD><EFBFBD>Ӣ<EFBFBD><D3A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
aQuery['˳<><CBB3>']:=t_ch_project_fee['˳<><CBB3>'];
aQuery.Post;
end;
finally
t_ch_project_fee.Requery();
FreeAndNil(aQuery);
end;
end;
end;
end.