⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unit3.pas

📁 基于ACESS数据库的小型进销存管理软件。
💻 PAS
字号:
unit Unit3;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, DB, ADODB, FR_Class, FR_DSet, FR_DBSet;

type
  TForm3 = class(TForm)
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    Button5: TButton;
    Button6: TButton;
    Button7: TButton;
    ADOTable1: TADOTable;
    ADOQuery1: TADOQuery;
    frReport1: TfrReport;
    frDBDataSet1: TfrDBDataSet;
    Button8: TButton;
    BitBtn3: TBitBtn;
    BitBtn4: TBitBtn;
    Button2: TButton;
    Button3: TButton;
    Button1: TButton;
    Button9: TButton;
    ADOTable3: TADOTable;
    frReport2: TfrReport;
    frDBDataSet2: TfrDBDataSet;
    ADOTable2: TADOTable;
    ADOTable4: TADOTable;
    Button4: TButton;
    ADOTable5: TADOTable;
    ADOTable6: TADOTable;
    Button10: TButton;
    Button11: TButton;
    frReport3: TfrReport;
    frDBDataSet3: TfrDBDataSet;
    ADOTable7: TADOTable;
    procedure BitBtn1Click(Sender: TObject);
    procedure BitBtn2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
//    procedure Button3Click(Sender: TObject);
    procedure buttClick(Sender: TObject);
    procedure Button5Click(Sender: TObject);
    procedure Button6Click(Sender: TObject);
    procedure Button7Click(Sender: TObject);
    procedure Button8Click(Sender: TObject);
    procedure BitBtn3Click(Sender: TObject);
    procedure BitBtn4Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button9Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button10Click(Sender: TObject);
    procedure Button11Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form3: TForm3;

implementation

uses JXC, Unit2, Unit4, Unit1, Unit9, Unit10, Frm_Print, Unit11, Unit12,
  Unit7, Unit13,Unit14, Unit15;

{$R *.dfm}

procedure TForm3.BitBtn1Click(Sender: TObject);
 begin
 application.CreateForm(tform1,form1);
 form1.ShowModal;
 form1.ADOTable1.Active:=false;
 form1.adotable1.Active:=true;
 //form1.visible:=true;
 //form2.visible:=false;
end;

procedure TForm3.BitBtn2Click(Sender: TObject);
begin
application.CreateForm(tform2,form2);
form2.ShowModal;
form2.ADOTable1.Active:=false;
form2.ADOTable1.Active:=true;
//form2.visible:=true;
end;

procedure TForm3.Button1Click(Sender: TObject);
begin
application.CreateForm(tform14,form14);
form14.ShowModal;
//form4.Visible:=true;
end;

procedure TForm3.buttClick(Sender: TObject);
begin
application.CreateForm(tform8,form8);
form8.ShowModal;
end;

procedure TForm3.Button5Click(Sender: TObject);
begin
application.CreateForm(tform9,form9);
form9.ShowModal;
//form9.visible:=true;
end;

procedure TForm3.Button6Click(Sender: TObject);
begin
application.CreateForm(tform10,form10);
form10.ShowModal;
//form10.visible:=true;
end;

procedure TForm3.Button7Click(Sender: TObject);
var i:integer;
var c:string;
var str:string;
var d:string;
//var px:string;
begin
form3.Enabled:=false;
form3.Cursor:=crhourglass;
adotable1.Active:=false;
adotable1.Active:=true;
adotable2.Active:=false;
adotable2.active:=true;
adotable1.First;
if adotable2.RecordCount>0 then
begin
adotable2.First;
for i:=0 to adotable2.RecordCount-1 do
  begin
  adotable2.delete;
//adotable1.next;
  end;
  end;
//adotable2.Delete;
for i:=0 to adotable1.RecordCount-1 do
begin
c:=adotable1.fieldbyname('pm').asstring;
d:=' and PZ ='+''''+ c +'''';
with adoquery1 do
   begin
    adoquery1.Close;
    adoquery1.SQL.Clear;
    //px:='order by J';
    str:='select * from GY where '+'ID >=0'+d;
    //    time:=' and  ina between'+'#'+datetostr(startime.date)+'#'+'and '+'#'+datetostr(endtime.date)+'#';
  //  cd:=str+time+a;
    adoquery1.sql.add(str);
    adoquery1.Open;
    end;
 with adotable2 do
 begin
 if adotable2.Locate('pz',adotable1.fieldbyname('pm').asstring,[locaseinsensitive]) then
 begin
