📄 pfm_updatefdspxx.pas
字号:
unit pfm_updatefdspxx;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
DBTables, Db, StdCtrls, Buttons, pvar_lib;
type
Tfm_updatefdspxx = class(TForm)
BatMove1: TBatchMove;
Query1: TQuery;
Table1: TTable;
GroupBox1: TGroupBox;
BBtnSpxx: TBitBtn;
Memo1: TMemo;
BBtnSomespxx: TBitBtn;
BitBtn1: TBitBtn;
procedure BBtnSpxxClick(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure BBtnSomespxxClick(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
fm_updatefdspxx: Tfm_updatefdspxx;
implementation
uses pfm_updatespxx;
{$R *.DFM}
procedure Tfm_updatefdspxx.BBtnSpxxClick(Sender: TObject);
begin
if application.messagebox(pchar('导出商品明细表所有的记录将花一定的时间,确定要导出?'),
pchar('警告!'),MB_OKCANCEL)<>IDOK then
begin
exit;
end;
memo1.Lines.add('导出商品明细表所有的记录......');
if fileexists('comdata\spmx\spmx.db') then
begin
deletefile('comdata\spmx\spmx.db');
end;
with BatMove1.Mappings do
begin
add('spbm=spbm');
add('sptxm=sptxm');
add('spmc=spmc');
add('baozhuangdw=baozhuangdw');
add('ggxh=ggxh');
add('wsdj=wsdj');
add('yhl=yhl');
end;
query1.databasename:='posdb';
query1.sql.Clear;
query1.sql.Add('select * from t_spxx');
batMove1.mode:=batCopy;
batMove1.source:=query1;
batmove1.destination:=table1;
table1.Tablename:='comdata\spmx\spmx.db';
batMove1.Execute;
memo1.Lines.add('导出完毕,共导出商品明细表记录'+
inttostr(batMove1.movedcount)+'条');
AddOptRecord('导出商品明细表');
end;
procedure Tfm_updatefdspxx.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
Action:=CaFree;
end;
procedure Tfm_updatefdspxx.BBtnSomespxxClick(Sender: TObject);
begin
if application.messagebox(pchar('导出商品明细表所有的记录将花一定的时间,确定要导出?'),
pchar('警告!'),MB_OKCANCEL)<>IDOK then
begin
exit;
end;
memo1.Lines.add('导出商品明细表所有的记录......');
if fileexists('comdata\spmx\updatespmx.db') then
begin
deletefile('comdata\spmx\updatespmx.db');
end;
with BatMove1.Mappings do
begin
add('spbm=spbm');
add('sptxm=sptxm');
add('spmc=spmc');
add('baozhuangdw=baozhuangdw');
add('ggxh=ggxh');
add('wsdj=wsdj');
add('yhl=yhl');
end;
query1.databasename:='posdb';
query1.sql.Clear;
query1.sql.Add('select * from t_spxx where spbm in (select spbm from tab_updatespmx)');
batMove1.mode:=batCopy;
batMove1.source:=query1;
batmove1.destination:=table1;
table1.Tablename:='comdata\spmx\updatespmx.db';
batMove1.Execute;
memo1.Lines.add('导出完毕,共导出商品明细表记录'+
inttostr(batMove1.movedcount)+'条');
query1.SQL.clear;
query1.sql.Add('delete from tab_updatespmx');
query1.ExecSQL;
AddOptRecord('导出用于更新的部分商品明细表');
end;
procedure Tfm_updatefdspxx.BitBtn1Click(Sender: TObject);
begin
Application.CreateForm(Tfm_updatespxx, fm_updatespxx);
fm_updatespxx.showmodal;
fm_updatespxx.free;
AddOptRecord('编辑用于更新的部分商品明细表');
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -