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.

430 lines
12 KiB
Plaintext

11 months ago
unit u_code_port_modify;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, Wwdbigrd, Wwdbgrid, bsSkinCtrls, ExtCtrls, dxExEdtr,
dxDBTLCl, dxGrClms, dxTL, dxDBCtrl, dxDBGrid, dxCntner, DB, ADODB,
StdCtrls, Mask, DBCtrls, RxLookup, wwdbedit, Wwdotdot, Wwdbcomb,
BusinessSkinForm;
type
Tfrm_code_port_modify = class(TForm)
bsSkinPanel1: TbsSkinPanel;
Panel1: TPanel;
bsSkinButton1: TbsSkinButton;
bsSkinButton2: TbsSkinButton;
bsSkinButton4: TbsSkinButton;
bsSkinButton3: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
Label2: TLabel;
DBEdit2: TDBEdit;
Label3: TLabel;
DBEdit3: TDBEdit;
Label4: TLabel;
Label5: TLabel;
RxDBLookupCombo3: TRxDBLookupCombo;
RxDBLookupCombo1: TRxDBLookupCombo;
Label6: TLabel;
DBEdit4: TDBEdit;
Label7: TLabel;
DBEdit5: TDBEdit;
Label8: TLabel;
wwDBComboBox1: TwwDBComboBox;
Label9: TLabel;
wwDBComboBox2: TwwDBComboBox;
Label10: TLabel;
DBEdit6: TDBEdit;
Label11: TLabel;
DBEdit7: TDBEdit;
bsBusinessSkinForm1: TbsBusinessSkinForm;
Label1: TLabel;
DBEdit1: TDBEdit;
Label12: TLabel;
DBEdit8: TDBEdit;
wwDBComboBox3: TwwDBComboBox;
Label13: TLabel;
Label14: TLabel;
wwDBComboBox4: TwwDBComboBox;
Label15: TLabel;
DBEdit9: TDBEdit;
bsSkinGroupBox1: TbsSkinGroupBox;
bsSkinPanel2: TbsSkinPanel;
bsSkinPanel3: TbsSkinPanel;
bsSkinPanel4: TbsSkinPanel;
bsSkinCheckRadioBox1: TbsSkinCheckRadioBox;
bsSkinCheckRadioBox2: TbsSkinCheckRadioBox;
bsSkinCheckRadioBox3: TbsSkinCheckRadioBox;
bsSkinCheckRadioBox4: TbsSkinCheckRadioBox;
bsSkinCheckRadioBox5: TbsSkinCheckRadioBox;
bsSkinCheckRadioBox6: TbsSkinCheckRadioBox;
bsSkinCheckRadioBox7: TbsSkinCheckRadioBox;
bsSkinCheckRadioBox8: TbsSkinCheckRadioBox;
bsSkinCheckRadioBox9: TbsSkinCheckRadioBox;
bsSkinGroupBox2: TbsSkinGroupBox;
DBMemo1: TDBMemo;
bsSkinButton7: TbsSkinButton;
bsSkinButton6: TbsSkinButton;
DBEdit10: TDBEdit;
bsSkinButton8: TbsSkinButton;
bsSkinButton9: TbsSkinButton;
Label16: TLabel;
DBEdit11: TDBEdit;
bsSkinButton10: TbsSkinButton;
7 months ago
DBEdit12: TDBEdit;
Label17: TLabel;
11 months ago
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure bsSkinButton5Click(Sender: TObject);
procedure bsSkinButton3Click(Sender: TObject);
procedure bsSkinButton2Click(Sender: TObject);
procedure bsSkinButton4Click(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure bsSkinButton7Click(Sender: TObject);
procedure bsSkinButton6Click(Sender: TObject);
procedure DBEdit10Change(Sender: TObject);
procedure RxDBLookupCombo1Change(Sender: TObject);
procedure bsSkinButton9Click(Sender: TObject);
procedure bsSkinButton8Click(Sender: TObject);
procedure bsSkinButton10Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frm_code_port_modify: Tfrm_code_port_modify;
implementation
uses u_main, u_code_port, u_data_share, my_sys_function;
{$R *.dfm}
procedure Tfrm_code_port_modify.FormCloseQuery(Sender: TObject;
var CanClose: Boolean);
begin
CanClose:=frm_close_query(frm_code_port.t_code_disport);
end;
procedure Tfrm_code_port_modify.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_code_port_modify.bsSkinButton3Click(Sender: TObject);
var
str:widestring;
begin
table_cancel(frm_code_port.t_code_disport);
begin
str:=frm_code_port.t_code_disport.fieldbyname('<27>ۿڹ<DBBF><DAB9><EFBFBD>').asstring;
bsSkinCheckRadioBox1.Checked:=false;
bsSkinCheckRadioBox2.Checked:=false;
bsSkinCheckRadioBox3.Checked:=false;
bsSkinCheckRadioBox4.Checked:=false;
bsSkinCheckRadioBox5.Checked:=false;
bsSkinCheckRadioBox6.Checked:=false;
bsSkinCheckRadioBox7.Checked:=false;
bsSkinCheckRadioBox8.Checked:=false;
bsSkinCheckRadioBox9.Checked:=false;
if pos('P',str)<>0 then
bsSkinCheckRadioBox1.Checked:=true;
if pos('Q',str)<>0 then
bsSkinCheckRadioBox2.Checked:=true;
if pos('Y',str)<>0 then
bsSkinCheckRadioBox3.Checked:=true;
if pos('G',str)<>0 then
bsSkinCheckRadioBox4.Checked:=true;
if pos('C',str)<>0 then
bsSkinCheckRadioBox5.Checked:=true;
if pos('R',str)<>0 then
bsSkinCheckRadioBox6.Checked:=true;
if pos('B',str)<>0 then
bsSkinCheckRadioBox7.Checked:=true;
if pos('T',str)<>0 then
bsSkinCheckRadioBox8.Checked:=true;
if pos('D',str)<>0 then
bsSkinCheckRadioBox9.Checked:=true;
end;
end;
procedure Tfrm_code_port_modify.bsSkinButton2Click(Sender: TObject);
var
str:string;
begin
if frm_code_port.t_code_disport.IsEmpty then
exit;
if bsSkinCheckRadioBox1.Checked then
str:='P';
if bsSkinCheckRadioBox2.Checked then
begin
if str=''then
str:='Q'
else
str:=str+'<27><>'+'Q';
end;
if bsSkinCheckRadioBox3.Checked then
begin
if str=''then
str:='Y'
else
str:=str+'<27><>'+'Y';
end;
if bsSkinCheckRadioBox4.Checked then
begin
if str=''then
str:='G'
else
str:=str+'<27><>'+'G';
end;
if bsSkinCheckRadioBox5.Checked then
begin
if str=''then
str:='C'
else
str:=str+'<27><>'+'C';
end;
if bsSkinCheckRadioBox6.Checked then
begin
if str=''then
str:='R'
else
str:=str+'<27><>'+'R';
end;
if bsSkinCheckRadioBox7.Checked then
begin
if str=''then
str:='B'
else
str:=str+'<27><>'+'B';
end;
if bsSkinCheckRadioBox8.Checked then
begin
if str=''then
str:='T'
else
str:=str+'<27><>'+'T';
end;
if bsSkinCheckRadioBox9.Checked then
begin
if str=''then
str:='D'
else
str:=str+'<27><>'+'D';
end;
if str<>''then
str:='('+str+')';
frm_code_port.t_code_disport.edit;
frm_code_port.t_code_disport['<27>ۿڹ<DBBF><DAB9><EFBFBD>']:=str;
frm_code_port.t_code_disport.post;
end;
procedure Tfrm_code_port_modify.bsSkinButton4Click(Sender: TObject);
begin
table_delete(frm_code_port.t_code_disport);
end;
procedure Tfrm_code_port_modify.bsSkinButton1Click(Sender: TObject);
begin
frm_code_port.t_code_disport.Insert;
bsSkinCheckRadioBox1.Checked:=false;
bsSkinCheckRadioBox2.Checked:=false;
bsSkinCheckRadioBox3.Checked:=false;
bsSkinCheckRadioBox4.Checked:=false;
bsSkinCheckRadioBox5.Checked:=false;
bsSkinCheckRadioBox6.Checked:=false;
bsSkinCheckRadioBox7.Checked:=false;
bsSkinCheckRadioBox8.Checked:=false;
bsSkinCheckRadioBox9.Checked:=false;
end;
procedure Tfrm_code_port_modify.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
frm_data_share.t_code_disport.requery;
end;
procedure Tfrm_code_port_modify.bsSkinButton7Click(Sender: TObject);
begin
table_Prior(frm_code_port.t_code_disport);
end;
procedure Tfrm_code_port_modify.bsSkinButton6Click(Sender: TObject);
begin
table_Next(frm_code_port.t_code_disport);
end;
procedure Tfrm_code_port_modify.DBEdit10Change(Sender: TObject);
var
str:widestring;
begin
begin
str:=frm_code_port.t_code_disport.fieldbyname('<27>ۿڹ<DBBF><DAB9><EFBFBD>').asstring;
bsSkinCheckRadioBox1.Checked:=false;
bsSkinCheckRadioBox2.Checked:=false;
bsSkinCheckRadioBox3.Checked:=false;
bsSkinCheckRadioBox4.Checked:=false;
bsSkinCheckRadioBox5.Checked:=false;
bsSkinCheckRadioBox6.Checked:=false;
bsSkinCheckRadioBox7.Checked:=false;
bsSkinCheckRadioBox8.Checked:=false;
bsSkinCheckRadioBox9.Checked:=false;
if pos('P',str)<>0 then
bsSkinCheckRadioBox1.Checked:=true;
if pos('Q',str)<>0 then
bsSkinCheckRadioBox2.Checked:=true;
if pos('Y',str)<>0 then
bsSkinCheckRadioBox3.Checked:=true;
if pos('G',str)<>0 then
bsSkinCheckRadioBox4.Checked:=true;
if pos('C',str)<>0 then
bsSkinCheckRadioBox5.Checked:=true;
if pos('R',str)<>0 then
bsSkinCheckRadioBox6.Checked:=true;
if pos('B',str)<>0 then
bsSkinCheckRadioBox7.Checked:=true;
if pos('T',str)<>0 then
bsSkinCheckRadioBox8.Checked:=true;
if pos('D',str)<>0 then
bsSkinCheckRadioBox9.Checked:=true;
end;
end;
procedure Tfrm_code_port_modify.RxDBLookupCombo1Change(Sender: TObject);
begin
if(frm_code_port.t_code_disport.state=dsinsert)
or(frm_code_port.t_code_disport.state=dsedit)then
begin
if RxDBLookupCombo1.DisplayValue<>''then
begin
if frm_data_share.t_code_country.Locate('<27><><EFBFBD><EFBFBD>',RxDBLookupCombo1.DisplayValues[0],[])then
begin
frm_code_port.t_code_disport['<27><><EFBFBD><EFBFBD>']:=frm_data_share.t_code_country['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
frm_code_port.t_code_disport['<27><>']:=frm_data_share.t_code_country['<27><>'];
end;
end;
end;
end;
procedure Tfrm_code_port_modify.bsSkinButton9Click(Sender: TObject);
begin
if frm_code_port.t_code_disport.IsEmpty then
exit;
frm_code_port.t_code_disport.edit;
frm_code_port.t_code_disport['<27>ۿ<EFBFBD>ȫ<EFBFBD><C8AB>']:=frm_code_port.t_code_disport['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']
+'('+frm_code_port.t_code_disport['Ӣ<><D3A2><EFBFBD><EFBFBD>']+')';
end;
procedure Tfrm_code_port_modify.bsSkinButton8Click(Sender: TObject);
var
str_list:Tstringlist;
i:integer;
begin
if frm_code_port.t_code_disport.IsEmpty then
exit;
str_list:=Tstringlist.create;
str_list.Add('<27><>Ӣ <20><> <20><><EFBFBD><EFBFBD>'+frm_code_port.t_code_disport.fieldbyname('Ӣ<><D3A2><EFBFBD><EFBFBD>').asstring);
str_list.Add('<27><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>'+frm_code_port.t_code_disport.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
str_list.Add('<27><>λ <20>á<EFBFBD>'+frm_code_port.t_code_disport.fieldbyname('γ<><CEB3>_1').asstring
+'<27><>'+frm_code_port.t_code_disport.fieldbyname('γ<><CEB3>_2').asstring+''''
+frm_code_port.t_code_disport.fieldbyname('γ<><CEB3>').asstring+' '
+frm_code_port.t_code_disport.fieldbyname('<27><><EFBFBD><EFBFBD>_1').asstring
+'<27><>'+frm_code_port.t_code_disport.fieldbyname('<27><><EFBFBD><EFBFBD>_2').asstring+''''
+frm_code_port.t_code_disport.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
str_list.Add('<27><><EFBFBD><EFBFBD> <20>͡<EFBFBD>'+frm_code_port.t_code_disport.fieldbyname('<27>ۿ<EFBFBD><DBBF><EFBFBD><EFBFBD><EFBFBD>').asstring);
str_list.Add('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͻ<EFBFBD><CFBD><EFBFBD><EFBFBD>'+frm_code_port.t_code_disport.fieldbyname('<27><>').asstring
+'-'+frm_code_port.t_code_disport.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
str_list.Add('<27><><EFBFBD>ۿڹ<DBBF><DAB9>ܡ<EFBFBD>');
i:=1;
if bsSkinCheckRadioBox1.Checked then
begin
str_list.Add(inttostr(i)+'. '+bsSkinCheckRadioBox1.Caption);
i:=i+1;
end;
if bsSkinCheckRadioBox2.Checked then
begin
str_list.Add(inttostr(i)+'. '+bsSkinCheckRadioBox2.Caption);
i:=i+1;
end;
if bsSkinCheckRadioBox3.Checked then
begin
str_list.Add(inttostr(i)+'. '+bsSkinCheckRadioBox3.Caption);
i:=i+1;
end;
if bsSkinCheckRadioBox4.Checked then
begin
str_list.Add(inttostr(i)+'. '+bsSkinCheckRadioBox4.Caption);
i:=i+1;
end;
if bsSkinCheckRadioBox5.Checked then
begin
str_list.Add(inttostr(i)+'. '+bsSkinCheckRadioBox5.Caption);
i:=i+1;
end;
if bsSkinCheckRadioBox6.Checked then
begin
str_list.Add(inttostr(i)+'. '+bsSkinCheckRadioBox6.Caption);
i:=i+1;
end;
if bsSkinCheckRadioBox7.Checked then
begin
str_list.Add(inttostr(i)+'. '+bsSkinCheckRadioBox7.Caption);
i:=i+1;
end;
if bsSkinCheckRadioBox8.Checked then
begin
str_list.Add(inttostr(i)+'. '+bsSkinCheckRadioBox8.Caption);
i:=i+1;
end;
if bsSkinCheckRadioBox9.Checked then
begin
str_list.Add(inttostr(i)+'. '+bsSkinCheckRadioBox9.Caption);
i:=i+1;
end;
str_list.Add(' ');
str_list.Add('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
frm_code_port.t_code_disport.edit;
frm_code_port.t_code_disport['<27>ۿ<EFBFBD><DBBF><EFBFBD><EFBFBD><EFBFBD>']:=str_list.text;
str_list.free;
end;
procedure Tfrm_code_port_modify.bsSkinButton10Click(Sender: TObject);
var ASqlQuery:TAdoQuery;
begin
if frm_code_port.t_code_disport['EDI<44><49><EFBFBD><EFBFBD>']='' then begin
ShowMessage('EDI<44><49><EFBFBD><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>');
exit;
end;
ASqlQuery:=CreateAdoQuery;
with ASqlQuery do
try
Close;sql.clear;
sql.add('select * from t_code_edi_port');
sql.add('where edi<64><69><EFBFBD><EFBFBD>=:EDINO');
Parameters.ParamByName('EDINO').Value:=frm_code_port.t_code_disport['EDI<44><49><EFBFBD><EFBFBD>'];
open;
if IsEmpty then
begin
Insert;
fieldbyname('EDI<44><49><EFBFBD><EFBFBD>').value:=frm_code_port.t_code_disport['EDI<44><49><EFBFBD><EFBFBD>'];
fieldbyname('<27>ۿ<EFBFBD><DBBF><EFBFBD><EFBFBD><EFBFBD>').value:=frm_code_port.t_code_disport['Ӣ<><D3A2><EFBFBD><EFBFBD>'];
post;
end else
begin
Edit;
fieldbyname('EDI<44><49><EFBFBD><EFBFBD>').value:=frm_code_port.t_code_disport['EDI<44><49><EFBFBD><EFBFBD>'];
fieldbyname('<27>ۿ<EFBFBD><DBBF><EFBFBD><EFBFBD><EFBFBD>').value:=frm_code_port.t_code_disport['Ӣ<><D3A2><EFBFBD><EFBFBD>'];
post;
end;
finally
FreeAndNil(ASqlQuery);
end;
end;
end.