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

📄 ucgjhdh_lb.pas

📁 工廠採購管理系統
💻 PAS
字号:
unit ucgjhdh_lb;

interface

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

type
  Tfrmcgjhdh_lb = class(TForm)
    Panel1: TPanel;
    DBGrid1: TDBGrid;
    Label1: TLabel;
    Edit1: TEdit;
    RzBitBtn1: TRzBitBtn;
    RzBitBtn2: TRzBitBtn;
    ADOQuery1: TADOQuery;
    DataSource1: TDataSource;
    dtp1: TRzDateTimePicker;
    dtp2: TRzDateTimePicker;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    ComboBox1: TComboBox;
    ADOQuery2: TADOQuery;
    procedure FormCreate(Sender: TObject);
    procedure csh();
    procedure Edit1Change(Sender: TObject);
    procedure RzBitBtn1Click(Sender: TObject);
    procedure dtp1Exit(Sender: TObject);
    procedure dtp2Exit(Sender: TObject);
    procedure RzBitBtn2Click(Sender: TObject);
    procedure ComboBox1Change(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmcgjhdh_lb: Tfrmcgjhdh_lb;

implementation
uses ufunction,uconst,udm1;
{$R *.dfm}

procedure Tfrmcgjhdh_lb.FormCreate(Sender: TObject);
begin
adoquery1.Connection:=dm1.ADOConnection1;
adoquery2.Connection:=dm1.ADOConnection1;
dtp1.Date:=date-30;
dtp2.Date:=date;
csh;
end;
procedure tfrmcgjhdh_lb.csh();
begin
if adoquery1.Active then adoquery1.Close;
adoquery1.SQL.Clear;
strsql:='select cgxqdh,cgjhdh from cgjh_main where srrq>=:rq1 and srrq<=:rq2 order by cgjhdh asc';
adoquery1.SQL.Add(strsql);
adoquery1.Parameters.ParamByName('rq1').Value:=dtp1.Date;
adoquery1.Parameters.ParamByName('rq2').Value:=dtp2.Date;
adoquery1.Open;
if adoquery2.Active then adoquery2.Close;
strsql:='select distinct gdhm from ddk where yclwl=1 and ldrq>:rq1 and ldrq<=:rq2 order by gdhm asc';
adoquery2.SQL.Clear;
adoquery2.SQL.add(strsql);
adoquery2.Parameters.ParamByName('rq1').Value:=dtp1.Date;
adoquery2.Parameters.ParamByName('rq2').Value:=dtp2.Date;
adoquery2.Open;
if not(adoquery2.Recordset.eof and adoquery2.Recordset.BOF) then
   begin
   combobox1.Items.Clear;
   while not adoquery2.Eof do
        begin
        combobox1.Items.Add(trim(adoquery2.fieldbyname('gdhm').AsString));
        adoquery2.Next;
        end;
   end;
adoquery2.Close;
end;
procedure Tfrmcgjhdh_lb.Edit1Change(Sender: TObject);
begin
strsql:='select cgxqdh,cgjhdh from cgjh_main where cgjhdh like'+''''+
trim(edit1.Text)+'%'+''''+'order by cgjhdh asc';
adoexect(adoquery1,strsql);
if adoquery1.Recordset.EOF and adoquery1.Recordset.BOF then
   begin
        strsql:='select cgxqdh,cgjhdh from cgjh_main where cgxqdh like'+''''+
        trim(edit1.Text)+'%'+''''+'order by cgjhdh asc';
        adoexect(adoquery1,strsql);
   end;
end;

procedure Tfrmcgjhdh_lb.RzBitBtn1Click(Sender: TObject);
begin
strhthm:=trim(adoquery1.fieldbyname('cgjhdh').AsString);
xqdh:=trim(adoquery1.fieldbyname('cgxqdh').AsString);
close;
end;

procedure Tfrmcgjhdh_lb.dtp1Exit(Sender: TObject);
begin
csh;
end;

procedure Tfrmcgjhdh_lb.dtp2Exit(Sender: TObject);
begin
csh;
end;

procedure Tfrmcgjhdh_lb.RzBitBtn2Click(Sender: TObject);
begin
close;
end;

procedure Tfrmcgjhdh_lb.ComboBox1Change(Sender: TObject);
begin
strsql:='select cgjhdh,cgjh_main.cgxqdh from cgjh_main,cgwl_mail'+
' where cgjh_main.cgxqdh=cgwl_mail.cgxqdh and gdhm like '+
''''+'%'+trim(combobox1.Text)+'%'+''''+' order by cgjhdh asc';
adoexect(adoquery1,strsql);
end;

end.

⌨️ 快捷键说明

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