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

📄 inv_invaging_c.pas

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

Interface

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

Type
  TFrm_Inv_InvAging_C = Class(TFrm_Base_Condition)
    Label1: TLabel;
    CmBx_Warehouse: TComboBox;
    Label2: TLabel;
    Label3: TLabel;
    ExtEdt_ItemCode1: TExtEdit;
    Lbl_ItemName1: TLabel;
    Lbl_ItemName: TEdit;
    ExtEdt_ItemCode: TLinkEdit;
    procedure FormActivate(Sender: TObject);
    procedure btn_okClick(Sender: TObject);
    procedure ExtEdt_ItemCodeKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure ExtEdt_ItemCodeButtonClick(Sender: TObject);
    procedure FindItemCode(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Frm_Inv_InvAging_C: TFrm_Inv_InvAging_C;

implementation

uses Sys_Global;

{$R *.DFM}

procedure TFrm_Inv_InvAging_C.FormActivate(Sender: TObject);
begin
  inherited;
  if CmBx_Warehouse.Items.Count=0 then
  begin//设置可用仓库
    AdoQry_Tmp.Close;
    AdoQry_Tmp.SQL.Text:='Select WHAccessCtrl.WHCode+'' ''+Warehouse.WHName As WHCodeName'
      +' From WHAccessCtrl'
      +' Join Warehouse On WHAccessCtrl.WHCode=Warehouse.WHCode'
      +' Where WHAccessCtrl.EmployeeCode='''+UserCode+''''
      //+' And Warehouse.PriceType<>1'
      +' Order By WHAccessCtrl.WHCode ';
    AdoQry_Tmp.Open;
    AdoQry_Tmp.First;
    while not AdoQry_Tmp.Eof do
    begin
      CmBx_Warehouse.Items.Add(AdoQry_Tmp.fieldbyname('WHCodeName').AsString);
      AdoQry_Tmp.Next;
    end;
    CmBx_Warehouse.Items.Insert(0,'');
    CmBx_Warehouse.ItemIndex:=0;
  end;
end;

procedure TFrm_Inv_InvAging_C.btn_okClick(Sender: TObject);
begin
  inherited;
  if (CmBx_Warehouse.Text='')and(ExtEdt_ItemCode.Text='') then
    if DispInfo('条件都未选择时,系统将对所有仓库所有物料进行分析.'+#13+#10
      +'可能需要比较长的时间,是否继续?',2)='n' then
      Exit;
  Condition:=' And CurrentInv.ItemCode Like '''+ExtEdt_ItemCode.Text+'%''';
  if CmBx_Warehouse.Text<>'' then
    Condition:=Condition+' And CurrentInv.WHCode='''+GetCode(CmBx_Warehouse.Text)+'''';
  ConditionHint:='仓库: '+CmBx_Warehouse.Text+' /物料: '+Lbl_ItemName.text;
  ModalResult:=mrOk;
end;

procedure TFrm_Inv_InvAging_C.ExtEdt_ItemCodeKeyDown(Sender: TObject;
  var Key: Word; Shift: TShiftState);
begin
  inherited;
  if(Key=120)then
    CommonHint(Sender,AdoQry_Tmp,'ItemName','物料名称','ItemCode','物料代码','Item');
end;

procedure TFrm_Inv_InvAging_C.ExtEdt_ItemCodeButtonClick(Sender: TObject);
begin
  inherited;
  CommonHint(Sender,AdoQry_Tmp,'ItemName','物料名称','ItemCode','物料代码','Item');
end;

procedure TFrm_Inv_InvAging_C.FindItemCode(Sender: TObject);
begin
  inherited;
  with AdoQry_tmp do
  begin
    Close;
    sql.clear;
    sql.text:=' select ItemName from Item  '
                +' where ItemCode='''+Trim(ExtEdt_ItemCode.text)+''''
                +' and ItemUsable=1 and ItemType in (0,2)'  ;
    open;
    if not eof then
      Lbl_ItemName.text:=fieldbyname('ItemName').asstring;
  end;
end;

end.

⌨️ 快捷键说明

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