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.

1963 lines
62 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_code_fee_project_new;
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, wwdbdatetimepicker, bsdbctrls,Math, dxExEdtr,
dxCntner, dxTL, dxDBCtrl, dxDBGrid;
type
Tfrm_code_fee_project_new = class(TForm)
t_ch_project: TADOQuery;
t_ch_project1: TDataSource;
t_ch_project_fee: TADOQuery;
t_ch_project_fee1: TDataSource;
t_ch_project_standard: TADOQuery;
t_ch_project_standard1: TDataSource;
Panel1: TPanel;
Panel2: TPanel;
Panel3: TPanel;
wwDBGrid1: TwwDBGrid;
Panel4: TPanel;
wwDBGrid2: TwwDBGrid;
bsSkinButton1: TbsSkinButton;
bsSkinButton2: TbsSkinButton;
bsSkinButton4: TbsSkinButton;
bsSkinButton3: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
bsSkinButton6: TbsSkinButton;
bsSkinButton7: TbsSkinButton;
bsSkinButton8: TbsSkinButton;
bsSkinButton9: TbsSkinButton;
wwDBComboBox1: TwwDBComboBox;
wwDBComboBox2: TwwDBComboBox;
wwDBLookupCombo2: TwwDBLookupCombo;
wwDBLookupCombo3: TwwDBLookupCombo;
wwDBLookupCombo1: TwwDBLookupCombo;
t_bz_balance: TRxMemoryData;
wwDBLookupCombo4: TwwDBLookupCombo;
t_bz_client: TRxMemoryData;
wwDBLookupCombo5: TwwDBLookupCombo;
wwDBLookupCombo6: TwwDBLookupCombo;
bsSkinButton14: TbsSkinButton;
t_ch_project_old: TADOQuery;
t_ch_project_old1: TDataSource;
t_ch_project_fee_old1: TDataSource;
t_ch_project_fee_old: TADOQuery;
t_ch_project_standard_old: TADOQuery;
t_ch_project_standard_old1: TDataSource;
Panel6: TPanel;
Panel5: TPanel;
bsSkinButton10: TbsSkinButton;
bsSkinButton11: TbsSkinButton;
bsSkinButton12: TbsSkinButton;
bsSkinButton13: TbsSkinButton;
wwDBGrid3: TwwDBGrid;
DBEdit1: TDBEdit;
wwDBLookupCombo7: TwwDBLookupCombo;
wwDBLookupCombo8: TwwDBLookupCombo;
wwDBLookupCombo9: TwwDBLookupCombo;
Panel7: TPanel;
bsSkinPanel1: TbsSkinPanel;
DBEdit2: TDBEdit;
Label1: TLabel;
wwDBComboBox3: TwwDBComboBox;
wwDBComboBox4: TwwDBComboBox;
Label2: TLabel;
Label3: TLabel;
Label8: TLabel;
wwDBDateTimePicker1: TwwDBDateTimePicker;
Label9: TLabel;
wwDBDateTimePicker2: TwwDBDateTimePicker;
t_ch_project_remarks: TADOQuery;
t_ch_project_remarks1: TDataSource;
t_ch_project_Condition: TADOQuery;
t_ch_project_Condition1: TDataSource;
wwDBGrid4: TwwDBGrid;
wwDBComboBox5: TwwDBComboBox;
bsSkinButton15: TbsSkinButton;
Button1: TButton;
p_op_gain1: TADOStoredProc;
bsSkinButton17: TbsSkinButton;
bsSkinButton19: TbsSkinButton;
bsSkinButton20: TbsSkinButton;
bsSkinButton21: TbsSkinButton;
Button2: TButton;
t_ch_project_Condition_old1: TDataSource;
t_ch_project_Condition_old: TADOQuery;
Label4: TLabel;
Label5: TLabel;
wwDBDateTimePicker3: TwwDBDateTimePicker;
wwDBDateTimePicker4: TwwDBDateTimePicker;
dxDBGrid1: TdxDBGrid;
dxDBGrid1Column1: TdxDBGridColumn;
dxDBGrid1Column2: TdxDBGridColumn;
dxDBGrid1Column3: TdxDBGridColumn;
dxDBGrid1Column4: TdxDBGridColumn;
dxDBGrid1Column5: TdxDBGridColumn;
dxDBGrid1Column6: TdxDBGridColumn;
dxDBGrid1Column7: TdxDBGridColumn;
dxDBGrid1Column8: TdxDBGridColumn;
bsSkinButton16: TbsSkinButton;
bsSkinButton18: TbsSkinButton;
bsSkinButton22: TbsSkinButton;
bsSkinButton23: TbsSkinButton;
DBEdit3: TDBEdit;
Label6: TLabel;
bsSkinButton24: TbsSkinButton;
bsSkinButton25: TbsSkinButton;
bsSkinButton26: TbsSkinButton;
bsSkinDBCheckRadioBox1: TbsSkinDBCheckRadioBox;
bsSkinButton27: TbsSkinButton;
bsSkinButton28: 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 bsSkinButton10Click(Sender: TObject);
procedure bsSkinButton11Click(Sender: TObject);
procedure bsSkinButton12Click(Sender: TObject);
procedure bsSkinButton13Click(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 t_ch_projectAfterScroll(DataSet: TDataSet);
procedure wwDBLookupCombo1Change(Sender: TObject);
procedure wwDBLookupCombo3Change(Sender: TObject);
procedure t_ch_projectBeforeEdit(DataSet: TDataSet);
procedure wwDBLookupCombo6Change(Sender: TObject);
procedure t_ch_project_standardBeforePost(DataSet: TDataSet);
procedure t_ch_projectPostError(DataSet: TDataSet; E: EDatabaseError;
var Action: TDataAction);
procedure wwDBLookupCombo2Enter(Sender: TObject);
procedure bsSkinButton14Click(Sender: TObject);
procedure DBEdit1Change(Sender: TObject);
procedure t_ch_project_ConditionBeforePost(DataSet: TDataSet);
procedure bsSkinButton15Click(Sender: TObject);
procedure wwDBGrid4DblClick(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure wwDBLookupCombo1KeyPress(Sender: TObject; var Key: Char);
procedure wwDBLookupCombo2KeyPress(Sender: TObject; var Key: Char);
procedure bsSkinButton17Click(Sender: TObject);
procedure bsSkinButton19Click(Sender: TObject);
procedure bsSkinButton20Click(Sender: TObject);
procedure bsSkinButton21Click(Sender: TObject);
procedure t_ch_project_ConditionBeforeInsert(DataSet: TDataSet);
procedure Button2Click(Sender: TObject);
procedure t_ch_project_ConditionBeforeDelete(DataSet: TDataSet);
procedure t_ch_project_ConditionAfterInsert(DataSet: TDataSet);
procedure bsSkinButton16Click(Sender: TObject);
procedure bsSkinButton18Click(Sender: TObject);
procedure bsSkinButton22Click(Sender: TObject);
procedure bsSkinButton23Click(Sender: TObject);
procedure bsSkinButton24Click(Sender: TObject);
procedure bsSkinButton25Click(Sender: TObject);
procedure bsSkinButton26Click(Sender: TObject);
procedure bsSkinButton27Click(Sender: TObject);
procedure bsSkinButton28Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
modify_Project:boolean;
procedure InsertProjectFee(Projectid:Integer;EtdBegin,EtdEnd:TDateTime;DC,ProjectName:string);
procedure DeleteProjectFee(Projectid:Integer;EtdBegin,EtdEnd:TDateTime;DC,ProjectName:string);
end;
var
frm_code_fee_project_new: Tfrm_code_fee_project_new;
implementation
uses u_main, u_data_share, my_sys_function, u_code_fee_project_copy_new,
u_crm_query;
{$R *.dfm}
procedure Tfrm_code_fee_project_new.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
if t_ch_project_remarks.State in [dsedit,dsinsert] then t_ch_project_remarks.Post;
if t_ch_project_standard.State in [dsedit,dsinsert] then t_ch_project_standard.Post;
if t_ch_project_fee.State in [dsedit,dsinsert] then t_ch_project_fee.Post;
if t_ch_project.State in [dsedit,dsinsert] then t_ch_project.Post;
frm_code_fee_project_new.Hide;
frm_code_fee_project_new.ManualFloat(frm_code_fee_project_new.BoundsRect );
frm_main.freeTabs('frm_code_fee_project_new');
action:=cafree;
frm_code_fee_project_new:=nil;
end;
procedure Tfrm_code_fee_project_new.FormShow(Sender: TObject);
begin
modify_Project:=false;
t_ch_project.SQL.clear;
if not if_open('401') then
begin
t_ch_project.sql.add('select * from t_ch_project_new ');
t_ch_project.SQL.Add(' where <20><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>=1 or ¼<><C2BC><EFBFBD><EFBFBD>='''+ employee + '''order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end
else
begin
t_ch_project.sql.add('select * from t_ch_project_new ');
t_ch_project.SQL.Add('order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
t_ch_project.open;
t_ch_project_fee.open;
t_ch_project_standard.open;
t_ch_project_remarks.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;
end;
procedure Tfrm_code_fee_project_new.Panel3Resize(Sender: TObject);
var
i:integer;
begin
i:=round(Panel3.width/8);
bsSkinButton1.width:=i;
bsSkinButton14.width:=i;
bsSkinButton2.width:=i;
bsSkinButton4.width:=i;
bsSkinButton15.width:=i;
bsSkinButton22.width:=i;
bsSkinButton25.width:=i;
end;
procedure Tfrm_code_fee_project_new.bsSkinButton9Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_code_fee_project_new.bsSkinButton1Click(Sender: TObject);
begin
t_ch_project.insert;
end;
procedure Tfrm_code_fee_project_new.bsSkinButton2Click(Sender: TObject);
begin
table_post(t_ch_project);
end;
procedure Tfrm_code_fee_project_new.bsSkinButton4Click(Sender: TObject);
begin
table_delete(t_ch_project);
end;
procedure Tfrm_code_fee_project_new.bsSkinButton3Click(Sender: TObject);
begin
table_cancel(t_ch_project);
end;
procedure Tfrm_code_fee_project_new.bsSkinButton5Click(Sender: TObject);
begin
t_ch_project_fee.insert;
end;
procedure Tfrm_code_fee_project_new.bsSkinButton6Click(Sender: TObject);
begin
table_post(t_ch_project_fee);
end;
procedure Tfrm_code_fee_project_new.bsSkinButton7Click(Sender: TObject);
begin
table_delete(t_ch_project_fee);
end;
procedure Tfrm_code_fee_project_new.bsSkinButton8Click(Sender: TObject);
begin
table_cancel(t_ch_project_fee);
end;
procedure Tfrm_code_fee_project_new.bsSkinButton10Click(Sender: TObject);
begin
t_ch_project_standard.insert;
end;
procedure Tfrm_code_fee_project_new.bsSkinButton11Click(Sender: TObject);
begin
table_post(t_ch_project_standard);
end;
procedure Tfrm_code_fee_project_new.bsSkinButton12Click(Sender: TObject);
begin
table_delete(t_ch_project_standard);
end;
procedure Tfrm_code_fee_project_new.bsSkinButton13Click(Sender: TObject);
begin
table_cancel(t_ch_project_standard);
end;
procedure Tfrm_code_fee_project_new.t_ch_projectAfterInsert(DataSet: TDataSet);
begin
t_ch_project['¼<><C2BC><EFBFBD><EFBFBD>']:=employee;
t_ch_project['¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=date;
t_ch_project['<27><><EFBFBD><EFBFBD>״̬']:='δ<><CEB4><EFBFBD><EFBFBD>';
end;
procedure Tfrm_code_fee_project_new.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><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
table_before_post(t_ch_project,'ҵ<><D2B5><EFBFBD><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>');
table_before_post(t_ch_project,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
table_before_post(t_ch_project,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹ');
if t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring<>''then
begin
if t_ch_project.fieldbyname('<27><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>').asdatetime>t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asdatetime then
begin
showmessage('<27><>ʼ<EFBFBD><CABC><EFBFBD>ڲ<EFBFBD><DAB2>ܴ<EFBFBD><DCB4>ڽ<EFBFBD><DABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD>');
abort;
end;
end;
if t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹ').asstring<>''then
begin
if t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asdatetime>t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹ').asdatetime then
begin
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD><DCB4>ڿ<EFBFBD><DABF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹ<EFBFBD><D6B9><EFBFBD><EFBFBD>');
abort;
end;
end;
end;
procedure Tfrm_code_fee_project_new.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><>׼');
if frm_data_share.t_code_fee.locate('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',t_ch_project_fee.fieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString ,[]) then
begin
t_ch_project_fee['˳<><CBB3>']:=frm_data_share.t_code_fee.fieldbyname('˳<><CBB3>').asInteger;
end;
end;
procedure Tfrm_code_fee_project_new.t_ch_project_feeBeforeInsert(
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;
if not modify_Project then
begin
if t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD>״̬').asstring='<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>' then
begin
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>,<2C><><EFBFBD><EFBFBD><EFBFBD>޸ģ<DEB8>');
abort;
end;
end;
table_before_insert(t_ch_project);
end;
procedure Tfrm_code_fee_project_new.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;
if not modify_Project then
begin
if t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD>״̬').asstring='<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>' then
begin
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>,<2C><><EFBFBD><EFBFBD><EFBFBD>޸ģ<DEB8>');
abort;
end;
end;
table_before_insert(t_ch_project_fee);
end;
procedure Tfrm_code_fee_project_new.t_ch_projectAfterScroll(DataSet: TDataSet);
var
i:integer;
begin
if (copy(t_ch_project.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,1,4)='<27><><EFBFBD><EFBFBD>') then
begin
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><>ʽ';
t_bz_balance['two']:='<27><>ʽ';
t_bz_balance['three']:='<27><>ʽ';
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><> <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;
t_bz_client.Append;
t_bz_client['one']:='11-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
t_bz_client['two']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
t_bz_client.post;
t_bz_client.Append;
t_bz_client['one']:='12-<2D><><EFBFBD><EFBFBD>';
t_bz_client['two']:='<27><><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;
end
else
begin
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><C6BC><EFBFBD><EFBFBD><EFBFBD>';
t_bz_balance['two']:='<27>Ƽ<EFBFBD><C6BC><EFBFBD><EFBFBD><EFBFBD>';
t_bz_balance['three']:='<27>Ƽ<EFBFBD><C6BC><EFBFBD><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_client.close;
t_bz_client.open;
t_bz_client.Append;
t_bz_client['one']:='1-ί<>е<EFBFBD>λ';
t_bz_client['two']:='ί<>е<EFBFBD>λ';
t_bz_client.post;
t_bz_client.Append;
t_bz_client['one']:='2-<2D><><EFBFBD>չ<EFBFBD>˾';
t_bz_client['two']:='<27><><EFBFBD>չ<EFBFBD>˾';
t_bz_client.post;
t_bz_client.Append;
t_bz_client['one']:='3-<2D><> <20><> <20><>';
t_bz_client['two']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
t_bz_client.post;
t_bz_client.Append;
t_bz_client['one']:='4-<2D><> <20><>';
t_bz_client['two']:='<27><><EFBFBD><EFBFBD>';
t_bz_client.post;
t_bz_client.Append;
t_bz_client['one']:='5-<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;
end;
end;
procedure Tfrm_code_fee_project_new.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;
if frm_data_share.t_code_fee.locate('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',t_ch_project_fee.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,[]) then
begin
t_ch_project_fee['˳<><CBB3>']:=frm_data_share.t_code_fee.fieldbyname('˳<><CBB3>').asInteger;
end;
end;
end;
procedure Tfrm_code_fee_project_new.wwDBLookupCombo3Change(Sender: TObject);
begin
if (t_ch_project_fee.state=dsinsert)or(t_ch_project_fee.state=dsedit) then
begin
IF frm_data_share.t_code_currency.Locate('<27>ұ<EFBFBD>',wwDBLookupCombo3.text,[])then
t_ch_project_fee['<27><><EFBFBD><EFBFBD>']:=frm_data_share.t_code_currency.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat;
end;
end;
procedure Tfrm_code_fee_project_new.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;
if not modify_Project then
begin
if t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD>״̬').asstring='<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>' then
begin
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>,<2C><><EFBFBD><EFBFBD><EFBFBD>޸ģ<DEB8>');
abort;
end;
end;
end;
procedure Tfrm_code_fee_project_new.wwDBLookupCombo6Change(Sender: TObject);
begin
if (t_ch_project_standard.State=dsedit)or(t_ch_project_standard.State=dsinsert) then
begin
if frm_data_share.t_code_ctn.Locate('<27><><EFBFBD><EFBFBD>',wwDBLookupCombo6.text,[]) then
begin
t_ch_project_standard['<27><>׼']:=frm_data_share.t_code_ctn['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ'];
end
else
begin
t_ch_project_standard['<27><>׼']:='';
end;
end;
end;
procedure Tfrm_code_fee_project_new.t_ch_project_standardBeforePost(
DataSet: TDataSet);
begin
table_before_post(t_ch_project_standard,'<27><><EFBFBD>ʹ<EFBFBD><CDB4><EFBFBD>');
end;
procedure Tfrm_code_fee_project_new.t_ch_projectPostError(DataSet: TDataSet;
E: EDatabaseError; var Action: TDataAction);
begin
table_post_error_primary('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',E);
table_post_error_primary('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',E);
end;
procedure Tfrm_code_fee_project_new.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_new.bsSkinButton14Click(Sender: TObject);
begin
if t_ch_project.IsEmpty then
exit;
table_post(t_ch_project);
t_ch_project_old.Close;
t_ch_project_fee_old.close;
t_ch_project_standard_old.close;
t_ch_project_Condition_old.close;
t_ch_project_old.Parameters[0].value:=t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
t_ch_project_old.open;
t_ch_project_fee_old.open;
t_ch_project_standard_old.open;
t_ch_project_Condition_old.open;
try
frm_code_fee_project_copy_new:=tfrm_code_fee_project_copy_new.Create (self);
frm_code_fee_project_copy_new.B_UpdateProject:=false;
t_ch_project.insert;
t_ch_project['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_ch_project_old['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
t_ch_project['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_ch_project_old['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
t_ch_project['ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_ch_project_old['ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
t_ch_project['ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_ch_project_old['ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
t_ch_project['<27><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>']:=t_ch_project_old['<27><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>'];
t_ch_project['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_ch_project_old['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
t_ch_project['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_ch_project_old['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
t_ch_project['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹ']:=t_ch_project_old['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹ'];
frm_code_fee_project_copy_new.ShowModal;
finally
frm_code_fee_project_copy_new.Free;
frm_code_fee_project_copy_new:=nil;
end;
end;
procedure Tfrm_code_fee_project_new.DBEdit1Change(Sender: TObject);
begin
if DBEdit1.Text<>'<27><><EFBFBD><EFBFBD>' then
begin
Panel6.Visible:=false;
end
else
begin
Panel6.Visible:=true;
end;
end;
procedure Tfrm_code_fee_project_new.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>ֵ');
if (t_ch_project_Condition.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD>˾') then
begin
if not frm_data_share.t_crm_client_ship1.DataSet.Locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',t_ch_project_Condition.fieldbyname('<27><><EFBFBD><EFBFBD>ֵ').asstring,[]) then
begin
showmessage('ϵͳ<CFB5><CDB3>û<EFBFBD>иô<D0B8><C3B4><EFBFBD>˾:'+t_ch_project_Condition.fieldbyname('<27><><EFBFBD><EFBFBD>ֵ').asstring);
Abort;
end;
end;
if (t_ch_project_Condition.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring='ί<>е<EFBFBD>λ') then
begin
if not frm_data_share.t_crm_client_weituo1.DataSet.Locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',t_ch_project_Condition.fieldbyname('<27><><EFBFBD><EFBFBD>ֵ').asstring,[]) then
begin
showmessage('ϵͳ<CFB5><CDB3>û<EFBFBD>и<EFBFBD>ί<EFBFBD>е<EFBFBD>λ:'+t_ch_project_Condition.fieldbyname('<27><><EFBFBD><EFBFBD>ֵ').asstring);
Abort;
end;
end;
if (t_ch_project_Condition.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring='<27><>վ') then
begin
if not frm_data_share.t_crm_client_changzhan1.DataSet.Locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',t_ch_project_Condition.fieldbyname('<27><><EFBFBD><EFBFBD>ֵ').asstring,[]) then
begin
showmessage('ϵͳ<CFB5><CDB3>û<EFBFBD>иó<D0B8>վ:'+t_ch_project_Condition.fieldbyname('<27><><EFBFBD><EFBFBD>ֵ').asstring);
Abort;
end;
end;
if (t_ch_project_Condition.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>') then
begin
if not frm_data_share.t_crm_client_baoguan1.DataSet.Locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',t_ch_project_Condition.fieldbyname('<27><><EFBFBD><EFBFBD>ֵ').asstring,[]) then
begin
showmessage('ϵͳ<CFB5><CDB3>û<EFBFBD>иñ<D0B8><C3B1><EFBFBD><EFBFBD><EFBFBD>:'+t_ch_project_Condition.fieldbyname('<27><><EFBFBD><EFBFBD>ֵ').asstring);
Abort;
end;
end;
if (t_ch_project_Condition.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾') then
begin
if not frm_data_share.t_crm_client_huodai1.DataSet.Locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',t_ch_project_Condition.fieldbyname('<27><><EFBFBD><EFBFBD>ֵ').asstring,[]) then
begin
showmessage('ϵͳ<CFB5><CDB3>û<EFBFBD>иñ<D0B8><C3B1><EFBFBD><EFBFBD><EFBFBD>:'+t_ch_project_Condition.fieldbyname('<27><><EFBFBD><EFBFBD>ֵ').asstring);
Abort;
end;
end;
end;
procedure Tfrm_code_fee_project_new.bsSkinButton15Click(Sender: TObject);
var aAdoQuery:TADOQuery;
Conditions,ConditionsOld:string;
begin
if t_ch_project_fee.State in [dsedit,dsinsert] then t_ch_project_fee.Post;
if not if_open('401') then
begin
showmessage('<27><>Ǹ,<2C><>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
exit;
end;
aAdoQuery:=CreateAdoQuery;
if t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD>״̬').asstring<>'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>' then
with aAdoQuery do
try
Close;SQL.Clear;
SQL.Add('select count(*) c from t_ch_project_fee_new ');
SQL.Add('where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and (ȷ<><C8B7>=0 or ȷ<><C8B7> is null)');
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
Open;First;
if fieldbyname('c').AsInteger>=1 then
begin
ShowMessage('<27><><EFBFBD><EFBFBD>û<EFBFBD><C3BB>ȷ<EFBFBD>ϵķ<CFB5><C4B7><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
Exit;
end;
Close;SQL.Clear;
SQL.Add('select count(*) c from t_ch_project_new ');
SQL.Add('where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ');
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
Open;First;
if fieldbyname('c').AsInteger>1 then
begin
ShowMessage(t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+' <20>ظ<EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
Exit;
end;
finally
Free;
end;
if t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD>״̬').asstring<>'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>' then
begin
if MessageDlg('ȷʵҪ<CAB5><D2AA><EFBFBD><EFBFBD>:'+t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+' <20><>?',mtWarning,[mbYes,mbNo],0)=mrNo then
begin
exit;
end
else
begin
try
modify_Project:=True;
t_ch_project.Edit;
t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD>״̬').asstring:='<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>';
t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring:=employee;
t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime:=Now;
t_ch_project.post;
finally
modify_Project:=False;
end;
end;
end
end;
procedure Tfrm_code_fee_project_new.wwDBGrid4DblClick(Sender: TObject);
begin
if (t_ch_project_Condition.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD>˾')
or (t_ch_project_Condition.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring='ί<>е<EFBFBD>λ')
or (t_ch_project_Condition.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring='<27><>վ')
or (t_ch_project_Condition.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾')
or (t_ch_project_Condition.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>')
or (t_ch_project_Condition.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD>')
or (t_ch_project_Condition.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>')
or (t_ch_project_Condition.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring='<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>')
then
try
frm_crm_query:=Tfrm_crm_query.Create(application);
frm_crm_query.DataSource1:=t_ch_project_Condition1;
// frm_crm_query.Top:= Screen.height-750;
frm_crm_query.ShowModal;
finally
frm_crm_query.Free;
frm_crm_query:=nil;
end;
end;
procedure Tfrm_code_fee_project_new.InsertProjectFee(Projectid:Integer;EtdBegin,EtdEnd:TDateTime;Dc,ProjectName:string);
var
i:real;
if_do:boolean;
price,qty,amt:Double;
t_ch_project_Condition,t_ch_project_fee,t_ch_project_standard:TADOQuery;
t_op_seae,t_ch_fee,t_ch_fee_select,t_op_ctn,t_op_seaeUpdate:TADOQuery;
Conditions:string;
p_op_gain:TADOStoredProc;
feename,corpname,bz,currencyName,DCType:string;
function fee_get_client(str:string;aAdoquery:TAdoquery):string;
begin
if str='' then
result:=''
else
begin
if 1=1 then
begin
if str='ί<>е<EFBFBD>λ'then
result:=aAdoquery.fieldbyname('ί<>е<EFBFBD>λ').asstring;
if str='<27><><EFBFBD><EFBFBD>˾'then
result:=aAdoquery.fieldbyname('<27><><EFBFBD><EFBFBD>˾').asstring;
if str='<27><>վ'then
result:=aAdoquery.fieldbyname('<27><>վ').asstring;
if str='<27><><EFBFBD><EFBFBD>'then
result:=aAdoquery.fieldbyname('<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>').asstring;
if str='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'then
result:=aAdoquery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
if str='<27><><EFBFBD><EFBFBD>'then
result:=aAdoquery.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
if str='<27><><EFBFBD><EFBFBD>'then
result:=aAdoquery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾').asstring;
if str='<27><><EFBFBD><EFBFBD>'then
result:=aAdoquery.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
if str='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'then
result:=aAdoquery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
if str='<27>ջ<EFBFBD><D5BB><EFBFBD>'then
result:=aAdoquery.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD>').asstring;
if str='֪ͨ<CDA8><D6AA>'then
result:=aAdoquery.fieldbyname('֪ͨ<CDA8><D6AA>').asstring;
if str='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'then
result:=aAdoquery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
end
else
begin
if str='ί<>е<EFBFBD>λ'then
result:=aAdoquery.fieldbyname('ί<>е<EFBFBD>λ').asstring;
if str='<27><><EFBFBD>չ<EFBFBD>˾'then
result:=aAdoquery.fieldbyname('<27><><EFBFBD>չ<EFBFBD>˾').asstring;
if str='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'then
result:=aAdoquery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
if str='<27><><EFBFBD><EFBFBD>'then
result:=aAdoquery.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
if str='<27><><EFBFBD><EFBFBD>'then
result:=aAdoquery.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
end;
end;
end;
Function s_w(w:integer;s:real):real;
{var
Mount:double;
Num:double;
begin
Num:=Power(10,w);
Mount:=round(s*Num);
result:=Mount/Num; }
var
str,str_new:string;
i:integer;
begin
str:=floattostr(s);
if str='' then
result:=0
else if pos('.',str)=0 then
begin
result:=s;
end
else
begin
if length(str)-pos('.',str)>w then
begin
str_new:=copy(str,1,pos('.',str)+w);
if strtoint(copy(str,pos('.',str)+w+1,1))>4 then
result:=strtofloat(str_new)+1/Power(10,w)
else
result:=strtofloat(str_new);
end
else
begin
result:=s;
end;
end;
end;
begin
Conditions:='';
p_op_gain:=CreateADOStoredProc;
p_op_gain.ProcedureName:='p_op_gain;1';
t_ch_project_standard:=CreateAdoQuery;
t_ch_project_fee:=CreateAdoQuery;
t_ch_project_Condition:=CreateAdoQuery;
t_op_ctn:=CreateAdoQuery;
t_op_seae:=CreateAdoQuery;
t_ch_fee:=CreateAdoQuery;
t_op_seaeUpdate:=CreateAdoQuery;
t_ch_fee_select:=CreateAdoQuery;
frm_main.db.BeginTrans;
try
with t_ch_project_fee do
begin
Close;SQL.Clear;
SQL.Add('select * from t_ch_project_fee_new');
SQL.Add('where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add('order by ˳<><CBB3>,DE_ID');
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=Projectid;
Open;First;
end;
with t_ch_fee do
begin
Close;SQL.Clear;
SQL.Add('select * from t_ch_fee');
SQL.Add('where <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>');
Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:='';
end;
with t_ch_fee_select do
begin
Close;SQL.Clear;
SQL.Add('select <20><><EFBFBD><EFBFBD> from t_ch_fee');
SQL.Add('where <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=:<3A>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> and <20><>׼=:<3A><>׼ and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> and <20>ұ<EFBFBD>=:<3A>ұ<EFBFBD> and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>');
Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:='';
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:='';
Parameters.ParamByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').Value:='';
Parameters.ParamByName('<27><>׼').Value:='';
Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=0;
Parameters.ParamByName('<27>ұ<EFBFBD>').Value:='';
Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:='';
end;
with t_op_ctn do
begin
Close;SQL.Clear;
SQL.Add('select <20><><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) <20><><EFBFBD><EFBFBD> from t_op_ctn');
SQL.Add('where <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>');
SQL.Add('group by <20><><EFBFBD><EFBFBD>');
Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:='';
end;
with t_ch_project_Condition do
begin
Close;SQL.Clear;
SQL.Add('Select * from t_ch_project_Condition');
SQL.Add('Where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=Projectid;
Open;First;
while not eof do
begin
if Conditions='' then
begin
if FieldByName('<27><><EFBFBD><EFBFBD>ֵ').AsString<>'' then
begin
Conditions:=' AND '+FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+'='+''''+FieldByName('<27><><EFBFBD><EFBFBD>ֵ').AsString+''''
end;
end
else
begin
if FieldByName('<27><><EFBFBD><EFBFBD>ֵ').AsString<>'' then
begin
Conditions:=Conditions+' AND '+FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+'='+''''+FieldByName('<27><><EFBFBD><EFBFBD>ֵ').AsString+''''
end;
end;
Next;
end;
end;
with t_ch_project_standard do
begin
Close;SQL.Clear;
SQL.Add('Select * from t_ch_project_standard_new');
SQL.Add('Where DE_ID=:DE_ID');
Parameters.ParamByName('DE_ID').Value:=0;
Open;First;
end;
with t_op_seaeUpdate do
begin
Close;sql.Clear;
SQL.Add('update t_op_seae set <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
sql.Add('WHERE <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>');
Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:='';
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:='';
end;
with t_op_seae do
begin
Close;sql.Clear;
SQL.Add('Select * from t_op_seae');
sql.Add('WHERE <20><><EFBFBD><EFBFBD>״̬<>''<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>''');
sql.Add(Conditions);
sql.Add('And (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>=:<3A><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD> and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)');
Parameters.ParamByName('<27><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>').Value:=EtdBegin;
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=EtdEnd;
Open;First;
while not eof do
begin
t_ch_fee.Close;
t_ch_fee.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
t_ch_fee.open;t_ch_fee.First;
t_op_ctn.Close;
t_op_ctn.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
t_op_ctn.open;t_op_ctn.First;
if not t_ch_project_fee.IsEmpty then
begin
t_ch_project_fee.first;
while not t_ch_project_fee.eof do
begin
if (t_ch_project_fee.FieldByName('<27><>׼').asstring<>'<27><><EFBFBD><EFBFBD>') then
begin
feename:='';
corpname:='';
bz:='';
amt:=0;
qty:=0;
currencyName:='';
DCType:='';
feename:=trim(t_ch_project_fee.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
if t_ch_project_fee.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring=''then
begin
corpname:=trim(fee_get_client(t_ch_project_fee.fieldbyname('<27><><EFBFBD>㵥λ').asstring,t_op_seae));
end
else
begin
corpname:=trim(t_ch_project_fee.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring);
end;
bz:=trim(t_ch_project_fee.fieldbyname('<27><>׼').asstring);
if t_ch_project_fee.fieldbyname('<27><>׼').asstring='<27><>Ʊ' then
begin
qty:=1;
end
else if t_ch_project_fee.fieldbyname('<27><>׼').asstring='<27><><EFBFBD><EFBFBD>' then
begin
if s_w(4,t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat/1000)>1 then
qty:=s_w(4,t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat/1000)
else
qty:=1;
end
else if t_ch_project_fee.fieldbyname('<27><>׼').asstring='<27><><EFBFBD><EFBFBD>' then
begin
if t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat>1 then
qty:=t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat
else
qty:=1;
end
else if t_ch_project_fee.fieldbyname('<27><>׼').asstring='<27>ƷѶ<C6B7>' then
begin
qty:=0;
end
else if t_ch_project_fee.fieldbyname('<27><>׼').asstring='<27>Ƽ<EFBFBD><C6BC><EFBFBD><EFBFBD><EFBFBD>' then
begin
qty:=t_op_seae.fieldbyname('<27>Ƽ<EFBFBD><C6BC><EFBFBD><EFBFBD><EFBFBD>').asfloat;
end
else if t_ch_project_fee.fieldbyname('<27><>׼').asstring='<27><><EFBFBD><EFBFBD>' then
begin
qty:=t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat;
end
else
if t_ch_project_fee.fieldbyname('<27><>׼').asstring='TEU' then
begin
qty:=t_op_seae.fieldbyname('<27><>TEU').asfloat;
end;
amt:=qty*t_ch_project_fee.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat;
currencyName:=trim(t_ch_project_fee.fieldbyname('<27>ұ<EFBFBD>').asstring);
DCType:=trim(Dc);
{
t_ch_fee_select.Close;
t_ch_fee_select.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
t_ch_fee_select.Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=feename;
t_ch_fee_select.Parameters.ParamByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').Value:=corpname;
t_ch_fee_select.Parameters.ParamByName('<27><>׼').Value:=bz;
t_ch_fee_select.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=amt;
t_ch_fee_select.Parameters.ParamByName('<27>ұ<EFBFBD>').Value:=currencyName;
t_ch_fee_select.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=DCType;
t_ch_fee_select.open;t_ch_fee_select.First;
}
if not t_ch_fee.Locate('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;<3B>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>;<3B><>׼;<3B><><EFBFBD><EFBFBD>;<3B>ұ<EFBFBD>;<3B><><EFBFBD><EFBFBD>'
,VarArrayOf([feename,corpname,bz,amt,currencyName,DCType]),[]) then
//if t_ch_fee_select.RecordCount<=0 then
begin
t_ch_fee.Append;
t_ch_fee['<27><><EFBFBD><EFBFBD>']:=t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
t_ch_fee['<27><><EFBFBD><EFBFBD>״̬']:='¼<><C2BC>״̬';
t_ch_fee['<27><><EFBFBD><EFBFBD>״̬']:='<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>';
t_ch_fee['<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>']:=now;
t_ch_fee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=employee;
t_ch_fee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=now;
t_ch_fee['<27><><EFBFBD><EFBFBD>']:=DC;
t_ch_fee['¼<><C2BC><EFBFBD><EFBFBD>']:=t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString;
t_ch_fee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=0;
t_ch_fee['<27><><EFBFBD><EFBFBD>']:=0;
t_ch_fee['<27>ұ<EFBFBD>']:='RMB';
t_ch_fee['<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>']:=0;
t_ch_fee['<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>']:=0;
t_ch_fee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=0;
t_ch_fee['¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=now;
t_ch_fee['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=0;
t_ch_fee['ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD>']:=0;
t_ch_fee['˰<><CBB0>']:=0;
t_ch_fee['˰<><CBB0>']:=0;
t_ch_fee['<27><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>']:=0;
t_ch_fee['<27><><EFBFBD>㵥λ']:='ί<>е<EFBFBD>λ';
t_ch_fee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_op_seae.FieldByName('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>').AsString;
t_ch_fee['˳<><CBB3>']:=t_ch_project_fee.fieldbyname('˳<><CBB3>').asInteger;
t_ch_fee['<27><><EFBFBD><EFBFBD>']:=0;
t_ch_fee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ']:=0;
t_ch_fee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_ch_project_fee.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
t_ch_fee['<27><><EFBFBD>㵥λ']:=t_ch_project_fee.fieldbyname('<27><><EFBFBD>㵥λ').asstring;
t_ch_fee['<27>ұ<EFBFBD>']:=t_ch_project_fee.fieldbyname('<27>ұ<EFBFBD>').asstring;
if t_ch_fee.fieldbyname('<27>ұ<EFBFBD>').asstring='USD' then
t_ch_fee['<27><><EFBFBD><EFBFBD>']:=getUsdExRate(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)
else t_ch_fee['<27><><EFBFBD><EFBFBD>']:=1;
t_ch_fee['<27><>ע']:=t_ch_project_fee.fieldbyname('<27><><EFBFBD>ñ<EFBFBD>ע').asstring;
t_ch_fee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=ProjectName;
if t_ch_project_fee.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring=''then
begin
t_ch_fee['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>']:=fee_get_client(t_ch_project_fee.fieldbyname('<27><><EFBFBD>㵥λ').asstring,t_op_seae);
end
else
begin
t_ch_fee['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>']:=t_ch_project_fee.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring;
end;
t_ch_fee['<27><>׼']:=t_ch_project_fee.fieldbyname('<27><>׼').asstring;
if t_ch_project_fee.fieldbyname('<27><>׼').asstring='<27><>Ʊ' then
begin
t_ch_fee['<27><><EFBFBD><EFBFBD>']:=1;
end
else if t_ch_project_fee.fieldbyname('<27><>׼').asstring='<27><><EFBFBD><EFBFBD>' then
begin
if s_w(4,t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat/1000)>1 then
t_ch_fee['<27><><EFBFBD><EFBFBD>']:=s_w(4,t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat/1000)
else
t_ch_fee['<27><><EFBFBD><EFBFBD>']:=1;
end
else if t_ch_project_fee.fieldbyname('<27><>׼').asstring='<27><><EFBFBD><EFBFBD>' then
begin
if t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat>1 then
t_ch_fee['<27><><EFBFBD><EFBFBD>']:=t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat
else
t_ch_fee['<27><><EFBFBD><EFBFBD>']:=1;
end
else if t_ch_project_fee.fieldbyname('<27><>׼').asstring='<27>ƷѶ<C6B7>' then
begin
t_ch_fee['<27><><EFBFBD><EFBFBD>']:=0;
end
else if t_ch_project_fee.fieldbyname('<27><>׼').asstring='<27>Ƽ<EFBFBD><C6BC><EFBFBD><EFBFBD><EFBFBD>' then
begin
t_ch_fee['<27><><EFBFBD><EFBFBD>']:=t_op_seae.fieldbyname('<27>Ƽ<EFBFBD><C6BC><EFBFBD><EFBFBD><EFBFBD>').asfloat;
end
else if t_ch_project_fee.fieldbyname('<27><>׼').asstring='<27><><EFBFBD><EFBFBD>' then
begin
t_ch_fee['<27><><EFBFBD><EFBFBD>']:=t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat;
end;
if 1=1 then
if t_ch_project_fee.fieldbyname('<27><>׼').asstring='TEU' then
begin
t_ch_fee['<27><><EFBFBD><EFBFBD>']:=t_op_seae.fieldbyname('<27><>TEU').asfloat;
end;
t_ch_fee['<27><><EFBFBD><EFBFBD>']:=t_ch_project_fee.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat;
t_ch_fee['˰<><CBB0>']:=t_ch_project_fee.fieldbyname('˰<><CBB0>').AsFloat;
t_ch_fee.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat:=t_ch_fee.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat*t_ch_fee.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat;
t_ch_fee.post;
end;
end
else
if (t_ch_project_fee.FieldByName('<27><>׼').asstring='<27><><EFBFBD><EFBFBD>') then
begin
if 1=1 then
begin
t_ch_project_standard.Close;
t_ch_project_standard.Parameters.ParamByName('DE_ID').Value:=t_ch_project_fee.fieldByName('DE_ID').AsInteger;
t_ch_project_standard.Open;t_ch_project_standard.First;
if t_op_ctn.IsEmpty then
begin
end
else
begin
if t_ch_project_standard.IsEmpty then
begin
end
else
begin
t_ch_project_standard.first;
while not t_ch_project_standard.eof do
begin
if t_op_ctn.Locate('<27><><EFBFBD><EFBFBD>',t_ch_project_standard.fieldbyname('<27><><EFBFBD>ʹ<EFBFBD><CDB4><EFBFBD>').asstring,[])then
begin
feename:='';
corpname:='';
bz:='';
amt:=0;
currencyName:='';
DCType:='';
feename:=t_ch_project_fee.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
if t_ch_project_fee.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring=''then
begin
corpname:=fee_get_client(t_ch_project_fee.fieldbyname('<27><><EFBFBD>㵥λ').asstring,t_op_seae);
end
else
begin
corpname:=t_ch_project_fee.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring;
end;
bz:=t_ch_project_standard.fieldbyname('<27><>׼').asstring;
amt:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat*t_ch_project_standard.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat;
currencyName:=t_ch_project_fee.fieldbyname('<27>ұ<EFBFBD>').asstring;
DCType:=Dc;
if not t_ch_fee.Locate('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;<3B>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>;<3B><>׼;<3B><><EFBFBD><EFBFBD>;<3B>ұ<EFBFBD>;<3B><><EFBFBD><EFBFBD>'
,VarArrayOf([feename,corpname,bz,amt,currencyName,DCType]),[]) then
begin
t_ch_fee.Append;
t_ch_fee['<27><><EFBFBD><EFBFBD>']:=t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
t_ch_fee['<27><><EFBFBD><EFBFBD>״̬']:='¼<><C2BC>״̬';
t_ch_fee['<27><><EFBFBD><EFBFBD>״̬']:='<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>';
t_ch_fee['<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>']:=now;
t_ch_fee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=employee;
t_ch_fee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=now;
t_ch_fee['<27><><EFBFBD><EFBFBD>']:=DC;
t_ch_fee['¼<><C2BC><EFBFBD><EFBFBD>']:=t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString;
t_ch_fee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=0;
t_ch_fee['<27><><EFBFBD><EFBFBD>']:=0;
t_ch_fee['<27>ұ<EFBFBD>']:='RMB';
t_ch_fee['<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>']:=0;
t_ch_fee['<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>']:=0;
t_ch_fee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=0;
t_ch_fee['¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=now;
t_ch_fee['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=0;
t_ch_fee['ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD>']:=0;
t_ch_fee['˰<><CBB0>']:=0;
t_ch_fee['˰<><CBB0>']:=0;
t_ch_fee['<27><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>']:=0;
t_ch_fee['<27><><EFBFBD>㵥λ']:='ί<>е<EFBFBD>λ';
t_ch_fee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_op_seae.FieldByName('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>').AsString;
t_ch_fee['˳<><CBB3>']:=t_ch_project_fee.fieldbyname('˳<><CBB3>').asInteger;
t_ch_fee['<27><><EFBFBD><EFBFBD>']:=0;
t_ch_fee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ']:=0;
t_ch_fee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_ch_project_fee.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
t_ch_fee['<27><><EFBFBD>㵥λ']:=t_ch_project_fee.fieldbyname('<27><><EFBFBD>㵥λ').asstring;
t_ch_fee['<27>ұ<EFBFBD>']:=t_ch_project_fee.fieldbyname('<27>ұ<EFBFBD>').asstring;
if t_ch_fee.fieldbyname('<27>ұ<EFBFBD>').asstring='USD' then
t_ch_fee['<27><><EFBFBD><EFBFBD>']:=getUsdExRate(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)
else t_ch_fee['<27><><EFBFBD><EFBFBD>']:=1;
t_ch_fee['<27><>ע']:=t_ch_project_fee.fieldbyname('<27><><EFBFBD>ñ<EFBFBD>ע').asstring;
t_ch_fee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=ProjectName;
if t_ch_project_fee.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring=''then
begin
t_ch_fee['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>']:=fee_get_client(t_ch_project_fee.fieldbyname('<27><><EFBFBD>㵥λ').asstring,t_op_seae);
end
else
begin
t_ch_fee['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>']:=t_ch_project_fee.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring;
end;
t_ch_fee['<27><>׼']:=t_ch_project_standard.fieldbyname('<27><>׼').asstring;
t_ch_fee['<27><><EFBFBD><EFBFBD>']:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat;
t_ch_fee['<27><><EFBFBD><EFBFBD>']:=t_ch_project_standard.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat;
t_ch_fee['˰<><CBB0>']:=t_ch_project_fee.fieldbyname('˰<><CBB0>').AsFloat;
t_ch_fee.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat:=t_ch_fee.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat*t_ch_fee.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat;
t_ch_fee.post;
if_do:=true;
end;
end;
t_ch_project_standard.Next;
end;
if not if_do then
begin
end;
end;
end;
end;
end;
t_ch_project_fee.next;
end;
end;
{
t_op_seaeUpdate.Close;
t_op_seaeUpdate.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
t_op_seaeUpdate.Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=ProjectName;
t_op_seaeUpdate.ExecSQL;
}
{ p_op_gain.Close;
p_op_gain.Parameters.AddParameter.Name := '@RETURN_VALUE';
p_op_gain.Parameters.AddParameter.DataType := ftInteger;
p_op_gain.Parameters.AddParameter.Direction := pdReturnValue;
p_op_gain.Parameters.AddParameter.Precision:=10;
p_op_gain.Parameters.AddParameter.Value:=null;
p_op_gain.Parameters.AddParameter.Name := '@con_no';
p_op_gain.Parameters.AddParameter.DataType := ftString;
p_op_gain.Parameters.AddParameter.Direction := pdInput;
p_op_gain.Parameters.AddParameter.Size:=12;
p_op_gain.Parameters.AddParameter.Attributes:=[paNullable];
p_op_gain.Parameters.ParamByName('@con_no').Value := fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
p_op_gain.Active;
}
p_op_gain1.Parameters.ParamByName('@con_no').Value := fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
p_op_gain1.ExecProc;
Next;
end;
end;
frm_main.db.CommitTrans;
finally
t_ch_project_standard.Free;
t_ch_project_fee.Free;
t_ch_project_Condition.Free;
t_op_ctn.Free;
t_op_seae.Free;
t_ch_fee.Free;
p_op_gain.Free;
if frm_main.db.InTransaction then
begin
frm_main.db.RollbackTrans;
end;
end;
end;
procedure Tfrm_code_fee_project_new.DeleteProjectFee(Projectid:Integer;EtdBegin,EtdEnd:TDateTime;DC,ProjectName:string);
var
t_op_seae,t_ch_fee,t_op_ctn,t_op_seaeUpdate:TADOQuery;
Conditions:string;
p_op_gain:TADOStoredProc;
acount:Integer;
begin
Conditions:='';
p_op_gain:=CreateADOStoredProc;
p_op_gain.ProcedureName:='p_op_gain;1';
t_op_seae:=CreateAdoQuery;
t_ch_fee:=CreateAdoQuery;
t_op_seaeUpdate:=CreateAdoQuery;
frm_main.db.BeginTrans;
try
with t_ch_fee do
begin
Close;SQL.Clear;
sql.Add('select * from t_ch_fee');
sql.Add('where <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> and <20><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>=0 and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=0 and <20><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>=0 and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=0 and (<28><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''' or <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD> is null) ');
sql.Add('and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>');
Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:='';
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:='';
end;
with t_op_seaeUpdate do
begin
Close;sql.Clear;
SQL.Add('update t_op_seae set <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''''');
sql.Add('WHERE <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>');
Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:='';
end;
with t_op_seae do
begin
Close;sql.Clear;
SQL.Add('Select * from t_op_seae');
sql.Add('WHERE <20><><EFBFBD><EFBFBD>״̬<>''<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>''');
sql.Add(Conditions);
sql.Add('And (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>=:<3A><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD> and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)');
// sql.Add('And <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
Parameters.ParamByName('<27><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>').Value:=EtdBegin;
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=EtdEnd;
// Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=ProjectName;
Open;First;
while not eof do
begin
t_ch_fee.Close;
t_ch_fee.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
t_ch_fee.Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=ProjectName;
t_ch_fee.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=DC;
t_ch_fee.open;t_ch_fee.First;
acount:=t_ch_fee.RecordCount;
while not t_ch_fee.eof do
begin
t_ch_fee.Delete;
end;
// if acount>=1 then
// begin
t_op_seaeUpdate.Close;
t_op_seaeUpdate.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
t_op_seaeUpdate.ExecSQL;
p_op_gain1.Parameters.ParamByName('@con_no').Value := fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
p_op_gain1.ExecProc;
// end;
Next;
end;
end;
frm_main.db.CommitTrans;
finally
t_op_seae.Free;
t_ch_fee.Free;
p_op_gain.Free;
if frm_main.db.InTransaction then
begin
frm_main.db.RollbackTrans;
end;
end;
end;
procedure Tfrm_code_fee_project_new.Button1Click(Sender: TObject);
var aADOQuery:TADOQuery;
DC:string;
begin
if MessageDlg('ȷʵҪ<CAB5><D2AA><EFBFBD>Է<EFBFBD><D4B7>÷<EFBFBD><C3B7><EFBFBD>:'+t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+' <20><>?',mtWarning,[mbYes,mbNo],0)=mrNo then
exit;
aADOQuery:=CreateAdoQuery;
with aADOQuery do
try
Close;SQL.Clear;
SQL.Add('select * from t_ch_project_new');
SQL.Add('where <20><><EFBFBD><EFBFBD>״̬=''<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>''');
SQL.Add('and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
Open;First;
while not eof do
begin
if fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString='<27>շ<EFBFBD>' then
DC:='<27><>'
else
dc:='<27><>';
InsertProjectFee(fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger,fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime,fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹ').AsDateTime,DC,fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString);
Next;
end;
finally
Free;
end;
end;
procedure Tfrm_code_fee_project_new.wwDBLookupCombo1KeyPress(
Sender: TObject; var Key: Char);
begin
if key=#13 then
begin
if (t_ch_project_fee.state=dsinsert)or(t_ch_project_fee.state=dsedit) then
begin
if frm_data_share.t_code_fee.locate('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',t_ch_project_fee.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,[]) then
begin
t_ch_project_fee['˳<><CBB3>']:=frm_data_share.t_code_fee.fieldbyname('˳<><CBB3>').asInteger;
end;
end;
end;
end;
procedure Tfrm_code_fee_project_new.wwDBLookupCombo2KeyPress(
Sender: TObject; var Key: Char);
begin
if key=#13 then
begin
if (t_ch_project_fee.state=dsinsert)or(t_ch_project_fee.state=dsedit) then
begin
if not frm_data_share.t_code_fee.IsEmpty then
if frm_data_share.t_code_fee.locate('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',t_ch_project_fee.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,[]) then
begin
t_ch_project_fee['˳<><CBB3>']:=frm_data_share.t_code_fee.fieldbyname('˳<><CBB3>').asInteger;
end;
end;
end;
end;
procedure Tfrm_code_fee_project_new.bsSkinButton17Click(Sender: TObject);
begin
table_before_post(t_ch_project,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
table_before_post(t_ch_project,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
table_before_post(t_ch_project,'ҵ<><D2B5><EFBFBD><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>');
table_before_post(t_ch_project,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
table_before_post(t_ch_project,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹ');
if t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring<>''then
begin
if t_ch_project.fieldbyname('<27><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>').asdatetime>t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asdatetime then
begin
showmessage('<27><>ʼ<EFBFBD><CABC><EFBFBD>ڲ<EFBFBD><DAB2>ܴ<EFBFBD><DCB4>ڽ<EFBFBD><DABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD>');
abort;
end;
end;
if t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹ').asstring<>''then
begin
if t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asdatetime>t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹ').asdatetime then
begin
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD><DCB4>ڿ<EFBFBD><DABF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹ<EFBFBD><D6B9><EFBFBD><EFBFBD>');
abort;
end;
end;
table_post(t_ch_project);
t_ch_project_Condition.append;
end;
procedure Tfrm_code_fee_project_new.bsSkinButton19Click(Sender: TObject);
begin
if t_ch_project.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring='' then
begin
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD>Ϊ<EFBFBD><CEAA>,<2C><EFBFBD><EFBFBD><E6B7BD>');
end
else
begin
table_post(t_ch_project);
table_post(t_ch_project_Condition);
end;
end;
procedure Tfrm_code_fee_project_new.bsSkinButton20Click(Sender: TObject);
begin
table_delete(t_ch_project_Condition);
end;
procedure Tfrm_code_fee_project_new.bsSkinButton21Click(Sender: TObject);
begin
table_cancel(t_ch_project_Condition);
end;
procedure Tfrm_code_fee_project_new.t_ch_project_ConditionBeforeInsert(
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;
if not modify_Project then
begin
if t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD>״̬').asstring='<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>' then
begin
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>,<2C><><EFBFBD><EFBFBD><EFBFBD>޸ģ<DEB8>');
abort;
end;
end;
if t_ch_project.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring='' then
begin
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD>Ϊ<EFBFBD><CEAA>,<2C><EFBFBD><EFBFBD><E6B7BD>');
abort;
end
end;
procedure Tfrm_code_fee_project_new.Button2Click(Sender: TObject);
var aADOQuery:TADOQuery;
DC:string;
begin
if MessageDlg('ȷʵҪ<CAB5><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>:'+t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+' <20><>?',mtWarning,[mbYes,mbNo],0)=mrNo then
exit;
aADOQuery:=CreateAdoQuery;
with aADOQuery do
try
Close;SQL.Clear;
SQL.Add('select * from t_ch_project_new');
SQL.Add('where <20><><EFBFBD><EFBFBD>״̬=''<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>''');
SQL.Add('and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
Open;First;
while not eof do
begin
if fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString='<27>շ<EFBFBD>' then
DC:='<27><>'
else
dc:='<27><>';
DeleteProjectFee(fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger,fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime,fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹ').AsDateTime,DC,fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString);
Next;
end;
finally
Free;
end;
end;
procedure Tfrm_code_fee_project_new.t_ch_project_ConditionBeforeDelete(
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;
if not modify_Project then
begin
if t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD>״̬').asstring='<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>' then
begin
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>,<2C><><EFBFBD><EFBFBD><EFBFBD>޸ģ<DEB8>');
abort;
end;
end;
end;
procedure Tfrm_code_fee_project_new.t_ch_project_ConditionAfterInsert(
DataSet: TDataSet);
begin
t_ch_project_Condition.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring:=t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
end;
procedure Tfrm_code_fee_project_new.bsSkinButton16Click(Sender: TObject);
begin
if t_ch_project_fee.FieldByName('ȷ<><C8B7>').AsBoolean then
begin
t_ch_project_fee.Edit;
t_ch_project_fee.FieldByName('ȷ<><C8B7>').AsBoolean:=False;
t_ch_project_fee.Post;
end
else
begin
t_ch_project_fee.Edit;
t_ch_project_fee.FieldByName('ȷ<><C8B7>').AsBoolean:=True;
t_ch_project_fee.Post;
end;
end;
procedure Tfrm_code_fee_project_new.bsSkinButton18Click(Sender: TObject);
var aADOQuery:TADOQuery;
begin
if t_ch_project.IsEmpty then
exit;
table_post(t_ch_project);
if MessageDlg('ȷʵҪ<CAB5><D2AA><EFBFBD><EFBFBD>:'+t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+' <20><>?',mtWarning,[mbYes,mbNo],0)=mrNo then
begin
exit;
end;
t_ch_project_old.Close;
t_ch_project_fee_old.close;
t_ch_project_standard_old.close;
t_ch_project_Condition_old.close;
t_ch_project_old.Parameters[0].value:=t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
t_ch_project_old.open;
t_ch_project_fee_old.open;
t_ch_project_standard_old.open;
t_ch_project_Condition_old.open;
try
frm_code_fee_project_copy_new:=tfrm_code_fee_project_copy_new.Create (self);
frm_code_fee_project_copy_new.B_UpdateProject:=true;
t_ch_project.insert;
t_ch_project['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_ch_project_old['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
t_ch_project['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_ch_project_old['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
t_ch_project['ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_ch_project_old['ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
t_ch_project['ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_ch_project_old['ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
t_ch_project['<27><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>']:=t_ch_project_old['<27><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>'];
t_ch_project['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_ch_project_old['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
t_ch_project['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_ch_project_old['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
t_ch_project['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹ']:=t_ch_project_old['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹ'];
frm_code_fee_project_copy_new.ShowModal;
finally
frm_code_fee_project_copy_new.Free;
frm_code_fee_project_copy_new:=nil;
t_ch_project.Refresh;
end;
end;
procedure Tfrm_code_fee_project_new.bsSkinButton22Click(Sender: TObject);
begin
if not if_open('401') then
begin
showmessage('<27><>Ǹ,<2C><>û<EFBFBD><C3BB>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
exit;
end;
if t_ch_project_fee.State in [dsedit,dsinsert] then t_ch_project_fee.Post;
if MessageDlg('ȷʵҪȡ<D2AA><C8A1>:'+t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+' <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?',mtWarning,[mbYes,mbNo],0)=mrNo then
begin
exit;
end
else
begin
try
modify_Project:=True;
t_ch_project.Edit;
t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD>״̬').asstring:='δ<><CEB4><EFBFBD><EFBFBD>';
t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring:=employee;
t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime:=Now;
t_ch_project.post;
finally
modify_Project:=False;
end;
end;
end;
procedure Tfrm_code_fee_project_new.bsSkinButton23Click(Sender: TObject);
begin
if t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD>״̬').asstring<>'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>' then
begin
if MessageDlg('ȷʵҪ<CAB5><EFBFBD><E1BDBB><EFBFBD><EFBFBD>:'+t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+' <20><>?',mtWarning,[mbYes,mbNo],0)=mrNo then
begin
exit;
end
else
begin
try
modify_Project:=True;
t_ch_project.Edit;
t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD>״̬').asstring:='<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>';
t_ch_project.post;
finally
modify_Project:=False;
end;
end;
end
end;
procedure Tfrm_code_fee_project_new.bsSkinButton24Click(Sender: TObject);
begin
if t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD>״̬').asstring<>'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>' then
begin
if MessageDlg('ȷʵҪ<CAB5><D2AA><EFBFBD><EFBFBD><EFBFBD>ύ:'+t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+' <20><>?',mtWarning,[mbYes,mbNo],0)=mrNo then
begin
exit;
end
else
begin
try
modify_Project:=True;
t_ch_project.Edit;
t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD>״̬').asstring:='δ<><CEB4><EFBFBD><EFBFBD>';
t_ch_project.post;
finally
modify_Project:=False;
end;
end;
end
end;
procedure Tfrm_code_fee_project_new.bsSkinButton25Click(Sender: TObject);
begin
if not if_open('401') then
begin
showmessage('<27><>Ǹ,<2C><>û<EFBFBD><C3BB>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
exit;
end;
if t_ch_project_fee.State in [dsedit,dsinsert] then t_ch_project_fee.Post;
if t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD>״̬').asstring<>'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>' then
begin
if MessageDlg('ȷʵҪ<CAB5><D2AA><EFBFBD><EFBFBD><EFBFBD>ύ:'+t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+' <20><>?',mtWarning,[mbYes,mbNo],0)=mrNo then
begin
exit;
end
else
begin
try
modify_Project:=True;
t_ch_project.Edit;
t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD>״̬').asstring:='<27><><EFBFBD><EFBFBD><EFBFBD>ύ';
t_ch_project.post;
finally
modify_Project:=False;
end;
end;
end
end;
procedure Tfrm_code_fee_project_new.bsSkinButton26Click(Sender: TObject);
begin
if not if_open('401') then
begin
showmessage('<27><>Ǹ,<2C><>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
exit;
end;
if t_ch_project_fee.State in [dsedit,dsinsert] then t_ch_project_fee.Post;
if MessageDlg('ȷʵҪ<CAB5><D2AA><EFBFBD><EFBFBD>:'+t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+' <20><>?',mtWarning,[mbYes,mbNo],0)=mrNo then
begin
exit;
end
else
begin
try
modify_Project:=True;
t_ch_project.Edit;
t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD>״̬').asstring:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring:=employee;
t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime:=Now;
t_ch_project.post;
finally
modify_Project:=False;
end;
end;
end;
procedure Tfrm_code_fee_project_new.bsSkinButton27Click(Sender: TObject);
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;
if t_ch_project_fee.State in [dsedit,dsinsert] then t_ch_project_fee.Post;
if MessageDlg('ȷʵҪ<CAB5><D2AA><EFBFBD><EFBFBD>:'+t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+' <20><>?',mtWarning,[mbYes,mbNo],0)=mrNo then
begin
exit;
end
else
begin
try
modify_Project:=True;
t_ch_project.Edit;
if t_ch_project.fieldbyname('<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>').AsBoolean then
t_ch_project.fieldbyname('<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>').AsBoolean:=false
else
t_ch_project.fieldbyname('<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>').AsBoolean:=true;
t_ch_project.post;
finally
modify_Project:=False;
end;
end;
end;
procedure Tfrm_code_fee_project_new.bsSkinButton28Click(Sender: TObject);
var str:string;
begin
str:=trim(InputBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD>ԭ<EFBFBD><D4AD>', '<27>޸<EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD>', ''));
if str=''then
begin
showmessage('<27>޸<EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD><D5A3>޸<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD>');
exit;
end;
if t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD>״̬').asstring='<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>' then
begin
if MessageDlg('ȷʵҪ<CAB5><D2AA><EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD>:'+t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+' <20><>?',mtWarning,[mbYes,mbNo],0)=mrNo then
begin
exit;
end
else
begin
try
modify_Project:=True;
t_ch_project.Edit;
t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD>״̬').asstring:='<27><><EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD>';
t_ch_project.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע').asstring:=str;
t_ch_project.post;
finally
modify_Project:=False;
end;
end;
end
end;
end.