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

📄 inv_opmaterialsum_c.pas

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

Interface

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

Type
  TFrm_Inv_OpMaterialSum_C = Class(TFrm_Base_Condition)
    medt_Month: TMaskEdit;
    Label3: TLabel;
    Label1: TLabel;
    Label2: TLabel;
    Lbl_VendorName1: TLabel;
    Lbl_VendorName: TEdit;
    ExtEdt_Vendor: TLinkEdit;
    procedure btn_okClick(Sender: TObject);
    procedure MonthCheck(Sender: TObject);
    procedure ExtEdt_VendorKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure ExtEdt_VendorButtonClick(Sender: TObject);
    procedure ExtEdt_VendorExit(Sender: TObject);
  private
    { Private declarations }
  public
    onlyQuery:boolean;
    procedure InitForm(Adocnnct:tAdoConnection;UserCode:String;LoginDate:string);
    { Public declarations }
  end;

var
  Frm_Inv_OpMaterialSum_C: TFrm_Inv_OpMaterialSum_C;

implementation

uses Sys_Global,Inv_Global;

{$R *.DFM}

procedure TFrm_Inv_OpMaterialSum_C.InitForm(Adocnnct:tAdoConnection;UserCode:String;LoginDate:string);
begin
  medt_Month.Text :=FormatDateTime('yyyy.mm',incMonth(now,-1));
  onlyQuery:=False;
  AdoQry_Tmp.Connection:=Adocnnct;
end;

procedure TFrm_Inv_OpMaterialSum_C.btn_okClick(Sender: TObject);
begin
  if copy(medt_Month.Text,1,4)='    ' then
  begin
    DispInfo('月份不能为空!',3);
    medt_Month.SetFocus ;    
    abort;
  end;
  if Extedt_Vendor.Text='' then
  begin
    DispInfo('供应商不能为空。',3);
    ExtEdt_Vendor.SetFocus ;
    abort;
  end;
  inherited;

  if medt_Month.text<>'' then
  begin
     condition:=' InvMonth='''+medt_Month.text+'''';
  end;
    onlyQuery:=False;

  modalResult:=mrok;
end;


procedure TFrm_Inv_OpMaterialSum_C.MonthCheck(Sender: TObject);
begin
  inherited;
  InvdataChangecheck(AdoQry_tmp,medt_Month.text);
  selectnext(activecontrol,True,True);
  Extedt_Vendor.ControlStyle :=[cSclickEvents];
  Extedt_Vendor.ControlState :=[cSclicked];
  Extedt_Vendor.SetFocus ;
end;

procedure TFrm_Inv_OpMaterialSum_C.ExtEdt_VendorKeyDown(Sender: TObject;
  var Key: Word; Shift: TShiftState);
begin
  inherited;
  if(Key=120)then
    CommonHint(Sender,AdoQry_Tmp,'VendorName','供应商名称','VendorCode',
      '供应商代码','Vendor','VendorUsable=1');
end;

procedure TFrm_Inv_OpMaterialSum_C.ExtEdt_VendorButtonClick(
  Sender: TObject);
begin
  inherited;
  CommonHint(Sender,AdoQry_Tmp,'VendorName','供应商名称','VendorCode',
    '供应商代码','Vendor','VendorUsable=1');
end;

procedure TFrm_Inv_OpMaterialSum_C.ExtEdt_VendorExit(Sender: TObject);
begin
  inherited;
  with AdoQry_Tmp do
  begin
    Close;
    sql.clear;
    sql.text:=' select VendorName from Vendor where VendorCode='''+Trim(ExtEdt_Vendor.text)+''''
             +' and VendorUsable=1'  ;
    open;
    if not eof then
      Lbl_VendorName.text:=fieldbyname('VendorName').asstring;
  end;
end;

end.

⌨️ 快捷键说明

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