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

📄 mrp_qry_chginfomps_c.pas

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

Interface

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

Type
  TFrm_Mrp_Qry_ChgInfoMps_C = Class(TFrm_Base_Condition)
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label6: TLabel;
    Label9: TLabel;
    Label10: TLabel;
    medts: TMaskEdit;
    medte: TMaskEdit;
    edtItemCodes: TEdit;
    edtItemCodee: TEdit;
    edteCodes: TEdit;
    edteCodee: TEdit;
    procedure FormCreate(Sender: TObject);
    procedure btn_okClick(Sender: TObject);
    procedure edtItemCodesKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Frm_Mrp_Qry_ChgInfoMps_C: TFrm_Mrp_Qry_ChgInfoMps_C;

implementation
  uses Mrp_Qry_ChgInfoMps,Sys_Global;
{$R *.DFM}

procedure TFrm_Mrp_Qry_ChgInfoMps_C.FormCreate(Sender: TObject);
begin
  inherited;
     medts.Text:=formatdatetime('yyyy.mm.dd',now-15);
     medte.Text:=formatdatetime('yyyy.mm.dd',now);
     edteCodes.Text:='0';
     edtItemCodes.Text:='0';
     edteCodee.Text:='ZZZZZ';
     edtItemCodee.Text:='ZZZZZ';
end;

procedure TFrm_Mrp_Qry_ChgInfoMps_C.btn_okClick(Sender: TObject);
var SqlText:string;
begin
  inherited;
  SqlText:='Select MpsHistory.*,Employee.EmployeeName,Item.ItemName,'+
                  'Itemflag=Mpshistory.ItemCode+'' ''+Item.ItemName,'+
                  'Employeeflag=Mpshistory.chgEmployeeCode+'' ''+Employee.EmployeeName,'+
                  'Item.UomCode,Uom.UomName'+
           ' into #tmPmpshistory   '+
           ' From MpsHistory'+
           ' Join Item On MpsHistory.ItemCode=Item.ItemCode'+
           ' Join Uom On Item.UomCode=Uom.UomCode'+
           ' Join Employee On MpsHistory.ChgEmployeeCode=Employee.EmployeeCode'+
           ' Where   MpsHistory.ItemCode between '''+edtItemCodes.Text+''''+' and '''+edtItemCodee.Text+''''+
           '   and   MpsHistory.ChgEmployeeCode between '''+edteCodes.Text+''''+' and '''+edteCodee.Text+''''+
           '   and   MpsHistory.ChgTime between '''+medts.Text+''''+' and '''+medte.Text+' 23:59:59'+''''+
           ' Order By MpsId,ChgTime';

 with   Frm_Mrp_Qry_ChgInfoMps.AdoQry_Main do
     begin
       Close;
       sql.clear;
       sql.Add(sqltext);
       Prepared;
       execsql;

       Close;
       sql.clear;
       sql.Add('select * from #tmPmpshistory');
       Prepared;
       open;
       if recordCount=0 then
         begin
           Close;
           sql.clear;
           sql.Add('drop table #tmPmpshistory');
           Prepared;
           execsql;
           DispInfo('无符合条件的数据!',3);
           exit;
         end;
     end;

   ConditionHint:='物料代码从 '+EdtItemCodes.Text+'到'+EdtItemCodee.Text+' / 操作员代码从 '+EdteCodes.Text+'到'+EdteCodee.Text+' / 操作日期从 '+medts.Text+'到'+medte.Text;
   self.ModalResult:=mrOk;


end;

procedure TFrm_Mrp_Qry_ChgInfoMps_C.edtItemCodesKeyDown(Sender: TObject;
  var Key: Word; Shift: TShiftState);
begin
  inherited;
 If key=120 Then
  CommOnHint(Sender,AdoQry_Tmp,'ItemName','物料描述','ItemCode',
             '物料代码',' Item ',' ItemType=0 and ItemUsable=1 ');
end;

end.

⌨️ 快捷键说明

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