unit u_op_seae_pladd; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, BusinessSkinForm, bsSkinCtrls, StdCtrls, wwdbdatetimepicker,ADODB,DB; type Tfrm_op_seae_pladd = class(TForm) bsBusinessSkinForm1: TbsBusinessSkinForm; bsSkinGroupBox1: TbsSkinGroupBox; bsSkinButton2: TbsSkinButton; data1: TDataSource; bsSkinButton3: TbsSkinButton; OpenDialog1: TOpenDialog; Edit1: TEdit; Label1: TLabel; procedure bsSkinButton2Click(Sender: TObject); procedure bsSkinButton3Click(Sender: TObject); procedure bsSkinButton4Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var frm_op_seae_pladd: Tfrm_op_seae_pladd; frm_op_seae_add_num:integer; implementation uses u_main, u_op_seae, my_sys_function, u_data_share; {$R *.dfm} procedure Tfrm_op_seae_pladd.bsSkinButton2Click(Sender: TObject); begin close; end; procedure Tfrm_op_seae_pladd.bsSkinButton4Click(Sender: TObject); begin close; end; procedure Tfrm_op_seae_pladd.bsSkinButton3Click(Sender: TObject); var afield : variant; i,z,numlength,oldmblInt: Integer; PNO,OrgBSNO,oldbsno,oldmblno,oldmblhead,oldmblnum,tmpstr,newmblnum:string; aQuery:TADOQuery; isnum:BOOL; begin if data1.DataSet.IsEmpty then begin showmessage('没有复制母体,不能复制新建!'); exit; end; oldbsno:=data1.DataSet.FieldByName('编号').AsString; oldmblno:=data1.DataSet.FieldByName('主提单号').AsString; isnum:=true; For i :=Length(oldmblno) downTo 1 do begin // tmpstr:=copy(oldmblno, i, 1); if isnum then begin if (oldmblno[i] in ['0','1','2','3','4','5','6','7','8','9']) then begin oldmblnum:=oldmblno[i]+oldmblnum; end else begin isnum:=false; oldmblhead:=oldmblno[i]+oldmblhead; end; end else begin oldmblhead:=oldmblno[i]+oldmblhead; end; end; numlength:=Length(oldmblnum); afield := vararraycreate([0,data1.DataSet.fieldcount-1],varvariant); for i := 0 to (data1.DataSet.fieldcount-1) do begin afield[i] :=data1.DataSet.fields[i].value ; end; if Length(oldmblnum)=0 then oldmblnum:='0'; oldmblInt:=StrToInt64(oldmblnum); for z:=1 to StrToInt(Edit1.Text) do begin oldmblInt:=oldmblInt+1; oldmblnum:=inttostr(oldmblInt); while (Length(oldmblnum)'' then begin EdiString.LoadFromFile(FileNames); NewEdiSEAE(EdiString,data1); end; finally FreeAndNil(EdiString); end; if frm_op_seae_add_num=1 then begin frm_op_seae.Notebook1.PageIndex:=1; frm_op_seae.bsSkinButton11.Caption:='返回列表'; end; if frm_op_seae_add_num=2 then begin frm_op_seae.Notebook1.PageIndex:=1; frm_op_seae.bsSkinButton11.Caption:='返回主票'; end; if frm_op_seae_add_num=3 then begin frm_op_seae.Notebook1.PageIndex:=1; frm_op_seae.bsSkinButton11.Caption:='返回主票'; frm_op_seae.t_op_seae2.Enabled:=false; frm_op_seae.t_op_seae2.DataSet:=frm_op_seae.t_op_seae_fen; frm_op_seae.t_op_seae2.Enabled:=true; end; close; end; } end.