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

📄 pm_qry_printpo_c.pas

📁 一个MRPII系统源代码版本
💻 PAS
字号:
unit Pm_Qry_PrintPo_C;

Interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Base_Condition, Db, AdODB, StdCtrls, Mask, ExtEdit;

Type
  TFrm_Pm_Qry_PrintPo_C = Class(TFrm_Base_Condition)
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Edt_VendorCode: TExtEdit;
    MEdt_PoStArtDate: TMaskEdit;
    MEdt_PoendDate: TMaskEdit;
    Lab_VendorName: TLabel;
    Label5: TLabel;
    procedure Edt_VendorCodeKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure FormCreate(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure btn_okClick(Sender: TObject);
    procedure Edt_VendorCodeExit(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Frm_Pm_Qry_PrintPo_C: TFrm_Pm_Qry_PrintPo_C;

implementation

uses Sys_Global;

{$R *.DFM}

procedure TFrm_Pm_Qry_PrintPo_C.Edt_VendorCodeKeyDown(Sender: TObject;
  var Key: Word; Shift: TShiftState);
begin
  inherited;
  If (Key=120) Then
    CommonHint(Sender,AdoQry_Tmp,'VendorName','供应商名称','VendorCode',
        '供应商代号',' Vendor ',' Vendor.VendorCode In (Select VendorCode From po)')
end;

procedure TFrm_Pm_Qry_PrintPo_C.FormCreate(Sender: TObject);
begin
  inherited;
  MEdt_PoStArtDate.Text := FormatDateTime('yyyy.mm.dd',date-90);
  MEdt_PoendDate.Text := FormatDateTime('yyyy.mm.dd',date);
end;

procedure TFrm_Pm_Qry_PrintPo_C.FormShow(Sender: TObject);
begin
  inherited;
  Edt_VendorCode.SetFocus ;
end;

procedure TFrm_Pm_Qry_PrintPo_C.btn_okClick(Sender: TObject);
begin
  inherited;
  if   Trim(Edt_VendorCode.Text) <>'' then
  begin
    condition :=' Po.VendorCode='''+Trim(Edt_VendorCode.Text)+''' and po.podate>='''+MEdt_PoStArtDate.Text+''' and po.podate<='''+MEdt_PoendDate.Text+'''';
    conditionHint:='供应商代号:'+Edt_VendorCode.Text+' '+Lab_VendorName.Caption +'/下单开始日期:'+MEdt_PoStArtDate.Text+'/下单终止日期:'+MEdt_PoendDate.Text;
  end
  else
  begin
    condition :='  po.podate>='''+MEdt_PoStArtDate.Text+''' and po.podate<='''+MEdt_PoendDate.Text+'''';
    conditionHint:='下单开始日期:'+MEdt_PoStArtDate.Text+'/下单终止日期:'+MEdt_PoendDate.Text;
  end;


  self.ModalResult := mrok;
end;

procedure TFrm_Pm_Qry_PrintPo_C.Edt_VendorCodeExit(Sender: TObject);
begin
  inherited;
  if Activecontrol.Name='btn_Cancel' Then
     Exit;
  if  Trim(Edt_VendorCode.Text) <>'' then
  begin
    AdoQry_Tmp.Close;
    AdoQry_Tmp.SQL.clear;
    AdoQry_Tmp.SQL.Text := 'Select * from Vendor where VendorCode='''+Trim(Edt_VendorCode.Text)+'''';
    AdoQry_Tmp.Open;
    if AdoQry_Tmp.Eof Then
    begin
      DispInfo('供应商代号错误!',3) ;
      Edt_VendorCode.SetFocus;
      abort;
    end;
  end;
end;

end.

⌨️ 快捷键说明

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