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

📄 formxiaoshouchaxun.pas

📁 这是一个关于药品进销存的管理软件
💻 PAS
字号:
unit FormXiaoshouchaxun;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComCtrls, StdCtrls, Grids, DBGrids, DB, ADODB;
  //DataModule,MonthCalendar;
type
  TXiaoshouchaxun = class(TForm)
    GroupBox1: TGroupBox;
    Label1: TLabel;
    ComboBox1: TComboBox;
    ComboBox2: TComboBox;
    ComboBox3: TComboBox;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label7: TLabel;
    Button1: TButton;
    Button2: TButton;
    DBGrid1: TDBGrid;
    Button3: TButton;
    Button4: TButton;
    DataSource1: TDataSource;
    Edit1: TEdit;
    DateTimePicker1: TDateTimePicker;
    DateTimePicker2: TDateTimePicker;
    Memo1: TMemo;
    Button5: TButton;
    ADOQuery1: TADOQuery;

    procedure Button1Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button5Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Xiaoshouchaxun: TXiaoshouchaxun;
  addsql:string;
  data1:string;
  data2:string;


implementation

uses  FormXiaoshoubaobiao;

{$R *.dfm}

procedure TXiaoshouchaxun.Button1Click(Sender: TObject);


begin



        data1:=''+data2+'';
        data2:= ''+ComboBox1.Text+'';


       if  ComboBox1.Text='预售价'   then
           begin addsql:=Memo1.Text;
        Memo1.Text:=Memo1.Text+' '+''+ComboBox2.Text+''+' '+ ''+ComboBox1.Text+''+''+ComboBox3.Text+' '+edit1.Text
       end
       else
            begin if   ComboBox1.Text='业务员电话'   then
                   begin addsql:=Memo1.Text;
                    Memo1.Text:=Memo1.Text+' '+''+ComboBox2.Text+''+' '+ ''+ComboBox1.Text+''+''+ComboBox3.Text+' '+edit1.Text
                   end
                  else
                  begin if  ComboBox1.Text='供应商电话'   then
                        begin addsql:=Memo1.Text;
                        Memo1.Text:=Memo1.Text+' '+''+ComboBox2.Text+''+' '+ ''+ComboBox1.Text+''+''+ComboBox3.Text+' '+edit1.Text
                        end
                        else
                        begin
                              if  ComboBox1.Text='销售数量'   then
                              begin addsql:=Memo1.Text;
                              Memo1.Text:=Memo1.Text+' '+''+ComboBox2.Text+''+' '+ ''+ComboBox1.Text+''+''+ComboBox3.Text+' '+edit1.Text
                              end
                              else
                              begin
                                  if ComboBox1.Text='销售金额'  then
                                  begin addsql:=Memo1.Text;
                                  Memo1.Text:=Memo1.Text+' '+''+ComboBox2.Text+''+' '+ ''+ComboBox1.Text+''+''+ComboBox3.Text+' '+edit1.Text
                                  end
                                  else
                                  begin
                                      addsql:=Memo1.Text ;
                                      Memo1.Text:=Memo1.Text+' '+''+ComboBox2.Text+''+' '+ ''+ComboBox1.Text+''+''+ComboBox3.Text+' '+''''+edit1.Text+''''
                                  end
                              end
                          end
                   end
                   end
            end;


       //sumclick:=sumclick+1;


//        case temp of
//                 '进价':
//                 begin
//                 addsql:=Memo1.Text;
//      Memo1.Text:=Memo1.Text+' '+''+ComboBox2.Text+''+' '+ ''+ComboBox1.Text+''+''+ComboBox3.Text+' '+edit1.Text;
//             end;
//                   '业务员电话':
//                   begin      addsql:=Memo1.Text;
//        Memo1.Text:=Memo1.Text+' '+''+ComboBox2.Text+''+' '+ ''+ComboBox1.Text+''+''+ComboBox3.Text+' '+edit1.Text;
//             end ;
//                    '供应商电话':
//                    begin      addsql:=Memo1.Text;
//        Memo1.Text:=Memo1.Text+' '+''+ComboBox2.Text+''+' '+ ''+ComboBox1.Text+''+''+ComboBox3.Text+' '+edit1.Text;
//             end ;
//                    '入库数量':
//                    begin      addsql:=Memo1.Text;
//        Memo1.Text:=Memo1.Text+' '+''+ComboBox2.Text+''+' '+ ''+ComboBox1.Text+''+''+ComboBox3.Text+' '+edit1.Text;
//             end ;
//                    '入库金额':
//        begin      addsql:=Memo1.Text;
//        Memo1.Text:=Memo1.Text+' '+''+ComboBox2.Text+''+' '+ ''+ComboBox1.Text+''+''+ComboBox3.Text+' '+edit1.Text ;
//             end;
//               else
//       begin addsql:=Memo1.Text ;
//       Memo1.Text:=Memo1.Text+' '+''+ComboBox2.Text+''+' '+ ''+ComboBox1.Text+''+''+ComboBox3.Text+' '+''''+edit1.Text+''''
//             end

