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

📄 unitprisch.pas

📁 贸易管理系统Delphi源代码(有开发文档) 采用access+delphi设计 软件实现功能:供应商信息的输入
💻 PAS
字号:
unit UnitPriSch;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComCtrls, ToolWin, Grids, DBGrids, ExtCtrls, StdCtrls, Mask,
  DBCtrls, DB, DBTables;

type
  TPriSch = class(TForm)
    ToolBar1: TToolBar;
    ToolButton1: TToolButton;
    ToolButton2: TToolButton;
    ToolButton3: TToolButton;
    ToolButton4: TToolButton;
    ToolButton5: TToolButton;
    GroupBox1: TGroupBox;
    Label1: TLabel;
    Label3: TLabel;
    Label2: TLabel;
    CheckBox1: TCheckBox;
    Edit1: TEdit;
    Bevel2: TBevel;
    DBGrid1: TDBGrid;
    Edit2: TEdit;
    Edit3: TEdit;
    Edit4: TEdit;
    Splitter1: TSplitter;
    procedure ToolButton1Click(Sender: TObject);
    procedure ToolButton5Click(Sender: TObject);
    procedure ToolButton3Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  PriSch: TPriSch;

implementation
 uses unit1;
{$R *.dfm}

procedure TPriSch.ToolButton1Click(Sender: TObject);
var a:string;
begin


    if checkbox1.Checked=true  then
       with datamodule1.ADOQryPriSch do
          begin
             sql.Clear;
             sql.Text:='select * from 供应商信息';
             a:=sql.Text;

               if edit2.Text<>'' then begin sql.Text:=a+' where 供应商编号 like '+'''NS%''';open;end;
               if edit3.Text<>'' then begin
                 sql.Text:=a+' where '+'供应商名称 like '+'''上海%'''+' or '+'供应商名称 like '+'''北京%'''+'or'+'供应商名称 like '+'''厦门%''';
                 open;
                 end;
               if edit4.Text<>'' then begin
                 sql.Text:=a+' where '+'所在城市 like '+'''上%'''+' or '+'所在城市 like '+'''北'''+ ' or '+'所在城市 like '+'''厦''';
                 open;
                 end;
              edit1.Text:=edit1.Text+inttostr(datamodule1.ADOQryPriSch.RecordCount);
         end
    else
       with datamodule1.ADOQryPriSch do
       begin
          sql.Clear;
          sql.Text:='select * from 供应商信息';
          a:=sql.Text;
          if edit2.Text<>'' then begin sql.Text:=a+' where 供应商编号='+quotedstr(edit2.Text);open; end;
          if edit3.Text<>'' then begin sql.Text:=a+' where 供应商名称='+quotedstr(edit3.Text);open; end;
          if edit4.Text<>'' then begin sql.Text:=a+' where 所在城市='+quotedstr(edit4.Text);open;end;
          edit1.Text:=edit1.Text+inttostr(datamodule1.ADOQryPriSch.RecordCount);

         end;

end;







procedure TPriSch.ToolButton5Click(Sender: TObject);
begin
  PriSch.Close;
end;

procedure TPriSch.ToolButton3Click(Sender: TObject);
begin
  edit2.Text:='';
  edit3.Text:='';
  edit4.Text:='';
end;

procedure TPriSch.FormCreate(Sender: TObject);
begin
  datamodule1.ADOQryPriSch.open;

end;

end.

⌨️ 快捷键说明

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