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.
126 lines
3.8 KiB
Plaintext
126 lines
3.8 KiB
Plaintext
unit u_op_data_copy;
|
|
|
|
interface
|
|
|
|
uses
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
Dialogs, StdCtrls, wwdbdatetimepicker, bsSkinCtrls, BusinessSkinForm, DB,
|
|
Grids, DBGrids, ADODB;
|
|
|
|
type
|
|
Tfrm_op_data_copy = class(TForm)
|
|
Label1: TLabel;
|
|
bsBusinessSkinForm1: TbsBusinessSkinForm;
|
|
bsSkinButton1: TbsSkinButton;
|
|
bsSkinButton5: TbsSkinButton;
|
|
DataSource1: TDataSource;
|
|
bsSkinButton2: TbsSkinButton;
|
|
edt1: TEdit;
|
|
con1: TADOConnection;
|
|
QryBsCard: TADOQuery;
|
|
ds1: TDataSource;
|
|
dbgrd1: TDBGrid;
|
|
ADOQuery1: TADOQuery;
|
|
ADOQuery2: TADOQuery;
|
|
ADOQuery3: TADOQuery;
|
|
ADOQuery4: TADOQuery;
|
|
procedure bsSkinButton5Click(Sender: TObject);
|
|
procedure bsSkinButton1Click(Sender: TObject);
|
|
procedure bsSkinButton2Click(Sender: TObject);
|
|
private
|
|
{ Private declarations }
|
|
public
|
|
{ Public declarations }
|
|
end;
|
|
|
|
var
|
|
frm_op_data_copy: Tfrm_op_data_copy;
|
|
|
|
implementation
|
|
|
|
uses my_sys_function, u_data_share, u_main;
|
|
|
|
{$R *.dfm}
|
|
|
|
procedure Tfrm_op_data_copy.bsSkinButton5Click(Sender: TObject);
|
|
begin
|
|
close;
|
|
end;
|
|
|
|
procedure Tfrm_op_data_copy.bsSkinButton1Click(Sender: TObject);
|
|
var
|
|
i:Integer;
|
|
begin
|
|
if QryBsCard.IsEmpty then Exit;
|
|
ADOQuery3.Open;
|
|
ADOQuery4.Open;
|
|
frm_main.db.BeginTrans;
|
|
try
|
|
DataSource1.DataSet.edit;
|
|
for i:=0 to QryBsCard.Fields.Count-1 do
|
|
if (DataSource1.DataSet.FindField(QryBsCard.Fields[i].FieldName)<>nil) and (QryBsCard.Fields[i].FieldName<>'编号') and (QryBsCard.Fields[i].FieldName<>'主编号') and (QryBsCard.Fields[i].FieldName<>'业务编号') then
|
|
DataSource1.DataSet.FieldByName(QryBsCard.Fields[i].FieldName).Value:=QryBsCard.Fields[i].Value;
|
|
DataSource1.DataSet['财务']:=0;
|
|
DataSource1.DataSet['财务凭证']:='';
|
|
DataSource1.DataSet['拼箱类型']:='合票单票';
|
|
DataSource1.DataSet['已出号']:=0;
|
|
DataSource1.DataSet['已订舱']:=0;
|
|
DataSource1.DataSet['已放箱']:=0;
|
|
DataSource1.DataSet['已背箱']:=0;
|
|
DataSource1.DataSet['第三方付费']:='';
|
|
DataSource1.DataSet.post;
|
|
ADOQuery1.Close;
|
|
ADOQuery1.SQL.Clear;
|
|
ADOQuery1.SQL.Add('Select * from t_op_ctn where 编号='''+QryBsCard.fieldByName('编号').AsString+'''');
|
|
ADOQuery1.Open;
|
|
if not ADOQuery1.IsEmpty then begin
|
|
ADOQuery1.First;
|
|
while not ADOQuery1.Eof do begin
|
|
ADOQuery4.Insert;
|
|
for i:=0 to ADOQuery1.Fields.Count-1 do
|
|
if (ADOQuery4.FindField(ADOQuery1.Fields[i].FieldName)<>nil) and (ADOQuery1.Fields[i].FieldName<>'编号') and (ADOQuery1.Fields[i].FieldName<>'ctn_id') then
|
|
ADOQuery4.FieldByName(ADOQuery1.Fields[i].FieldName).Value:=ADOQuery1.Fields[i].Value;
|
|
ADOQuery4.FieldByName('编号').AsString:=DataSource1.DataSet.FieldByName('编号').AsString;
|
|
ADOQuery4.Post;
|
|
ADOQuery1.Next;
|
|
end;
|
|
end;
|
|
{
|
|
ADOQuery2.Close;
|
|
ADOQuery2.SQL.Clear;
|
|
ADOQuery2.SQL.Add('Select * from t_ch_fee where 编号='''+QryBsCard.fieldByName('编号').AsString+'''');
|
|
ADOQuery2.Open;
|
|
if not ADOQuery2.IsEmpty then begin
|
|
ADOQuery2.First;
|
|
while not ADOQuery2.Eof do begin
|
|
ADOQuery4.Insert;
|
|
for i:=0 to ADOQuery2.Fields.Count-1 do
|
|
if (ADOQuery4.FindField(ADOQuery2.Fields[i].FieldName)<>nil) and (ADOQuery2.Fields[i].FieldName<>'编号') and (ADOQuery2.Fields[i].FieldName<>'CH_ID') then
|
|
ADOQuery4.FieldByName(ADOQuery2.Fields[i].FieldName).Value:=ADOQuery2.Fields[i].Value;
|
|
ADOQuery4.FieldByName('编号').AsString:=DataSource1.DataSet.FieldByName('编号').AsString;
|
|
ADOQuery4['系统费用']:=0;
|
|
ADOQuery4['不开发票']:=0;
|
|
ADOQuery4.Post;
|
|
ADOQuery2.Next;
|
|
end;
|
|
end;
|
|
}
|
|
showmessage('引入成功!!');
|
|
frm_main.db.CommitTrans;
|
|
except
|
|
frm_main.db.RollbackTrans;
|
|
showmessage('引入失败!!');
|
|
end;
|
|
close;
|
|
end;
|
|
|
|
procedure Tfrm_op_data_copy.bsSkinButton2Click(Sender: TObject);
|
|
begin
|
|
QryBsCard.Close;
|
|
QryBsCard.SQL.Add('select * from t_op_seae where 业务编号='''+edt1.Text+'''');
|
|
QryBsCard.Open;
|
|
|
|
end;
|
|
|
|
end.
|