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

📄 storagefind_unit.pas

📁 药品进销管理程序,内有SQL附加的数据库.....详情看里面的,运行就OK
💻 PAS
字号:
unit StorageFind_Unit;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls, Buttons, Grids, DBGrids, DB,
  ComCtrls, ADODB;

type
  TfrmStorageFind = class(TForm)
    Panel1: TPanel;
    Label1: TLabel;
    Label3: TLabel;
    Label2: TLabel;
    cmbxItems: TComboBox;
    cmbxIf: TComboBox;
    edtValues: TEdit;
    btnFind: TBitBtn;
    Panel2: TPanel;
    dsrStorage: TDataSource;
    DBGrid1: TDBGrid;
    DateTimePicker1: TDateTimePicker;
    qryStorage: TADOQuery;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure btnFindClick(Sender: TObject);
    procedure cmbxItemsChange(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmStorageFind: TfrmStorageFind;

implementation

uses Common_Unit, LeechdomMain_Unit;

{$R *.dfm}

procedure TfrmStorageFind.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  Action := caFree;
  frmStorageFind := nil;
end;

procedure TfrmStorageFind.btnFindClick(Sender: TObject);
var
  FindStr: string;
begin
  if (cmbxItems.Text = '药品类别') and (cmbxIf.Text = '=') then
    FindStr := 'Exec proc_Storage @Flag=''Select_Type'''
              +',@Type=' + Quotedstr(Trim(edtValues.Text));

  if (cmbxItems.Text = '药品编号') and (cmbxIf.Text = '=') then
    FindStr := 'Exec proc_Storage @Flag=''Select_MedicineID'''
              +',@MedicineID=' + Quotedstr(Trim(edtValues.Text));

  if (cmbxItems.Text = '有效日期') and (cmbxIf.Text = '=') then
    FindStr := 'Exec proc_Storage @Flag=''Select_ValidityDatetime'''
              +',@ValidityDatetime=' + Quotedstr(DateToStr(DateTimePicker1.Date));

  if (cmbxItems.Text = '有效日期') and (cmbxIf.Text = '>') then
    FindStr := 'Exec proc_Storage @Flag=''Select_Big'''
              +',@ValidityDatetime=' + Quotedstr(DateToStr(DateTimePicker1.Date));

  if (cmbxItems.Text = '有效日期') and (cmbxIf.Text = '<') then
    FindStr := 'Exec proc_Storage @Flag=''Select_Small'''
              +',@ValidityDatetime=' + Quotedstr(DateToStr(DateTimePicker1.Date));
  if FindStr = '' then Exit;
  OpenDataSQL(qryStorage, FindStr);
end;

procedure TfrmStorageFind.cmbxItemsChange(Sender: TObject);
begin
  if cmbxItems.ItemIndex = 2 then
    DateTimePicker1.Visible := True
  else
    DateTimePicker1.Visible := False;
end;

end.

⌨️ 快捷键说明

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