|
|
unit u_rp_dui_formatrpt;
|
|
|
|
|
|
interface
|
|
|
|
|
|
uses
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
Dialogs, DB, ADODB, bsSkinCtrls, BusinessSkinForm, dxExEdtr, dxCntner,
|
|
|
dxTL, dxDBCtrl, dxDBGrid, bsSkinBoxCtrls, StdCtrls, DBCtrls, Grids,
|
|
|
Wwdbigrd, Wwdbgrid, dxDBTLCl, dxGrClms;
|
|
|
|
|
|
type
|
|
|
Tfrm_rp_dui_formatrpt = class(TForm)
|
|
|
t_ch_dui_format: TADOQuery;
|
|
|
t_ch_dui_format1: TDataSource;
|
|
|
bsBusinessSkinForm1: TbsBusinessSkinForm;
|
|
|
bsSkinPanel1: TbsSkinPanel;
|
|
|
bsSkinPanel2: TbsSkinPanel;
|
|
|
bsSkinButton1: TbsSkinButton;
|
|
|
bsSkinButton2: TbsSkinButton;
|
|
|
bsSkinButton4: TbsSkinButton;
|
|
|
bsSkinButton3: TbsSkinButton;
|
|
|
bsSkinPanel5: TbsSkinPanel;
|
|
|
bsSkinPanel6: TbsSkinPanel;
|
|
|
bsSkinButton6: TbsSkinButton;
|
|
|
bsSkinButton10: TbsSkinButton;
|
|
|
bsSkinButton11: TbsSkinButton;
|
|
|
bsSkinButton12: TbsSkinButton;
|
|
|
bsSkinPanel7: TbsSkinPanel;
|
|
|
bsSkinGroupBox1: TbsSkinGroupBox;
|
|
|
bsSkinListBox1: TbsSkinListBox;
|
|
|
bsSkinGroupBox2: TbsSkinGroupBox;
|
|
|
dxDBGrid3: TdxDBGrid;
|
|
|
dxDBGrid3Column1: TdxDBGridMaskColumn;
|
|
|
bsSkinButton5: TbsSkinButton;
|
|
|
Memo1: TMemo;
|
|
|
Memo2: TMemo;
|
|
|
Memo3: TMemo;
|
|
|
Memo4: TMemo;
|
|
|
bsSkinButton7: TbsSkinButton;
|
|
|
bsSkinButton8: TbsSkinButton;
|
|
|
Memo5: TMemo;
|
|
|
bsSkinPanel3: TbsSkinPanel;
|
|
|
bsSkinPanel4: TbsSkinPanel;
|
|
|
DBListBox1: TListBox;
|
|
|
bsSkinPanel8: TbsSkinPanel;
|
|
|
bsSkinPanel9: TbsSkinPanel;
|
|
|
dxDBGrid1: TdxDBGrid;
|
|
|
dxDBGrid1Column1: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column2: TdxDBGridMaskColumn;
|
|
|
t_ch_dui_feefield: TADOQuery;
|
|
|
t_ch_dui_feefield1: TDataSource;
|
|
|
t_ch_dui_feename: TADOQuery;
|
|
|
t_ch_dui_feename1: TDataSource;
|
|
|
bsSkinPanel10: TbsSkinPanel;
|
|
|
dxDBGrid2: TdxDBGrid;
|
|
|
dxDBGridMaskColumn1: TdxDBGridMaskColumn;
|
|
|
Label1: TLabel;
|
|
|
bsSkinPanel11: TbsSkinPanel;
|
|
|
Label2: TLabel;
|
|
|
wwDBGrid1: TwwDBGrid;
|
|
|
bsSkinButton9: TbsSkinButton;
|
|
|
bsSkinButton13: TbsSkinButton;
|
|
|
bsSkinButton14: TbsSkinButton;
|
|
|
dxDBGrid1Column3: TdxDBGridCheckColumn;
|
|
|
procedure bsSkinButton1Click(Sender: TObject);
|
|
|
procedure bsSkinButton2Click(Sender: TObject);
|
|
|
procedure bsSkinButton4Click(Sender: TObject);
|
|
|
procedure bsSkinButton3Click(Sender: TObject);
|
|
|
procedure t_ch_dui_formatAfterInsert(DataSet: TDataSet);
|
|
|
procedure t_ch_dui_formatBeforePost(DataSet: TDataSet);
|
|
|
procedure t_ch_dui_formatDeleteError(DataSet: TDataSet;
|
|
|
E: EDatabaseError; var Action: TDataAction);
|
|
|
procedure t_ch_dui_format_detailBeforeInsert(DataSet: TDataSet);
|
|
|
procedure bsSkinButton5Click(Sender: TObject);
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
procedure bsSkinButton6Click(Sender: TObject);
|
|
|
procedure bsSkinButton10Click(Sender: TObject);
|
|
|
procedure bsSkinButton11Click(Sender: TObject);
|
|
|
procedure bsSkinButton7Click(Sender: TObject);
|
|
|
procedure bsSkinButton8Click(Sender: TObject);
|
|
|
procedure t_ch_dui_formatAfterScroll(DataSet: TDataSet);
|
|
|
procedure t_ch_dui_feefieldAfterInsert(DataSet: TDataSet);
|
|
|
procedure t_ch_dui_feenameAfterInsert(DataSet: TDataSet);
|
|
|
procedure bsSkinButton9Click(Sender: TObject);
|
|
|
procedure bsSkinButton13Click(Sender: TObject);
|
|
|
procedure bsSkinButton14Click(Sender: TObject);
|
|
|
procedure t_ch_dui_feefieldBeforeInsert(DataSet: TDataSet);
|
|
|
procedure t_ch_dui_feenameBeforeInsert(DataSet: TDataSet);
|
|
|
private
|
|
|
{ Private declarations }
|
|
|
public
|
|
|
{ Public declarations }
|
|
|
end;
|
|
|
|
|
|
var
|
|
|
frm_rp_dui_formatrpt: Tfrm_rp_dui_formatrpt;
|
|
|
dui_format_type:integer;
|
|
|
|
|
|
implementation
|
|
|
|
|
|
uses u_main, u_data_share, my_sys_function;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
procedure Tfrm_rp_dui_formatrpt.bsSkinButton1Click(Sender: TObject);
|
|
|
begin
|
|
|
t_ch_dui_format.Insert;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_formatrpt.bsSkinButton2Click(Sender: TObject);
|
|
|
begin
|
|
|
table_post(t_ch_dui_format);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_formatrpt.bsSkinButton4Click(Sender: TObject);
|
|
|
begin
|
|
|
table_delete(t_ch_dui_format);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_formatrpt.bsSkinButton3Click(Sender: TObject);
|
|
|
begin
|
|
|
table_cancel(t_ch_dui_format);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_formatrpt.t_ch_dui_formatAfterInsert(DataSet: TDataSet);
|
|
|
begin
|
|
|
t_ch_dui_format['<27><><EFBFBD><EFBFBD>']:=dui_format_type;
|
|
|
t_ch_dui_format['<27>Ƿ<C7B7><F1B0B4B7>ÿͻ<C3BF><CDBB>ϼ<EFBFBD>']:=1;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_formatrpt.t_ch_dui_formatBeforePost(DataSet: TDataSet);
|
|
|
begin
|
|
|
t_ch_dui_format['<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>']:=DBListBox1.Items.Text;
|
|
|
table_before_post(t_ch_dui_format,'ģ<><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
table_before_post(t_ch_dui_format,'<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_formatrpt.t_ch_dui_formatDeleteError(DataSet: TDataSet;
|
|
|
E: EDatabaseError; var Action: TDataAction);
|
|
|
begin
|
|
|
showmessage('<27>ʵ<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>Ѿ<EFBFBD>ʹ<EFBFBD>ã<EFBFBD><C3A3><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
abort;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_formatrpt.t_ch_dui_format_detailBeforeInsert(
|
|
|
DataSet: TDataSet);
|
|
|
begin
|
|
|
table_post(t_ch_dui_format);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_formatrpt.bsSkinButton5Click(Sender: TObject);
|
|
|
begin
|
|
|
close;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_formatrpt.FormShow(Sender: TObject);
|
|
|
begin
|
|
|
t_ch_dui_format.Parameters[0].value:=dui_format_type;
|
|
|
t_ch_dui_format.open;
|
|
|
t_ch_dui_feefield.Open;
|
|
|
t_ch_dui_feename.Open;
|
|
|
|
|
|
case dui_format_type of
|
|
|
1,2,3,4:
|
|
|
begin
|
|
|
frm_data_share.t_code_fee.Requery();
|
|
|
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;
|
|
|
5,6,7,8:
|
|
|
begin
|
|
|
frm_data_share.t_code_fee.Requery();
|
|
|
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;
|
|
|
case dui_format_type of
|
|
|
1,2:
|
|
|
begin
|
|
|
bsSkinListBox1.Items.Text:=memo1.text;
|
|
|
end;
|
|
|
3,4:
|
|
|
begin
|
|
|
bsSkinListBox1.Items.Text:=memo2.text;
|
|
|
end;
|
|
|
5,6:
|
|
|
begin
|
|
|
bsSkinListBox1.Items.Text:=memo3.text;
|
|
|
end;
|
|
|
7,8:
|
|
|
begin
|
|
|
bsSkinListBox1.Items.Text:=memo4.text;
|
|
|
end;
|
|
|
9:
|
|
|
begin
|
|
|
bsSkinListBox1.Items.Text:=memo5.text;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_formatrpt.bsSkinButton6Click(Sender: TObject);
|
|
|
var
|
|
|
if_find:boolean;
|
|
|
i:integer;
|
|
|
begin
|
|
|
if t_ch_dui_format.IsEmpty then
|
|
|
exit;
|
|
|
if bsSkinListBox1.ItemIndex=-1 then
|
|
|
exit;
|
|
|
for i:=0 to DBListBox1.Items.Count-1 do
|
|
|
begin
|
|
|
if copy(DBListBox1.Items[i],2,length(DBListBox1.Items[i])-1)=bsSkinListBox1.Items[bsSkinListBox1.ItemIndex] then
|
|
|
exit;
|
|
|
end;
|
|
|
t_ch_dui_format.edit;
|
|
|
DBListBox1.Items.Add('0'+bsSkinListBox1.Items[bsSkinListBox1.ItemIndex]);
|
|
|
t_ch_dui_format.post;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_formatrpt.bsSkinButton10Click(Sender: TObject);
|
|
|
begin
|
|
|
{
|
|
|
if DBListBox1.ItemIndex=-1 then
|
|
|
exit;
|
|
|
t_ch_dui_format.edit;
|
|
|
DBListBox1.Items.Delete(DBListBox1.ItemIndex);
|
|
|
t_ch_dui_format.post;
|
|
|
}
|
|
|
if t_ch_dui_feename.IsEmpty then Exit;
|
|
|
t_ch_dui_feename.Delete;
|
|
|
// t_ch_dui_feename.Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_formatrpt.bsSkinButton11Click(Sender: TObject);
|
|
|
var
|
|
|
if_find:boolean;
|
|
|
i:integer;
|
|
|
aQuery:TADOQuery;
|
|
|
begin
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
try
|
|
|
with aQuery do begin
|
|
|
Close;SQL.Clear;
|
|
|
SQL.Add('Select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_ch_dui_feename where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+frm_data_share.t_code_fee.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+''' and DM_ID='+inttostr(t_ch_dui_format['DM_ID']));
|
|
|
Open;
|
|
|
if IsEmpty then begin
|
|
|
t_ch_dui_feename.Insert;
|
|
|
t_ch_dui_feename['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=frm_data_share.t_code_fee.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
t_ch_dui_feename.Post;
|
|
|
end;
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(aQuery);
|
|
|
end;
|
|
|
|
|
|
{
|
|
|
if t_ch_dui_format.IsEmpty then
|
|
|
exit;
|
|
|
if bsSkinListBox1.ItemIndex=-1 then
|
|
|
exit;
|
|
|
for i:=0 to DBListBox1.Items.Count-1 do
|
|
|
begin
|
|
|
if copy(DBListBox1.Items[i],2,length(DBListBox1.Items[i])-1)=frm_data_share.t_code_fee.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring then
|
|
|
exit;
|
|
|
end;
|
|
|
t_ch_dui_format.edit;
|
|
|
DBListBox1.Items.Add('1'+frm_data_share.t_code_fee.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
|
|
|
t_ch_dui_format.post;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_formatrpt.bsSkinButton7Click(Sender: TObject);
|
|
|
var
|
|
|
i:integer;
|
|
|
begin
|
|
|
if t_ch_dui_format.IsEmpty then
|
|
|
exit;
|
|
|
if DBListBox1.ItemIndex=-1 then
|
|
|
exit;
|
|
|
if DBListBox1.ItemIndex=0 then
|
|
|
exit;
|
|
|
|
|
|
t_ch_dui_format.edit;
|
|
|
i:=DBListBox1.ItemIndex-1;
|
|
|
DBListBox1.Items.Move(DBListBox1.ItemIndex,DBListBox1.ItemIndex-1);
|
|
|
t_ch_dui_format.post;
|
|
|
DBListBox1.ItemIndex:=i;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_formatrpt.bsSkinButton8Click(Sender: TObject);
|
|
|
var
|
|
|
i:integer;
|
|
|
begin
|
|
|
if t_ch_dui_format.IsEmpty then
|
|
|
exit;
|
|
|
if DBListBox1.ItemIndex=-1 then
|
|
|
exit;
|
|
|
if DBListBox1.ItemIndex=DBListBox1.Items.Count-1 then
|
|
|
exit;
|
|
|
|
|
|
t_ch_dui_format.edit;
|
|
|
i:=DBListBox1.ItemIndex+1;
|
|
|
DBListBox1.Items.Move(DBListBox1.ItemIndex,DBListBox1.ItemIndex+1);
|
|
|
t_ch_dui_format.post;
|
|
|
DBListBox1.ItemIndex:=i;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_formatrpt.t_ch_dui_formatAfterScroll(DataSet: TDataSet);
|
|
|
begin
|
|
|
DBListBox1.Items.Text:=t_ch_dui_format.fieldbyname('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_formatrpt.t_ch_dui_feefieldAfterInsert(
|
|
|
DataSet: TDataSet);
|
|
|
begin
|
|
|
t_ch_dui_feefield['DM_ID']:=t_ch_dui_format['DM_ID'];
|
|
|
t_ch_dui_feefield['Ӧ<><D3A6>USD']:=1;
|
|
|
t_ch_dui_feefield['Ӧ<><D3A6>RMB']:=1;
|
|
|
t_ch_dui_feefield['Ӧ<><D3A6>USD']:=1;
|
|
|
t_ch_dui_feefield['Ӧ<><D3A6>RMB']:=1;
|
|
|
t_ch_dui_feefield['Ӧ<>պϼ<D5BA>']:=1;
|
|
|
t_ch_dui_feefield['Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>']:=1;
|
|
|
t_ch_dui_feefield['<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>']:=1;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_formatrpt.t_ch_dui_feenameAfterInsert(
|
|
|
DataSet: TDataSet);
|
|
|
begin
|
|
|
t_ch_dui_feename['FF_ID']:=t_ch_dui_feefield['FF_ID'];
|
|
|
t_ch_dui_feename['DM_ID']:=t_ch_dui_feefield['DM_ID'];
|
|
|
t_ch_dui_feename['<27><><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD>']:=t_ch_dui_feefield['<27><><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD>'];
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_formatrpt.bsSkinButton9Click(Sender: TObject);
|
|
|
begin
|
|
|
t_ch_dui_feefield.Insert;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_formatrpt.bsSkinButton13Click(Sender: TObject);
|
|
|
begin
|
|
|
t_ch_dui_feefield.Delete;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_formatrpt.bsSkinButton14Click(Sender: TObject);
|
|
|
begin
|
|
|
t_ch_dui_feefield.Post;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_formatrpt.t_ch_dui_feefieldBeforeInsert(
|
|
|
DataSet: TDataSet);
|
|
|
begin
|
|
|
if t_ch_dui_format.IsEmpty then exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_dui_formatrpt.t_ch_dui_feenameBeforeInsert(
|
|
|
DataSet: TDataSet);
|
|
|
begin
|
|
|
if t_ch_dui_feefield.IsEmpty then exit;
|
|
|
end;
|
|
|
|
|
|
end.
|