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

📄 sfc_wipinv.pas

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

Interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Base_Outer, ExtPrintReport, Db, ActnList, AdODB, Grids, DBGridEh,
  StdCtrls, ExtCtrls, ComCtrls, ToolWin, Menus;

Type
  TFrm_Sfc_WipInv = Class(TFrm_Base_Outer)
    procedure Act_NewExecute(Sender: TObject);
  private
    { Private declarations }
    ItemType:string;
  public
    { Public declarations }
     procedure InitForm(AdOConnection:TAdOConnection;ReadOnly:Boolean);Override;
     function  SetDeleteSql:String;Override;
     procedure SetFormParam(FrmParam1,FrmParam2,FrmParam3,FrmParam4,FrmParam5,FrmParam6:String);Override;
     procedure SetUserParam(Param1,Param2,Param3,Param4,Param5,//设置入口参数
      Param6:String);Override;

  end;

var
  Frm_Sfc_WipInv: TFrm_Sfc_WipInv;

implementation

uses Sfc_WipInv_D,Sfc_WipInv_C;

{$R *.DFM}

function TFrm_Sfc_WipInv.SetDeleteSql: String;
begin
  Result:='Delete WipInv'
    +' Where DeptCode='''+AdoQry_Main.fieldbyname('DeptCode').AsString+''''
    +' And ItemCode='''+AdoQry_Main.fieldbyname('ItemCode').AsString+''''
    +' And WipInvMonth='''+AdoQry_Main.fieldbyname('WipInvMonth').AsString+'''';
end;

procedure TFrm_Sfc_WipInv.InitForm(AdOConnection: TAdOConnection;
  ReadOnly: Boolean);
begin
  ExtendCaption:=False;
  inherited;
  SelectFromSQL:='Select WipInv.ItemCode'
    +',WipInv.WipInvQty'
    +',Item.ItemName'
    +',Item.ItemCode2'
    +',WipInv.DeptCode'
    +',WipInv.WipInvMonth'
    +' From WipInv'
    +' Join Item On Item.ItemCode=WipInv.ItemCode';
  OrderByFields:='ItemCode';
//  Frm_Sys_Condition:=TFrm_Sfc_WipInv_C.Create(Application);
//  Frm_Sys_Condition.initform(ItemType);
  Frm_Sfc_WipInv_C:=TFrm_Sfc_WipInv_C.Create(Application);
  Frm_Sfc_WipInv_C.initform(ItemType);
  Frm_Sys_Condition:=Frm_Sfc_WipInv_C;

  Frm_Sys_Detail:=TFrm_Sfc_WipInv_D.Create(Application);
  Act_Filter.Execute;
end;

procedure TFrm_Sfc_WipInv.SetFormParam(FrmParam1, FrmParam2, FrmParam3,
  FrmParam4, FrmParam5, FrmParam6: String);
begin
  inherited;
  Frm_Sys_Detail.SetFormParam(FrmParam1,FrmParam2,ItemType,'','','');
  if FrmParam3='ReadOnly' then
  begin
    Act_New.Visible:=False;
    Act_Modify.Visible:=False;
    Act_Delete.Visible:=False;
    Act_New.Enabled:=False;
    Act_Modify.Enabled:=False;
    Act_Delete.Enabled:=False;
    Act_Look.Enabled:=True;
    Act_Look.Visible:=True;
  end
  else
  begin
    Act_New.Visible:=True;
    Act_Modify.Visible:=True;
    Act_Delete.Visible:=True;
    Act_New.Enabled:=True;
    Act_Modify.Enabled:=True;
    Act_Delete.Enabled:=True;
    Act_Look.Enabled:=False;
    Act_Look.Visible:=False;
  end;
end;

procedure TFrm_Sfc_WipInv.Act_NewExecute(Sender: TObject);
begin
  if AdoQry_Main.active then
  inherited;

end;
procedure TFrm_Sfc_WipInv.SetUserParam(Param1,Param2,Param3,Param4,Param5,
      Param6:String);
begin
    ItemType:=Param1;
    if ItemType='z01' then
      Pnl_Title.Caption:='总装车间组件料月末库存记录';
    if ItemType='z02' then
      Pnl_Title.Caption:='总装车间印刷钢板月末库存记录';
    if ItemType='z03' then
      Pnl_Title.Caption:='总装车间外壳月末库存记录';
    if ItemType='p01' then
      Pnl_Title.Caption:='配件车间原材料月末库存记录';
    if ItemType='p02' then
      Pnl_Title.Caption:='配件车间半成品月末库存记录';

end;


end.

⌨️ 快捷键说明

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