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

📄 xsh_find_unit.pas

📁 仿速达进销存系统,系统在单据打印上作了灵活的自定义.可供借鉴
💻 PAS
字号:
unit xsh_find_unit;

interface

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

type
  Txsh_find_form = class(TForm)
    GroupBox1: TGroupBox;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    SpeedButton1: TSpeedButton;
    SpeedButton2: TSpeedButton;
    ComboBox1: TComboBox;
    ComboBox2: TComboBox;
    Edit1: TEdit;
    procedure SpeedButton2Click(Sender: TObject);
    procedure SpeedButton1Click(Sender: TObject);
    procedure Edit1KeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  xsh_find_form: Txsh_find_form;

implementation

uses data_unit, xsh_unit;

{$R *.dfm}

procedure Txsh_find_form.SpeedButton2Click(Sender: TObject);
begin
close;
end;

procedure Txsh_find_form.SpeedButton1Click(Sender: TObject);
begin
with database do
begin
adoq3.Connection :=adoc;
adoq3.SQL.Clear;
case combobox1.ItemIndex of
   0:
    begin
     case combobox2.ItemIndex of
      0:
        begin
            adoq3.SQL.Add('select * from xshd where 单据编码=:bm');
            adoq3.Parameters.ParamByName('bm').Value :=edit1.Text;
         end;
       1:
         begin
          adoq3.SQL.Add('select * from xshd where 单据编码 like :bm2');
          adoq3.Parameters.ParamByName('bm2').Value :=edit1.Text+'%';
         end;
       end;
   end;
  1:
 begin
     case combobox2.ItemIndex of
      0:
        begin
            adoq3.SQL.Add('select * from xshd where 供货商名称=:lx');
            adoq3.Parameters.ParamByName('lx').Value :=edit1.Text;
         end;
       1:
         begin
          adoq3.SQL.Add('select * from xshd where 供货商名称 like :lx2');
          adoq3.Parameters.ParamByName('lx2').Value :=edit1.Text+'%';
         end;
       end;
   end;
  2:
 begin
     case combobox2.ItemIndex of
      0:
        begin
            adoq3.SQL.Add('select * from xshd where 经手人=:jsr');
            adoq3.Parameters.ParamByName('jsr').Value :=edit1.Text;
         end;
       1:
         begin
          adoq3.SQL.Add('select * from xshd where 经手人 like :jsr2');
          adoq3.Parameters.ParamByName('jsr2').Value :=edit1.Text+'%';
         end;
       end;
   end
else
    begin
     adoq3.SQL.Clear ;
     adoq3.SQL.Add('select * from xshd order by 录单日期');
  end;
end;
adoq3.Active :=true;
if adoq3.Recordset.RecordCount >0 then
begin
datas2.DataSet :=nil;
datas2.DataSet :=adoq3;
self.Hide ;
xsh_form.DBGrid1.DataSource:=datas2;
xsh_form.statusbar1.Panels[1].Text :=inttostr(adoq3.Recordset.RecordCount);
end
else
showmessage('无此记录!');
end;

end;

procedure Txsh_find_form.Edit1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
if key=vk_return then
speedbutton1click(nil);
end;

end.

⌨️ 快捷键说明

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