pm_qry_informalsspoinfo_h.pas

来自「一个MRPII系统源代码版本」· PAS 代码 · 共 120 行

PAS
120
字号
unit Pm_Qry_InformalSsPoInfo_H;

Interface

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

Type
  TFrm_Pm_Qry_InformalSsPoInfo_H = Class(TFrm_Base_Entry_Head)
    AdoQry_HeadItemCode: TStringField;
    AdoQry_HeadItemName: TStringField;
    AdoQry_HeadUomName: TStringField;
    AdoQry_Headldtime: TFloatField;
    AdoQry_HeadCurrentonhandInv: TFloatField;
    AdoQry_HeadTotalType: TStringField;
    AdoQry_HeadPmBatch: TIntegerField;
    procedure Act_LookExecute(Sender: TObject);
    procedure Act_QuitExecute(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
  private
    { Private declarations }
  public
    procedure InitForm(AdOConnection:TAdOConnection;ReadOnly:Boolean);Override;
    { Public declarations }
  end;

var
  Frm_Pm_Qry_InformalSsPoInfo_H: TFrm_Pm_Qry_InformalSsPoInfo_H;

implementation

uses  Pm_Qry_InformalSsPoInfo;



{$R *.DFM}

procedure TFrm_Pm_Qry_InformalSsPoInfo_H.Act_LookExecute(Sender: TObject);
var condition:string;
begin
  inherited;
  condition:='';
  condition:=condition+' 物料代码:'+AdoQry_Head.fieldbyname('ItemCode').asstring;
  condition:=condition+' 物料描述:'+AdoQry_Head.fieldbyname('ItemName').asstring;
  condition:=condition+' 阶段:'+AdoQry_Head.fieldbyname('TotalType').asstring;
if  Frm_Pm_Qry_InformalSsPoInfo=nil then
 begin
  Frm_Pm_Qry_InformalSsPoInfo:=TFrm_Pm_Qry_InformalSsPoInfo.Create(Self);
  Frm_Pm_Qry_InformalSsPoInfo.SetSysParam('gf','gf','gfd','fd');
  Frm_Pm_Qry_InformalSsPoInfo.InitForm(AdOConnectMain,True);
  Frm_Pm_Qry_InformalSsPoInfo.setconditionHint(Frm_Pm_Qry_InformalSsPoInfo.lbl_Condition,condition)
 end
 else Frm_Pm_Qry_InformalSsPoInfo.Show;
end;


procedure TFrm_Pm_Qry_InformalSsPoInfo_H.InitForm(
  AdOConnection: TAdOConnection; ReadOnly: Boolean);
var sqltext:string;
begin
  inherited;
    sqltext:=' select distinct  Item.ItemCode,                      '+#13+
             '                  Item.ItemName,                      '+#13+
             '                  Uom.UomName,                        '+#13+
             '                  ldtime=purchldtime,                 '+#13+
             '                  PmBatch,                            '+#13+
             '                  CurrentonhandInv,                   '+#13+
             '                  TotalType=''月''                    '+#13+
             '   into #tmp3                                          '+#13+
             '   from   Item                                        '+#13+
             '    left outer join Uom on Item.UomCode=Uom.UomCode   '+#13+
             '    join Informalss on Item.ItemCode=Informalss.ItemCode              ';

    with  AdoQry_Head do
       begin
         Close;
         sql.clear;
         sql.Add(sqltext);
         try
          execsql;
         except
         end;
         selectfromsql:='select * from #tmp3';

         Close;
         sql.clear;
         sql.Add('select * from #tmp3');
         Prepared;
         open;
       end;
end;


procedure TFrm_Pm_Qry_InformalSsPoInfo_H.Act_QuitExecute(Sender: TObject);
begin
    with AdoQry_tmp do
      begin
          Close;
          sql.clear;
          sql.Add('drop table #tmp3');
          try
          execsql;
          except
          end;
      end;

  inherited;

end;

procedure TFrm_Pm_Qry_InformalSsPoInfo_H.FormDestroy(Sender: TObject);
begin
  inherited;
Frm_Pm_Qry_InformalSsPoInfo_H:=nil;
end;

end.

⌨️ 快捷键说明

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