//end;

procedure TXiaoshouchaxun.Button3Click(Sender: TObject);


begin
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('select 药品分类.类别名称 ,药品剂型信息.剂型名称, 药品信息.药品名称, 单位信息.单位, 药品信息.规格, 药品信息.厂家名称, 药品信息.批准文号, 药品信息.处方标志,');
ADOQuery1.SQL.Add(' 业务员信息.业务员姓名, 业务员信息.业务员电话, 供应商信息.供应商名称, 供应商信息.供应商电话,  销售信息.预售价, 销售信息.销售数量, 销售信息.销售金额');
ADOQuery1.SQL.Add('from 药品分类,药品剂型信息,药品信息,业务员信息,销售信息,单位信息,供应商信息 ');
ADOQuery1.SQL.Add('where  销售信息.销售日期>=#'+datetostr(DateTimePicker1.Date)+'# and 销售信息.销售日期<=#'+datetostr(DateTimePicker2.Date)+'# ');
ADOQuery1.SQL.Add(Memo1.Text);

ADOQuery1.Open;
end;

procedure TXiaoshouchaxun.Button2Click(Sender: TObject);
begin
 Memo1.Text:=addsql;
end;

procedure TXiaoshouchaxun.Button4Click(Sender: TObject);
begin
      if data2='类别名称' then
      begin
      Xiaoshoubaobiao.QRDBText11.DataField:=data1;
      Xiaoshoubaobiao.QRLabel14.Caption:=data1;
      Xiaoshoubaobiao.QRDBText10.DataField:=data2;
      Xiaoshoubaobiao.QRLabel12.Caption:=data2;
      Xiaoshoubaobiao.QuickRep1.Preview;
      end else
      begin
            if data2='剂型名称' then
            begin
            Xiaoshoubaobiao.QRDBText11.DataField:=data1;
            Xiaoshoubaobiao.QRLabel14.Caption:=data1;
            Xiaoshoubaobiao.QRDBText10.DataField:=data2;
            Xiaoshoubaobiao.QRLabel12.Caption:=data2;
            Xiaoshoubaobiao.QuickRep1.Preview;
            end   else
            begin
              if data2='厂家名称' then
              begin
              Xiaoshoubaobiao.QRDBText11.DataField:=data1;
              Xiaoshoubaobiao.QRLabel14.Caption:=data1;
              Xiaoshoubaobiao.QRDBText10.DataField:=data2;
              Xiaoshoubaobiao.QRLabel12.Caption:=data2;
              Xiaoshoubaobiao.QuickRep1.Preview;
              end     else
              begin
                if data2='处方标志' then
                begin
                Xiaoshoubaobiao.QRDBText11.DataField:=data1;
                Xiaoshoubaobiao.QRLabel14.Caption:=data1;
                Xiaoshoubaobiao.QRDBText10.DataField:=data2;
                Xiaoshoubaobiao.QRLabel12.Caption:=data2;
                Xiaoshoubaobiao.QuickRep1.Preview;
                end       else
                begin
                  if data2='业务员姓名' then
                  begin
                  Xiaoshoubaobiao.QRDBText11.DataField:=data1;
                  Xiaoshoubaobiao.QRLabel14.Caption:=data1;
                  Xiaoshoubaobiao.QRDBText10.DataField:=data2;
                  Xiaoshoubaobiao.QRLabel12.Caption:=data2;
                  Xiaoshoubaobiao.QuickRep1.Preview;
                  end        else
                  begin
                    if data2='供应商名称' then
                    begin
                    Xiaoshoubaobiao.QRDBText11.DataField:=data1;
                    Xiaoshoubaobiao.QRLabel14.Caption:=data1;
                    Xiaoshoubaobiao.QRDBText10.DataField:=data2;
                    Xiaoshoubaobiao.QRLabel12.Caption:=data2;
                    Xiaoshoubaobiao.QuickRep1.Preview;
                    end
                    else
                    begin
                    data2:=' ';
                    data1:=' ';
                    Xiaoshoubaobiao.QRDBText11.DataField:='';
                    Xiaoshoubaobiao.QRLabel14.Caption:=' ';
                    Xiaoshoubaobiao.QRDBText10.DataField:=' ';
                    Xiaoshoubaobiao.QRLabel12.Caption:=' ';
                    Xiaoshoubaobiao.QuickRep1.Preview;
                  end
                  end
                  end
                  end
                  end
      end;



end;

procedure TXiaoshouchaxun.Button5Click(Sender: TObject);
begin
      Memo1.Text:='';
      ADOQuery1.Close;
      ADOQuery1.SQL.Clear;
      data1:=' ';
      data2:=' ';
end;

end.

⌨️ 快捷键说明

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