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.

261 lines
9.5 KiB
Plaintext

11 months ago
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;
Label3: TLabel;
Edit1: TEdit;
wwDBLookupCombo52: TwwDBLookupCombo;
Label124: TLabel;
Label145: TLabel;
wwDBLookupCombo17: TwwDBLookupCombo;
wwDBDateTimePicker17: TwwDBDateTimePicker;
Label197: TLabel;
Label25: TLabel;
wwDBDateTimePicker6: TwwDBDateTimePicker;
wwDBLookupCombo27: TwwDBLookupCombo;
Label176: TLabel;
RxDBLookupCombo48: TRxDBLookupCombo;
Label128: 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>') and (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString<>'<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>') 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);
frm_op_seae.t_op_seae['<27><><EFBFBD><EFBFBD>']:=wwDBLookupCombo49.Text;
frm_op_seae.t_op_seae['<27><><EFBFBD><EFBFBD>']:=DBEdit63.text;
if (trim(Edit1.Text)<>'') then
frm_op_seae.t_op_seae['<27>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD>κ<EFBFBD>']:=Edit1.text;
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(wwDBLookupCombo27.Text)<>'') then begin
frm_op_seae.t_op_seae['<27><><EFBFBD≯ۿ<CCB8>']:=wwDBLookupCombo27.Text;
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;
if (RxDBLookupCombo48.DisplayValues[0]<>'') then begin
frm_op_seae.t_op_seae['<27><><EFBFBD><EFBFBD><EFBFBD>˱<EFBFBD><CBB1><EFBFBD>']:=RxDBLookupCombo48.DisplayValues[0];
end;
end;
frm_op_seae.t_op_seae.Post;
{
sql.Add('Update t_op_seae set <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>,<2C><><EFBFBD><EFBFBD>=:vsl,<2C><><EFBFBD><EFBFBD>=:voy');
if (trim(Edit1.Text)<>'') then
sql.Add(',<2C>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD>κ<EFBFBD>=:voy2');
if (trim(wwDBLookupCombo52.Text)<>'') then begin
sql.Add(',ж<><D0B6><EFBFBD><EFBFBD>=:portdischarge');
sql.Add(',ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:portdischargeid');
end;
if (trim(wwDBLookupCombo17.Text)<>'') then begin
sql.Add(',Ŀ<>ĵ<EFBFBD>=:destination');
sql.Add(',Ŀ<>ĵش<C4B5><D8B4><EFBFBD>=:destinationid');
end;
if (trim(wwDBDateTimePicker6.Text)<>'') then begin
sql.Add(',<2C>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>=:closedocdate');
end;
if (trim(wwDBDateTimePicker17.Text)<>'') then begin
sql.Add(',<2C>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>=:closedate');
end;
sql.Add(' where <20><><EFBFBD><EFBFBD>='''+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+''' and ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><>ͨ<EFBFBD><CDA8>'' and <20><><EFBFBD><EFBFBD>״̬<>''<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>'' and <20><><EFBFBD><EFBFBD>״̬<>''<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>'' ');
Parameters.ParamByName('vsl').Value:=wwDBLookupCombo49.Text;
Parameters.ParamByName('voy').Value:=DBEdit63.text;
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker2.Date);
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker2.Date);
if (trim(Edit1.Text)<>'') then
Parameters.ParamByName('voy2').Value:=Edit1.text;
if (trim(wwDBLookupCombo52.Text)<>'') then begin
Parameters.ParamByName('portdischarge').Value:=wwDBLookupCombo52.Text;
if frm_data_share.t_code_disport.Locate('Ӣ<><D3A2><EFBFBD><EFBFBD>',wwDBLookupCombo52.text,[]) then
begin
Parameters.ParamByName('portdischargeid').Value:=frm_data_share.t_code_disport['EDI<44><49><EFBFBD><EFBFBD>'];
end else begin
Parameters.ParamByName('portdischargeid').Value:='';
end;
end;
if (trim(wwDBLookupCombo17.Text)<>'') then begin
Parameters.ParamByName('destination').Value:=wwDBLookupCombo17.Text;
if frm_data_share.t_code_disport.Locate('Ӣ<><D3A2><EFBFBD><EFBFBD>',wwDBLookupCombo17.text,[]) then
begin
Parameters.ParamByName('destinationid').Value:=frm_data_share.t_code_disport['EDI<44><49><EFBFBD><EFBFBD>'];
end else begin
Parameters.ParamByName('destinationid').Value:='';
end;
end;
if (trim(wwDBDateTimePicker6.Text)<>'') then begin
Parameters.ParamByName('closedocdate').Value:=wwDBDateTimePicker6.Text;
end;
if (trim(wwDBDateTimePicker17.Text)<>'') then begin
Parameters.ParamByName('closedate').Value:=wwDBDateTimePicker17.Text;
end;
ExecSQL;
}
Close;sql.Clear;
sql.Add('Update t_op_seae_assistant set <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>=:vsl,<2C><><EFBFBD><EFBFBD>=:voy');
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+'''');
Parameters.ParamByName('vsl').Value:=wwDBLookupCombo49.Text;
Parameters.ParamByName('voy').Value:=DBEdit63.text;
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker2.Date);
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;
if (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>˾').AsString='CMA') and ((frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString='<27>Ѷ<EFBFBD><D1B6><EFBFBD>') or (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString='<27>ѽ<EFBFBD><D1BD><EFBFBD>')
or (frm_op_seae.t_op_seae.FieldByName('ȷ<><C8B7>״̬').AsString='<27><>ȷ<EFBFBD><C8B7>')) and (frm_op_seae.t_op_seae.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString<>'<27><><EFBFBD>ĵ<EFBFBD>') THEN begin
dsstr:=frm_op_seae.CreateDjyStr;
PostUrl:=get_parameters_value(2121,'http://123.234.225.158:8901')+'/booking/ReceiveBookingData';
if (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>˾').asstring<>'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>') then begin
TDsDjyThread.create(PostUrl,dsstr,'');
InsertSysLog('<27>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',frm_op_seae.t_op_seae.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
end;
END;
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.