|
|
|
|
unit u_op_vesselvoy_change;
|
|
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
|
|
Dialogs, StdCtrls, wwdbdatetimepicker, bsSkinCtrls, BusinessSkinForm, DB,ADODB,
|
|
|
|
|
Mask, DBCtrls, wwdblook, RxLookup;
|
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
Tfrm_op_vesselvoy_change = class(TForm)
|
|
|
|
|
Label1: TLabel;
|
|
|
|
|
bsBusinessSkinForm1: TbsBusinessSkinForm;
|
|
|
|
|
bsSkinButton1: TbsSkinButton;
|
|
|
|
|
bsSkinButton5: TbsSkinButton;
|
|
|
|
|
DataSource1: TDataSource;
|
|
|
|
|
wwDBLookupCombo49: TwwDBLookupCombo;
|
|
|
|
|
Label125: TLabel;
|
|
|
|
|
Label126: TLabel;
|
|
|
|
|
Button1: TButton;
|
|
|
|
|
Label2: TLabel;
|
|
|
|
|
wwDBDateTimePicker2: TwwDBDateTimePicker;
|
|
|
|
|
DBEdit63: TEdit;
|
|
|
|
|
wwDBLookupCombo52: TwwDBLookupCombo;
|
|
|
|
|
Label124: TLabel;
|
|
|
|
|
Label145: TLabel;
|
|
|
|
|
wwDBLookupCombo17: TwwDBLookupCombo;
|
|
|
|
|
wwDBDateTimePicker17: TwwDBDateTimePicker;
|
|
|
|
|
Label197: TLabel;
|
|
|
|
|
Label25: TLabel;
|
|
|
|
|
wwDBDateTimePicker6: TwwDBDateTimePicker;
|
|
|
|
|
RxDBLookupCombo61: TRxDBLookupCombo;
|
|
|
|
|
Label3: TLabel;
|
|
|
|
|
Memo1: TMemo;
|
|
|
|
|
Label4: TLabel;
|
|
|
|
|
procedure bsSkinButton5Click(Sender: TObject);
|
|
|
|
|
procedure bsSkinButton1Click(Sender: TObject);
|
|
|
|
|
procedure Button1Click(Sender: TObject);
|
|
|
|
|
private
|
|
|
|
|
{ Private declarations }
|
|
|
|
|
public
|
|
|
|
|
{ Public declarations }
|
|
|
|
|
BSTYPE:string;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
var
|
|
|
|
|
frm_op_vesselvoy_change: Tfrm_op_vesselvoy_change;
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
|
|
uses my_sys_function, u_op_seae_vessel, u_op_seae, u_data_share;
|
|
|
|
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_vesselvoy_change.bsSkinButton5Click(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
close;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_vesselvoy_change.bsSkinButton1Click(Sender: TObject);
|
|
|
|
|
var
|
|
|
|
|
aQuery:TAdoQuery;
|
|
|
|
|
i:Integer;
|
|
|
|
|
book1:Tbookmark;
|
|
|
|
|
dsstr,PostUrl:string;
|
|
|
|
|
begin
|
|
|
|
|
{
|
|
|
|
|
if wwDBLookupCombo49.text='' then
|
|
|
|
|
begin
|
|
|
|
|
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>µĴ<C2B5><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
if DBEdit63.text='' then
|
|
|
|
|
begin
|
|
|
|
|
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>µĺ<C2B5><C4BA>Σ<EFBFBD><CEA3><EFBFBD>');
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
}
|
|
|
|
|
try
|
|
|
|
|
frm_op_seae.t_op_seae.DisableControls;
|
|
|
|
|
aQuery:=createAdoQuery;
|
|
|
|
|
try
|
|
|
|
|
with aQuery do begin
|
|
|
|
|
for i:=0 to frm_op_seae.dxDBGrid1.SelectedCount-1 do
|
|
|
|
|
begin
|
|
|
|
|
frm_op_seae.t_op_seae.GotoBookmark(pointer(frm_op_seae.dxDBGrid1.selectedrows[i]));
|
|
|
|
|
// Close;sql.Clear;
|
|
|
|
|
frm_op_seae.t_op_seae.Edit;
|
|
|
|
|
|
|
|
|
|
if (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString<>'<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>') then begin
|
|
|
|
|
if (wwDBDateTimePicker2.Text<>'') then begin
|
|
|
|
|
frm_op_seae.t_op_seae['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker2.Date);
|
|
|
|
|
frm_op_seae.t_op_seae['<27><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>']:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker2.Date);
|
|
|
|
|
end;
|
|
|
|
|
if (trim(wwDBLookupCombo49.Text)<>'') then begin
|
|
|
|
|
frm_op_seae.t_op_seae['<27><><EFBFBD><EFBFBD>']:=wwDBLookupCombo49.Text;
|
|
|
|
|
end;
|
|
|
|
|
if (trim(DBEdit63.text)<>'') then begin
|
|
|
|
|
frm_op_seae.t_op_seae['<27><><EFBFBD><EFBFBD>']:=DBEdit63.text;
|
|
|
|
|
end;
|
|
|
|
|
if (trim(RxDBLookupCombo61.DisplayValue)<>'') then begin
|
|
|
|
|
frm_op_seae.t_op_seae['<27><><EFBFBD><EFBFBD>']:=RxDBLookupCombo61.DisplayValue;
|
|
|
|
|
end;
|
|
|
|
|
if (trim(Memo1.text)<>'') then begin
|
|
|
|
|
frm_op_seae.t_op_seae['<27><><EFBFBD>۶<EFBFBD><DBB6><EFBFBD>˵<EFBFBD><CBB5>']:=Memo1.text;
|
|
|
|
|
end;
|
|
|
|
|
if (trim(wwDBLookupCombo52.Text)<>'') then begin
|
|
|
|
|
frm_op_seae.t_op_seae['ж<><D0B6><EFBFBD><EFBFBD>']:=wwDBLookupCombo52.Text;
|
|
|
|
|
if frm_data_share.t_code_disport.Locate('Ӣ<><D3A2><EFBFBD><EFBFBD>',wwDBLookupCombo52.text,[]) then
|
|
|
|
|
begin
|
|
|
|
|
frm_op_seae.t_op_seae['ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=frm_data_share.t_code_disport['EDI<44><49><EFBFBD><EFBFBD>'];
|
|
|
|
|
end else begin
|
|
|
|
|
frm_op_seae.t_op_seae['ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='';
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
if (trim(wwDBLookupCombo17.Text)<>'') then begin
|
|
|
|
|
frm_op_seae.t_op_seae['Ŀ<>ĵ<EFBFBD>']:=wwDBLookupCombo17.Text;
|
|
|
|
|
if frm_data_share.t_code_disport.Locate('Ӣ<><D3A2><EFBFBD><EFBFBD>',wwDBLookupCombo17.text,[]) then
|
|
|
|
|
begin
|
|
|
|
|
frm_op_seae.t_op_seae['Ŀ<>ĵش<C4B5><D8B4><EFBFBD>']:=frm_data_share.t_code_disport['EDI<44><49><EFBFBD><EFBFBD>'];
|
|
|
|
|
end else begin
|
|
|
|
|
frm_op_seae.t_op_seae['Ŀ<>ĵش<C4B5><D8B4><EFBFBD>']:='';
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
if (trim(wwDBDateTimePicker6.Text)<>'') then begin
|
|
|
|
|
frm_op_seae.t_op_seae['<27>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>']:=wwDBDateTimePicker6.Text;
|
|
|
|
|
end;
|
|
|
|
|
if (trim(wwDBDateTimePicker17.Text)<>'') then begin
|
|
|
|
|
frm_op_seae.t_op_seae['<27>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>']:=wwDBDateTimePicker17.Text;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
frm_op_seae.t_op_seae.Post;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Close;sql.Clear;
|
|
|
|
|
sql.Add('Update t_op_seae_assistant set <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
|
|
if (wwDBDateTimePicker2.Text<>'') then begin
|
|
|
|
|
sql.Add(',<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
|
|
end;
|
|
|
|
|
if (trim(wwDBLookupCombo49.Text)<>'') then begin
|
|
|
|
|
sql.Add(',<2C><><EFBFBD><EFBFBD>=:vsl');
|
|
|
|
|
end;
|
|
|
|
|
if (trim(DBEdit63.text)<>'') then begin
|
|
|
|
|
sql.Add(',<2C><><EFBFBD><EFBFBD>=:voy');
|
|
|
|
|
end;
|
|
|
|
|
if (trim(wwDBLookupCombo52.Text)<>'') then begin
|
|
|
|
|
sql.Add(',ж<><D0B6><EFBFBD><EFBFBD>=:portdischarge');
|
|
|
|
|
end;
|
|
|
|
|
if (trim(wwDBLookupCombo17.Text)<>'') then begin
|
|
|
|
|
sql.Add(',Ŀ<>ĵ<EFBFBD>=:destination');
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sql.Add(' where <20><><EFBFBD><EFBFBD>='''+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+'''');
|
|
|
|
|
if (trim(wwDBLookupCombo49.Text)<>'') then begin
|
|
|
|
|
Parameters.ParamByName('vsl').Value:=wwDBLookupCombo49.Text;
|
|
|
|
|
end;
|
|
|
|
|
if (trim(DBEdit63.text)<>'') then begin
|
|
|
|
|
Parameters.ParamByName('voy').Value:=DBEdit63.text;
|
|
|
|
|
end;
|
|
|
|
|
if (wwDBDateTimePicker2.Text<>'') then begin
|
|
|
|
|
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker2.Date);
|
|
|
|
|
end;
|
|
|
|
|
if (trim(wwDBLookupCombo52.Text)<>'') then begin
|
|
|
|
|
Parameters.ParamByName('portdischarge').Value:=wwDBLookupCombo52.Text;
|
|
|
|
|
end;
|
|
|
|
|
if (trim(wwDBLookupCombo17.Text)<>'') then begin
|
|
|
|
|
Parameters.ParamByName('destination').Value:=wwDBLookupCombo17.Text;
|
|
|
|
|
end;
|
|
|
|
|
ExecSQL;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
FreeAndNil(aQuery);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
finally
|
|
|
|
|
frm_op_seae.t_op_seae.EnableControls;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
book1:=frm_op_seae.t_op_seae.GetBookmark;
|
|
|
|
|
frm_op_seae.t_op_seae.Refresh;
|
|
|
|
|
frm_op_seae.t_op_seae.GotoBookmark(book1);
|
|
|
|
|
|
|
|
|
|
showmessage('<27><><EFBFBD>ijɹ<C4B3><C9B9><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
|
|
close;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_vesselvoy_change.Button1Click(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
try
|
|
|
|
|
frm_op_seae_vessel:=tfrm_op_seae_vessel.Create (self);
|
|
|
|
|
frm_op_seae_vessel.v_vessel_voyage.open;
|
|
|
|
|
frm_op_seae_vessel.wwIncrementalSearch1.Text:=wwDBLookupCombo49.text;
|
|
|
|
|
op_seae_vessel_num:=4;
|
|
|
|
|
frm_op_seae_vessel.ShowModal;
|
|
|
|
|
finally
|
|
|
|
|
frm_op_seae_vessel.Free;
|
|
|
|
|
frm_op_seae_vessel:=nil;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end.
|