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

📄 mrp_qry_uprightmrp_d_mpsandmo.pas

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

Interface

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

Type
  TFrm_Mrp_Qry_UpRightMrp_D_MpsAndMo = Class(TFrm_Base_Qry)
    AdoQry_MainItemCode: TStringField;
    AdoQry_MainDueDate: TDateTimeField;
    AdoQry_MainReleaseDate: TDateTimeField;
    AdoQry_MaInOrderNo: TStringField;
    AdoQry_MainGrossQty: TFloatField;
    AdoQry_MaInOrderQty: TFloatField;
    AdoQry_MainOnHand: TFloatField;
    AdoQry_MainCanUseOnHand: TFloatField;
    AdoQry_MainNetQty: TFloatField;
    AdoQry_MainOrdinal: TIntegerField;
    AdoQry_MainSSCode: TIntegerField;
    AdoQry_MainPmCode: TIntegerField;
    AdoQry_MaInOrderLineStatus: TIntegerField;
    AdoQry_MaInOrderLineno: TIntegerField;
    AdoQry_Mainpegging: TStringField;
    AdoQry_Mainoncheck: TFloatField;
    AdoQry_MainItemflag: TStringField;
    AdoQry_MainUomName: TStringField;
    AdoQry_MainBomqty: TFloatField;
    AdoQry_MainScrAprate: TStringField;
    AdoQry_MainMpsstatus: TIntegerField;
    AdoQry_MainMpsremArk: TStringField;
    AdoQry_MainMpsMonth: TStringField;
    AdoQry_MainMpsdate: TDateTimeField;
    Panel1: TPanel;
    Panel2: TPanel;
    DBGridEh1: TDBGridEh;
    AdoQuery1: TAdoQuery;
    StringField1: TStringField;
    DateTimeField1: TDateTimeField;
    DateTimeField2: TDateTimeField;
    StringField2: TStringField;
    FloatField1: TFloatField;
    FloatField2: TFloatField;
    FloatField3: TFloatField;
    FloatField4: TFloatField;
    FloatField5: TFloatField;
    IntegerField1: TIntegerField;
    IntegerField2: TIntegerField;
    IntegerField3: TIntegerField;
    IntegerField4: TIntegerField;
    IntegerField5: TIntegerField;
    StringField3: TStringField;
    FloatField6: TFloatField;
    FloatField7: TFloatField;
    StringField4: TStringField;
    AdoQry_MainMrpqty: TFloatField;
    StringField5: TStringField;
    StringField6: TStringField;
    AdoQry_MainQclt: TIntegerField;
    AdoQry_MainPreparelt: TIntegerField;
    DataSource1: TDataSource;
    AdoQry_MainMpsqty: TFloatField;
    procedure FormDestroy(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
  public
    lowItemPmCode:integer;
    requiredate:string;
    ItemCode:string;
    traceType:integer;
    Qclt:string;
    procedure InitForm(AdOConnection:TAdOConnection;ShowExtendColumn:Boolean);Override;
    function getlt(ItemCode:string;ltType:integer):integer;
    { Public declarations }
  end;

var
  Frm_Mrp_Qry_UpRightMrp_D_MpsAndMo: TFrm_Mrp_Qry_UpRightMrp_D_MpsAndMo;

implementation
uses Sys_Global;
{$R *.DFM}

procedure TFrm_Mrp_Qry_UpRightMrp_D_MpsAndMo.FormDestroy(Sender: TObject);
begin
  inherited;
  Frm_Mrp_Qry_UpRightMrp_D_Mpsandmo:=nil;
end;

procedure TFrm_Mrp_Qry_UpRightMrp_D_MpsAndMo.InitForm(
  AdOConnection: TAdOConnection; ShowExtendColumn: Boolean);
var sqltext,tMpsqltext,tmpcondition:string;
    i:integer;
begin
  inherited;
AdoQuery1.Connection:=AdoQry_Main.Connection;
Executesql(AdoQry_Main,'select * from #tmpuPMrpResult1',0);
Executesql(AdoQuery1,'select * from #tmpuPMrpResult',0);
end;

procedure TFrm_Mrp_Qry_UpRightMrp_D_MpsAndMo.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  inherited;
try
Executesql(AdoQry_tmp,'drop table #tmpopenBom,#tmpopenBomResult,#tmpopenBomResult1,#tmpuPMrpResult,#tmpuPMrpResult1',1);
except
end;
end;

function TFrm_Mrp_Qry_UpRightMrp_D_MpsAndMo.getlt(ItemCode: string;
  ltType: integer): integer;
var AdoQry:TAdoQuery;
begin
  Result:=0;
  AdoQry:=TAdoQuery.Create(self);
  AdoQry.EnableBCD:=False;
  try
    with AdoQry do
      begin
        Close;
        Connection:=dbconnect;
        sql.clear;
        sql.Add('select Preparelt,Qclt,runlt from Item where ItemCode='
                +quotedstr(ItemCode));
      open;
      case  ltType of
       1:  Result:=fieldbyname('Preparelt').asinteger;
       2:  Result:=fieldbyname('Qclt').asinteger;
       3:  Result:=fieldbyname('runlt').asinteger;
      end;
      end;
  finally
    AdoQry.Free;
  end;
end;


end.

⌨️ 快捷键说明

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