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

📄 printpart.~pas

📁 进销存源码,这是一个可移植企业的进销存系统,大家可以参考一下做法
💻 ~PAS
字号:
unit PrintPart;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ExtCtrls;

type
  TPrintPartFrm = class(TForm)
    Panel1: TPanel;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Edit1: TEdit;
    Edit2: TEdit;
    Button3: TButton;
    Button4: TButton;
    Button1: TButton;
    Button2: TButton;
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  PrintPartFrm: TPrintPartFrm;

implementation

uses MSDM, PickParts, partrpt;

{$R *.DFM}

procedure TPrintPartFrm.Button2Click(Sender: TObject);
begin
close;
end;

procedure TPrintPartFrm.Button3Click(Sender: TObject);
begin
if pickpartsfrm.ShowModal=mrok then
begin
   edit1.Text:=msdm.ModernSolidDM.PartsPartno.Value;
end;
end;

procedure TPrintPartFrm.Button4Click(Sender: TObject);
begin
if pickpartsfrm.ShowModal=mrok then
begin
   edit2.Text:=msdm.ModernSolidDM.PartsPartno.Value;
end;
end;

procedure TPrintPartFrm.Button1Click(Sender: TObject);
var temp:string;
begin
if not ((trim(edit1.text)='')and (trim(edit2.text)='')) then
   begin
     if (edit1.Text>edit2.text)then
     begin
         temp:=edit1.Text;
         edit1.text:=edit2.text;
         edit2.Text:=temp;
     end;
     msdm.ModernSolidDM.PartQry
     msdm.ModernSolidDM.PartQry.close;
     msdm.ModernSolidDM.PartQry.SQL.Clear;
     msdm.ModernSolidDM.PartQry.sql.Add('select * from parts');
     msdm.ModernSolidDM.PartQry.sql.add(' where partno>= ');
     msdm.ModernSolidDM.PartQry.sql.add( ''''+edit1.Text+'''');
     msdm.ModernSolidDM.PartQry.sql.Add('and partno<= ');
     msdm.ModernSolidDM.PartQry.sql.Add(''''+edit2.text+'''');
     msdm.ModernSolidDM.PartQry.sql.Add('order by partno');
     msdm.ModernSolidDM.PartQry.open;
     partrptfrm.QuickRep1.Preview;
   end
else
   begin
     msdm.ModernSolidDM.PartQry.close;
     msdm.ModernSolidDM.PartQry.SQL.Clear;
     msdm.ModernSolidDM.PartQry.sql.Add('select * from parts');
     msdm.ModernSolidDM.PartQry.sql.Add('order by partno');
     msdm.ModernSolidDM.PartQry.open;
     partrptfrm.QuickRep1.Preview;
   end;
end;
end.

⌨️ 快捷键说明

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