|
|
unit u_code_fee_project_agent;
|
|
|
|
|
|
interface
|
|
|
|
|
|
uses
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
Dialogs, wwdbedit, Wwdotdot, Wwdbcomb, Mask, DBCtrls, StdCtrls, wwdblook,
|
|
|
Grids, Wwdbigrd, Wwdbgrid, bsSkinCtrls, ExtCtrls, DB, ADODB, DBGrids;
|
|
|
|
|
|
type
|
|
|
Tfrm_project_fee_agent = class(TForm)
|
|
|
Panel2: TPanel;
|
|
|
Panel4: TPanel;
|
|
|
bsSkinButton5: TbsSkinButton;
|
|
|
bsSkinButton6: TbsSkinButton;
|
|
|
bsSkinButton7: TbsSkinButton;
|
|
|
bsSkinButton8: TbsSkinButton;
|
|
|
bsSkinButton9: TbsSkinButton;
|
|
|
wwDBGrid2: TwwDBGrid;
|
|
|
wwDBLookupCombo2: TwwDBLookupCombo;
|
|
|
wwDBLookupCombo3: TwwDBLookupCombo;
|
|
|
wwDBLookupCombo1: TwwDBLookupCombo;
|
|
|
DBEdit1: TDBEdit;
|
|
|
Panel1: TPanel;
|
|
|
Panel3: TPanel;
|
|
|
bsSkinButton1: TbsSkinButton;
|
|
|
bsSkinButton2: TbsSkinButton;
|
|
|
bsSkinButton4: TbsSkinButton;
|
|
|
bsSkinButton3: TbsSkinButton;
|
|
|
wwDBGrid1: TwwDBGrid;
|
|
|
wwDBComboBox1: TwwDBComboBox;
|
|
|
t_ch_project_fee: TADOQuery;
|
|
|
t_ch_project: TADOQuery;
|
|
|
t_ch_project1: TDataSource;
|
|
|
t_ch_project_fee1: TDataSource;
|
|
|
Panel5: TPanel;
|
|
|
t_ch_project_fee_detail1: TDataSource;
|
|
|
t_ch_project_fee_detail: TADOQuery;
|
|
|
DBNavigator1: TDBNavigator;
|
|
|
DBGrid1: TDBGrid;
|
|
|
Panel6: TPanel;
|
|
|
DBMemo1: TDBMemo;
|
|
|
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 FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
procedure t_ch_projectAfterInsert(DataSet: TDataSet);
|
|
|
procedure t_ch_projectBeforePost(DataSet: TDataSet);
|
|
|
procedure wwDBLookupCombo3Change(Sender: TObject);
|
|
|
procedure wwDBLookupCombo1Change(Sender: TObject);
|
|
|
procedure t_ch_project_feeAfterInsert(DataSet: TDataSet);
|
|
|
procedure t_ch_project_feeBeforeInsert(DataSet: TDataSet);
|
|
|
procedure t_ch_project_fee_detailBeforeInsert(DataSet: TDataSet);
|
|
|
private
|
|
|
{ Private declarations }
|
|
|
public
|
|
|
{ Public declarations }
|
|
|
end;
|
|
|
|
|
|
var
|
|
|
frm_project_fee_agent: Tfrm_project_fee_agent;
|
|
|
|
|
|
implementation
|
|
|
|
|
|
uses u_data_share, u_main, my_sys_function;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
procedure Tfrm_project_fee_agent.bsSkinButton9Click(Sender: TObject);
|
|
|
begin
|
|
|
close;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_project_fee_agent.bsSkinButton1Click(Sender: TObject);
|
|
|
begin
|
|
|
t_ch_project.insert;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_project_fee_agent.bsSkinButton2Click(Sender: TObject);
|
|
|
begin
|
|
|
table_post(t_ch_project);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_project_fee_agent.bsSkinButton4Click(Sender: TObject);
|
|
|
begin
|
|
|
table_delete(t_ch_project);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_project_fee_agent.bsSkinButton3Click(Sender: TObject);
|
|
|
begin
|
|
|
table_cancel(t_ch_project);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_project_fee_agent.bsSkinButton5Click(Sender: TObject);
|
|
|
begin
|
|
|
t_ch_project_fee.insert;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_project_fee_agent.bsSkinButton6Click(Sender: TObject);
|
|
|
begin
|
|
|
table_post(t_ch_project_fee);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_project_fee_agent.bsSkinButton7Click(Sender: TObject);
|
|
|
begin
|
|
|
table_delete(t_ch_project_fee);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_project_fee_agent.bsSkinButton8Click(Sender: TObject);
|
|
|
begin
|
|
|
table_cancel(t_ch_project_fee);
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_project_fee_agent.FormClose(Sender: TObject;
|
|
|
var Action: TCloseAction);
|
|
|
begin
|
|
|
if t_ch_project.State in [dsedit,dsinsert] then
|
|
|
t_ch_project.Post;
|
|
|
if t_ch_project_fee.State in [dsedit,dsinsert] then
|
|
|
t_ch_project_fee.Post;
|
|
|
if t_ch_project_fee_detail.State in [dsedit,dsinsert] then
|
|
|
t_ch_project_fee_detail.Post;
|
|
|
|
|
|
frm_project_fee_agent.Hide;
|
|
|
frm_project_fee_agent.ManualFloat(frm_project_fee_agent.BoundsRect );
|
|
|
frm_main.freeTabs('frm_project_fee_agent');
|
|
|
action:=cafree;
|
|
|
frm_project_fee_agent:=nil;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_project_fee_agent.FormShow(Sender: TObject);
|
|
|
begin
|
|
|
t_ch_project.SQL.clear;
|
|
|
t_ch_project.sql.add('select * from t_ch_project_agent ');
|
|
|
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;
|
|
|
t_ch_project_fee.open;
|
|
|
t_ch_project_fee_detail.open;
|
|
|
|
|
|
frm_data_share.t_code_fee.requery;
|
|
|
frm_data_share.t_crm_client_daili.requery;
|
|
|
frm_data_share.t_code_currency.requery;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_project_fee_agent.t_ch_projectAfterInsert(
|
|
|
DataSet: TDataSet);
|
|
|
begin
|
|
|
t_ch_project['¼<><C2BC><EFBFBD><EFBFBD>']:=employee;
|
|
|
t_ch_project['¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=date;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_project_fee_agent.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,'ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_project_fee_agent.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_project_fee_agent.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;
|
|
|
t_ch_project_fee['<27><><EFBFBD><EFBFBD>Ӣ<EFBFBD><D3A2><EFBFBD><EFBFBD>']:=frm_data_share.t_code_fee.fieldbyname('Ӣ<><D3A2><EFBFBD><EFBFBD>').asstring;
|
|
|
end;
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_project_fee_agent.t_ch_project_feeAfterInsert(
|
|
|
DataSet: TDataSet);
|
|
|
begin
|
|
|
t_ch_project_fee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=0;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_project_fee_agent.t_ch_project_feeBeforeInsert(
|
|
|
DataSet: TDataSet);
|
|
|
begin
|
|
|
if t_ch_project.State in [dsedit,dsinsert] then
|
|
|
t_ch_project.Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_project_fee_agent.t_ch_project_fee_detailBeforeInsert(
|
|
|
DataSet: TDataSet);
|
|
|
begin
|
|
|
if t_ch_project_fee.State in [dsedit,dsinsert] then
|
|
|
t_ch_project_fee.Post;
|
|
|
end;
|
|
|
|
|
|
end.
|