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

11 months ago
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<>'<27><><EFBFBD><EFBFBD>') and (QryBsCard.Fields[i].FieldName<>'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>') and (QryBsCard.Fields[i].FieldName<>'ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>') then
DataSource1.DataSet.FieldByName(QryBsCard.Fields[i].FieldName).Value:=QryBsCard.Fields[i].Value;
DataSource1.DataSet['<27><><EFBFBD><EFBFBD>']:=0;
DataSource1.DataSet['<27><><EFBFBD><EFBFBD>ƾ֤']:='';
DataSource1.DataSet['ƴ<><C6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='<27><>Ʊ<EFBFBD><C6B1>Ʊ';
DataSource1.DataSet['<27>ѳ<EFBFBD><D1B3><EFBFBD>']:=0;
DataSource1.DataSet['<27>Ѷ<EFBFBD><D1B6><EFBFBD>']:=0;
DataSource1.DataSet['<27>ѷ<EFBFBD><D1B7><EFBFBD>']:=0;
DataSource1.DataSet['<27>ѱ<EFBFBD><D1B1><EFBFBD>']:=0;
DataSource1.DataSet['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='';
DataSource1.DataSet.post;
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('Select * from t_op_ctn where <20><><EFBFBD><EFBFBD>='''+QryBsCard.fieldByName('<27><><EFBFBD><EFBFBD>').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<>'<27><><EFBFBD><EFBFBD>') and (ADOQuery1.Fields[i].FieldName<>'ctn_id') then
ADOQuery4.FieldByName(ADOQuery1.Fields[i].FieldName).Value:=ADOQuery1.Fields[i].Value;
ADOQuery4.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=DataSource1.DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
ADOQuery4.Post;
ADOQuery1.Next;
end;
end;
{
ADOQuery2.Close;
ADOQuery2.SQL.Clear;
ADOQuery2.SQL.Add('Select * from t_ch_fee where <20><><EFBFBD><EFBFBD>='''+QryBsCard.fieldByName('<27><><EFBFBD><EFBFBD>').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<>'<27><><EFBFBD><EFBFBD>') and (ADOQuery2.Fields[i].FieldName<>'CH_ID') then
ADOQuery4.FieldByName(ADOQuery2.Fields[i].FieldName).Value:=ADOQuery2.Fields[i].Value;
ADOQuery4.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=DataSource1.DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
ADOQuery4['ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD>']:=0;
ADOQuery4['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ']:=0;
ADOQuery4.Post;
ADOQuery2.Next;
end;
end;
}
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>');
frm_main.db.CommitTrans;
except
frm_main.db.RollbackTrans;
showmessage('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD>');
end;
close;
end;
procedure Tfrm_op_data_copy.bsSkinButton2Click(Sender: TObject);
begin
QryBsCard.Close;
QryBsCard.SQL.Add('select * from t_op_seae where ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+edt1.Text+'''');
QryBsCard.Open;
end;
end.