unit u_op_seae_vessel; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, BusinessSkinForm, DB, ADODB, dxExEdtr, dxCntner, dxTL, dxDBCtrl, dxDBGrid, dxDBTLCl, dxGrClms, StdCtrls, Mask, DBCtrls, bsSkinCtrls, Wwkeycb; type Tfrm_op_seae_vessel = class(TForm) bsBusinessSkinForm1: TbsBusinessSkinForm; v_vessel_voyage: TADOQuery; v_vessel_voyage1: TDataSource; dxDBGrid1: TdxDBGrid; dxDBGrid1Column1: TdxDBGridMaskColumn; dxDBGrid1Column2: TdxDBGridMaskColumn; dxDBGrid1Column3: TdxDBGridMaskColumn; dxDBGrid1Column4: TdxDBGridMaskColumn; dxDBGrid1Column5: TdxDBGridMaskColumn; dxDBGrid1Column6: TdxDBGridMaskColumn; dxDBGrid1Column7: TdxDBGridMaskColumn; dxDBGrid1Column8: TdxDBGridDateColumn; dxDBGrid1Column9: TdxDBGridDateColumn; dxDBGrid1Column10: TdxDBGridDateColumn; v_vessel_voyageDSDesigner: TStringField; v_vessel_voyageDSDesigner2: TStringField; v_vessel_voyageDSDesigner3: TStringField; v_vessel_voyageDSDesigner4: TStringField; v_vessel_voyageDSDesigner5: TStringField; v_vessel_voyageDSDesigner6: TStringField; v_vessel_voyageDSDesigner7: TStringField; v_vessel_voyageDSDesigner8: TDateTimeField; v_vessel_voyageDSDesigner9: TDateTimeField; v_vessel_voyageDSDesigner10: TDateTimeField; bsSkinPanel1: TbsSkinPanel; Label1: TLabel; DBEdit1: TDBEdit; Label2: TLabel; DBEdit2: TDBEdit; DBEdit3: TDBEdit; Label3: TLabel; Label4: TLabel; DBEdit4: TDBEdit; DBEdit5: TDBEdit; Label5: TLabel; DBEdit6: TDBEdit; Label6: TLabel; DBEdit7: TDBEdit; Label7: TLabel; Label8: TLabel; DBEdit8: TDBEdit; Label9: TLabel; DBEdit9: TDBEdit; Label10: TLabel; DBEdit10: TDBEdit; bsSkinPanel2: TbsSkinPanel; bsSkinButton2: TbsSkinButton; bsSkinButton5: TbsSkinButton; Label11: TLabel; wwIncrementalSearch1: TwwIncrementalSearch; dxDBGrid1Column11: TdxDBGridColumn; v_vessel_voyageDSDesigner11: TDateTimeField; procedure bsSkinButton5Click(Sender: TObject); procedure wwIncrementalSearch1KeyPress(Sender: TObject; var Key: Char); procedure bsSkinButton2Click(Sender: TObject); procedure bsSkinButton2KeyPress(Sender: TObject; var Key: Char); procedure FormShow(Sender: TObject); procedure dxDBGrid1ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); private { Private declarations } public { Public declarations } end; var frm_op_seae_vessel: Tfrm_op_seae_vessel; op_seae_vessel_num:integer; implementation uses u_main, u_op_seae, u_op_seae_vessel_change, my_sys_function; {$R *.dfm} procedure Tfrm_op_seae_vessel.bsSkinButton5Click(Sender: TObject); begin close; end; procedure Tfrm_op_seae_vessel.wwIncrementalSearch1KeyPress(Sender: TObject; var Key: Char); begin if key=#13 then begin key:=#0; frm_op_seae_vessel.bsSkinButton2Click(Sender); end; if key=#27 then close; end; procedure Tfrm_op_seae_vessel.bsSkinButton2Click(Sender: TObject); begin if v_vessel_voyage.IsEmpty then exit; case op_seae_vessel_num of 1: begin if (frm_op_seae.t_op_seae2.DataSet.State<>dsinsert) or (frm_op_seae.t_op_seae2.DataSet.State<>dsedit) then frm_op_seae.t_op_seae2.DataSet.edit; frm_op_seae.t_op_seae2.DataSet['船名']:=v_vessel_voyage['英文船名']; if v_vessel_voyage.fieldbyname('船公司').asstring<>''then frm_op_seae.t_op_seae2.DataSet['船公司']:=v_vessel_voyage['船公司']; frm_op_seae.t_op_seae2.DataSet['航次']:=v_vessel_voyage['航次']; if v_vessel_voyage.fieldbyname('装货港').asstring<>''then begin frm_op_seae.t_op_seae2.DataSet['起运港']:=v_vessel_voyage['装货港']; frm_op_seae.t_op_seae2.DataSet['装货港']:=v_vessel_voyage['装货港']; end; if v_vessel_voyage.fieldbyname('卸货港').asstring<>''then frm_op_seae.t_op_seae2.DataSet['卸货港']:=v_vessel_voyage['卸货港']; if v_vessel_voyage.fieldbyname('开船日期').asstring<>''then frm_op_seae.t_op_seae2.DataSet['开船日期']:=v_vessel_voyage['开船日期']; if v_vessel_voyage.fieldbyname('截港日期').asstring<>''then frm_op_seae.t_op_seae2.DataSet['截港日期']:=v_vessel_voyage['截港日期']; if v_vessel_voyage.fieldbyname('预抵日期').asstring<>''then frm_op_seae.t_op_seae2.DataSet['预抵日期']:=v_vessel_voyage['预抵日期']; { if v_vessel_voyage.fieldbyname('截单日期').asstring<>''then frm_op_seae.t_op_seae2.DataSet['截单日期']:=v_vessel_voyage['截单日期']; } if v_vessel_voyage.fieldbyname('航线').asstring<>''then frm_op_seae.t_op_seae2.DataSet['航线']:=v_vessel_voyage['航线']; // frm_op_seae.t_op_seae2.DataSet.post; end; 2: begin frm_op_seae_vessel_change.t_op_seae_vessel.edit; frm_op_seae_vessel_change.t_op_seae_vessel['旧船名']:=v_vessel_voyage['英文船名']; frm_op_seae_vessel_change.t_op_seae_vessel['旧航次']:=v_vessel_voyage['航次']; if v_vessel_voyage.fieldbyname('开船日期').asstring<>''then frm_op_seae_vessel_change.t_op_seae_vessel['旧开船日期']:=v_vessel_voyage['开船日期']; if v_vessel_voyage.fieldbyname('截港日期').asstring<>''then frm_op_seae_vessel_change.t_op_seae_vessel['旧截港日期']:=v_vessel_voyage['截港日期']; end; 3: begin frm_op_seae_vessel_change.t_op_seae_vessel.edit; frm_op_seae_vessel_change.t_op_seae_vessel['新船名']:=v_vessel_voyage['英文船名']; frm_op_seae_vessel_change.t_op_seae_vessel['新航次']:=v_vessel_voyage['航次']; if v_vessel_voyage.fieldbyname('开船日期').asstring<>''then frm_op_seae_vessel_change.t_op_seae_vessel['新开船日期']:=v_vessel_voyage['开船日期']; if v_vessel_voyage.fieldbyname('截港日期').asstring<>''then frm_op_seae_vessel_change.t_op_seae_vessel['新截港日期']:=v_vessel_voyage['截港日期']; end; end; close; end; procedure Tfrm_op_seae_vessel.bsSkinButton2KeyPress(Sender: TObject; var Key: Char); begin if key=#27 then close; end; procedure Tfrm_op_seae_vessel.FormShow(Sender: TObject); begin v_vessel_voyage.Locate('英文船名',wwIncrementalSearch1.text,[]); end; procedure Tfrm_op_seae_vessel.dxDBGrid1ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); begin Column_sort(Column,v_vessel_voyage,'英文船名'); end; end.