adotable2.edit;
adotable2.fieldbyname('bs').asstring:=adoquery1.fieldbyname('bs').asstring;
adotable2.fieldbyname('JC').asstring:=adoquery1.fieldbyname('jc').asstring;
adotable2.fieldbyname('JJ').asstring:=adoquery1.fieldbyname('JJ').asstring;
//adotable2.fieldbyname('pz').asstring:=adotable1.fieldbyname('pm').asstring;
adotable2.fieldbyname('J').asstring:=adoquery1.fieldbyname('j').asstring;
adotable2.fieldbyname('we').asfloat:=adotable1.fieldbyname('kcz').asfloat;
adotable2.fieldbyname('num').asinteger:=adotable1.fieldbyname('kcs').asinteger;
adotable2.Post;
end
else
begin
append;
adotable2.fieldbyname('bs').asstring:=adoquery1.fieldbyname('bs').asstring;
adotable2.fieldbyname('JC').asstring:=adoquery1.fieldbyname('jc').asstring;
adotable2.fieldbyname('JJ').asstring:=adoquery1.fieldbyname('JJ').asstring;
adotable2.fieldbyname('pz').asstring:=adotable1.fieldbyname('pm').asstring;
adotable2.fieldbyname('J').asstring:=adoquery1.fieldbyname('j').asstring;
adotable2.fieldbyname('we').asfloat:=adotable1.fieldbyname('kcz').asfloat;
adotable2.fieldbyname('num').asinteger:=adotable1.fieldbyname('kcs').asinteger;
adotable2.post;
end;
if adotable2.FieldByName('we').asfloat=0 then
begin
adotable2.Delete;
end;
adotable1.next;
end;
end;
form3.Cursor:=crDefault;
form3.Enabled:=true;
adotable1.Active:=false;
adotable2.Active:=false;
adoquery1.Active:=false;
adoquery1.Active:=true;
adotable1.Active:=true;
adotable2.Active:=true;
adotable2.IndexFieldNames:='PZ';
frReport1.LoadFromFile('print\107.frf');
frReport1.OnObjectClick:= nil;
frReport1.OnMouseOverObject:= nil;
frReport1.ModifyPrepared:=false;
frReport1.Preview:=FormPrint.frPreview1;
if frReport1.PrepareReport then
frReport1.ShowPreparedReport;
FormPrint.ShowModal;
adotable1.Active:=false;
adotable2.Active:=false;
end;
procedure TForm3.Button8Click(Sender: TObject);
begin
application.CreateForm(tform11,form11);
form11.ShowModal;
//form11.visible:=true;
end;

procedure TForm3.BitBtn3Click(Sender: TObject);
begin
application.CreateForm(tform12,form12);
form12.ShowModal;
end;

procedure TForm3.BitBtn4Click(Sender: TObject);
begin
Application.CreateForm(TForm7, Form7);
form7.ShowModal;
end;

procedure TForm3.Button2Click(Sender: TObject);
begin
application.CreateForm(tform13,form13);
form13.ShowModal;
end;

procedure TForm3.Button9Click(Sender: TObject);
begin
 adotable4.Active:=false;
 adotable4.Active:=true;
 adotable3.Active:=false;
 adotable3.Active:=true;
 frReport2.LoadFromFile('print\110.frf');
 frReport2.OnObjectClick:= nil;
 frReport2.OnMouseOverObject:= nil;
 frReport2.ModifyPrepared:=false;
 frReport2.Preview:=FormPrint.frPreview1;
 if frReport2.PrepareReport then
 frReport2.ShowPreparedReport;
 FormPrint.ShowModal;
end;

procedure TForm3.Button4Click(Sender: TObject);
var i:integer;
begin
for i:=0 to adotable6.RecordCount-1 do
begin
if adotable5.Locate('jhc',adotable6.fieldbyname('outb').asstring,[locaseinsensitive]) then
begin
end
else
begin
adotable5.Append;
adotable5.FieldByName('jhc').asstring:=adotable6.fieldbyname('outb').asstring;
adotable5.Post;
end;
adotable6.Next;
end;
showmessage('厂家统计完成');
end;

procedure TForm3.Button10Click(Sender: TObject);
begin
form15.visible:=true;
end;

procedure TForm3.Button11Click(Sender: TObject);
begin
 adotable7.Active:=false;
 adotable7.Active:=true;
 adotable4.Active:=false;
 adotable4.Active:=true;
 frReport2.LoadFromFile('print\111.frf');
 frReport2.OnObjectClick:= nil;
 frReport2.OnMouseOverObject:= nil;
 frReport2.ModifyPrepared:=false;
 frReport2.Preview:=FormPrint.frPreview1;
 if frReport2.PrepareReport then
 frReport2.ShowPreparedReport;
 FormPrint.ShowModal;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -