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.

312 lines
8.1 KiB
Plaintext

unit u_code_empty;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, bsSkinCtrls, dxExEdtr, dxCntner, dxTL, dxDBCtrl, dxDBGrid, DB,
ADODB, StdCtrls, BusinessSkinForm, Grids, DBGrids, ExtCtrls;
type
Tfrm_code_empty = class(TForm)
bsSkinPanel2: TbsSkinPanel;
bsSkinPanel3: TbsSkinPanel;
RadioGroup1: TbsSkinRadioGroup;
bsSkinButton15: TbsSkinButton;
bsSkinButton16: TbsSkinButton;
t_code_empty1: TDataSource;
t_code_empty: TADOQuery;
bsSkinNotebook1: TbsSkinNotebook;
ListBox1: TListBox;
ListBox2: TListBox;
ListBox3: TListBox;
ListBox4: TListBox;
bsBusinessSkinForm1: TbsBusinessSkinForm;
DBGrid1: TDBGrid;
bsSkinPanel1: TbsSkinPanel;
Label1: TLabel;
Edit1: TEdit;
bsSkinColorDialog1: TColorDialog;
t_sys_parameters_value: TADOQuery;
Panel1: TPanel;
ListBox5: TListBox;
Panel2: TPanel;
ListBox6: TListBox;
ListBox7: TListBox;
ListBox8: TListBox;
bsSkinPanel4: TbsSkinPanel;
ListBox9: TListBox;
procedure FormShow(Sender: TObject);
procedure RadioGroup1Click(Sender: TObject);
procedure bsSkinButton16Click(Sender: TObject);
procedure bsSkinButton15Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure Edit1DblClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frm_code_empty: Tfrm_code_empty;
implementation
uses u_main, u_data_share;
{$R *.dfm}
procedure Tfrm_code_empty.FormShow(Sender: TObject);
begin
t_code_empty.Parameters[0].value:='t_op_seae';
t_code_empty.open;
//
t_sys_parameters_value.open;
if t_sys_parameters_value.Locate('VL_ID',144,[]) then begin
Edit1.Color:=StringToColor(trim(t_sys_parameters_value['²ÎÊýÖµ']));
end;
RadioGroup1Click(nil);
end;
procedure Tfrm_code_empty.RadioGroup1Click(Sender: TObject);
var aAdoQuery:TAdoQuery;
begin
case RadioGroup1.ItemIndex of
0:
begin
t_code_empty.close;
t_code_empty.Parameters[0].value:='t_op_seae';
t_code_empty.open;
bsSkinNotebook1.PageIndex:=0;
end;
1:
begin
t_code_empty.close;
t_code_empty.Parameters[0].value:='t_op_seai';
t_code_empty.open;
bsSkinNotebook1.PageIndex:=1;
end;
2:
begin
t_code_empty.close;
t_code_empty.Parameters[0].value:='t_op_aire';
t_code_empty.open;
bsSkinNotebook1.PageIndex:=2;
end;
3:
begin
t_code_empty.close;
t_code_empty.Parameters[0].value:='t_op_airi';
t_code_empty.open;
bsSkinNotebook1.PageIndex:=3;
end;
4:
begin
t_code_empty.close;
t_code_empty.Parameters[0].value:='t_op_airtruck';
t_code_empty.open;
bsSkinNotebook1.PageIndex:=4;
end;
5:
begin
t_code_empty.close;
t_code_empty.Parameters[0].value:='t_op_railway';
t_code_empty.open;
bsSkinNotebook1.PageIndex:=5;
end;
6:
begin
t_code_empty.close;
t_code_empty.Parameters[0].value:='t_op_seae_order';
t_code_empty.open;
bsSkinNotebook1.PageIndex:=6;
end;
7:
begin
t_code_empty.close;
t_code_empty.Parameters[0].value:='t_op_sealocal';
t_code_empty.open;
bsSkinNotebook1.PageIndex:=7;
end;
8:
begin
t_code_empty.close;
t_code_empty.Parameters[0].value:='t_op_seae_edi';
t_code_empty.open;
bsSkinNotebook1.PageIndex:=8;
end;
end;
end;
procedure Tfrm_code_empty.bsSkinButton16Click(Sender: TObject);
begin
if not t_code_empty.IsEmpty then
t_code_empty.Delete;
end;
procedure Tfrm_code_empty.bsSkinButton15Click(Sender: TObject);
begin
case RadioGroup1.ItemIndex of
0:
begin
if ListBox1.ItemIndex=-1 then
begin
showmessage('ÇëÏÈÑ¡ÔñÒªÌíÈëµÄ×ֶΣ¡£¡');
exit;
end;
if not t_code_empty.Locate('×Ö¶ÎÃû³Æ',ListBox1.Items[ListBox1.ItemIndex],[])then
begin
t_code_empty.insert;
t_code_empty['×Ö¶ÎÃû³Æ']:=ListBox1.Items[ListBox1.ItemIndex];
t_code_empty['±í']:='t_op_seae';
t_code_empty.post;
end;
end;
1:
begin
if ListBox2.ItemIndex=-1 then
begin
showmessage('ÇëÏÈÑ¡ÔñÒªÌíÈëµÄ×ֶΣ¡£¡');
exit;
end;
if not t_code_empty.Locate('×Ö¶ÎÃû³Æ',ListBox2.Items[ListBox2.ItemIndex],[])then
begin
t_code_empty.insert;
t_code_empty['×Ö¶ÎÃû³Æ']:=ListBox2.Items[ListBox2.ItemIndex];
t_code_empty['±í']:='t_op_seai';
t_code_empty.post;
end;
end;
2:
begin
if ListBox3.ItemIndex=-1 then
begin
showmessage('ÇëÏÈÑ¡ÔñÒªÌíÈëµÄ×ֶΣ¡£¡');
exit;
end;
if not t_code_empty.Locate('×Ö¶ÎÃû³Æ',ListBox3.Items[ListBox3.ItemIndex],[])then
begin
t_code_empty.insert;
t_code_empty['×Ö¶ÎÃû³Æ']:=ListBox3.Items[ListBox3.ItemIndex];
t_code_empty['±í']:='t_op_aire';
t_code_empty.post;
end;
end;
3:
begin
if ListBox4.ItemIndex=-1 then
begin
showmessage('ÇëÏÈÑ¡ÔñÒªÌíÈëµÄ×ֶΣ¡£¡');
exit;
end;
if not t_code_empty.Locate('×Ö¶ÎÃû³Æ',ListBox4.Items[ListBox4.ItemIndex],[])then
begin
t_code_empty.insert;
t_code_empty['×Ö¶ÎÃû³Æ']:=ListBox4.Items[ListBox4.ItemIndex];
t_code_empty['±í']:='t_op_airi';
t_code_empty.post;
end;
end;
4:
begin
if ListBox5.ItemIndex=-1 then
begin
showmessage('ÇëÏÈÑ¡ÔñÒªÌíÈëµÄ×ֶΣ¡£¡');
exit;
end;
if not t_code_empty.Locate('×Ö¶ÎÃû³Æ',ListBox5.Items[ListBox5.ItemIndex],[])then
begin
t_code_empty.insert;
t_code_empty['×Ö¶ÎÃû³Æ']:=ListBox5.Items[ListBox5.ItemIndex];
t_code_empty['±í']:='t_op_airtruck';
t_code_empty.post;
end;
end;
5:
begin
if ListBox6.ItemIndex=-1 then
begin
showmessage('ÇëÏÈÑ¡ÔñÒªÌíÈëµÄ×ֶΣ¡£¡');
exit;
end;
if not t_code_empty.Locate('×Ö¶ÎÃû³Æ',ListBox6.Items[ListBox6.ItemIndex],[])then
begin
t_code_empty.insert;
t_code_empty['×Ö¶ÎÃû³Æ']:=ListBox6.Items[ListBox6.ItemIndex];
t_code_empty['±í']:='t_op_railway';
t_code_empty.post;
end;
end;
6:
begin
if ListBox7.ItemIndex=-1 then
begin
showmessage('ÇëÏÈÑ¡ÔñÒªÌíÈëµÄ×ֶΣ¡£¡');
exit;
end;
if not t_code_empty.Locate('×Ö¶ÎÃû³Æ',ListBox7.Items[ListBox7.ItemIndex],[])then
begin
t_code_empty.insert;
t_code_empty['×Ö¶ÎÃû³Æ']:=ListBox7.Items[ListBox7.ItemIndex];
t_code_empty['±í']:='t_op_seae_order';
t_code_empty.post;
end;
end;
7:
begin
if ListBox8.ItemIndex=-1 then
begin
showmessage('ÇëÏÈÑ¡ÔñÒªÌíÈëµÄ×ֶΣ¡£¡');
exit;
end;
if not t_code_empty.Locate('×Ö¶ÎÃû³Æ',ListBox8.Items[ListBox8.ItemIndex],[])then
begin
t_code_empty.insert;
t_code_empty['×Ö¶ÎÃû³Æ']:=ListBox8.Items[ListBox8.ItemIndex];
t_code_empty['±í']:='t_op_sealocal';
t_code_empty.post;
end;
end;
8:
begin
if ListBox9.ItemIndex=-1 then
begin
showmessage('ÇëÏÈÑ¡ÔñÒªÌíÈëµÄ×ֶΣ¡£¡');
exit;
end;
if not t_code_empty.Locate('×Ö¶ÎÃû³Æ',ListBox9.Items[ListBox9.ItemIndex],[])then
begin
t_code_empty.insert;
t_code_empty['×Ö¶ÎÃû³Æ']:=ListBox9.Items[ListBox9.ItemIndex];
t_code_empty['±í']:='t_op_seae_edi';
t_code_empty.post;
end;
end;
end;
end;
procedure Tfrm_code_empty.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
frm_data_share.t_code_empty.requery;
end;
procedure Tfrm_code_empty.Edit1DblClick(Sender: TObject);
begin
// StringToColor()
if bsSkinColorDialog1.Execute then
begin
if t_sys_parameters_value.Locate('VL_ID',144,[]) then begin
t_sys_parameters_value.edit;
t_sys_parameters_value['²ÎÊýÖµ']:=ColorToString(bsSkinColorDialog1.Color);
t_sys_parameters_value.post;
Edit1.Color:=StringToColor(trim(t_sys_parameters_value['²ÎÊýÖµ']));
end;
end;
end;
end.