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

📄 unitcussch.pas

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

interface

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

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

var
  CusSch: TCusSch;

implementation
  uses unit1;
{$R *.dfm}

procedure TCusSch.ToolButton1Click(Sender: TObject);
var a:string;
begin
    if checkbox1.Checked=true  then
       with datamodule1.ADOQryCusSch do
          begin
             sql.Clear;
             sql.Text:='select * from 顾客信息';
             a:=sql.Text;

               if edit2.Text<>'' then begin sql.Text:=a+' where 顾客编号 like '+'''GK%''';open;end;
               if edit3.Text<>'' then begin
                 sql.Text:=a+' where '+'公司名称 like '+'''上海%'''+' or '+'公司名称 like '+'''北京%''';
                 open;
                 end;
               if edit4.Text<>'' then begin
                 sql.Text:=a+' where '+'所在城市 like '+'''上%'''+' or '+'所在城市 like '+'''北''';
                 open;
                 end;
              edit1.Text:=edit1.Text+inttostr(datamodule1.ADOQryCusSch.RecordCount);
         end
    else
       with datamodule1.ADOQryCusSch 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.ADOQryCusSch.RecordCount);

         end;
end;

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

procedure TCusSch.ToolButton5Click(Sender: TObject);
begin
CusSch.Close;
end;

procedure TCusSch.FormCreate(Sender: TObject);
begin
datamodule1.ADOQryCusSch.open;
edit1.Text:='';
edit2.Text:='';
edit3.Text:='';
end;

end.

⌨️ 快捷键说明

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