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

📄 sfc_wipwaster.pas

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

Interface

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

Type
  TFrm_Sfc_WipWaster = Class(TFrm_Base_Outer)
    AdoQry_Mainmono: TStringField;
    AdoQry_MainMoLineno: TIntegerField;
    AdoQry_Mainwipdate: TDateTimeField;
    AdoQry_Mainite_ItemCode: TStringField;
    AdoQry_MainItemCode: TStringField;
    AdoQry_MainDeptCode: TStringField;
    AdoQry_MainshiftType: TStringField;
    AdoQry_Mainwipqty: TFloatField;
    AdoQry_MainwipAmount: TFloatField;
    AdoQry_MaInBillNo: TStringField;
    AdoQry_MainWasterType: TIntegerField;
    AdoQry_MainWasterCause: TStringField;
    AdoQry_MainRemArk: TStringField;
    AdoQry_MainDate_Create: TDateTimeField;
    AdoQry_MainDate_Edit: TDateTimeField;
    AdoQry_MainEmployeeCode_Create: TStringField;
    AdoQry_MainEmployeeCode_Edit: TStringField;
    AdoQry_MainDeptName: TStringField;
    AdoQry_Mainite_ItemName: TStringField;
    AdoQry_MainItemName: TStringField;
    AdoQry_MainEmployeeName: TStringField;
    AdoQry_MainEdItEmployeeName: TStringField;
    procedure FormDestroy(Sender: TObject);
  private
    { Private declarations }
  public
    function  SetDeleteSql:String;Override;
    procedure InitForm(AdOConnection:TAdOConnection;ReadOnly:Boolean);Override;

  end;

var
  Frm_Sfc_WipWaster: TFrm_Sfc_WipWaster;

implementation

uses Sfc_WipWaster_D,Sys_Global;

{$R *.DFM}
procedure TFrm_Sfc_WipWaster.InitForm(AdOConnection:TAdOConnection;ReadOnly:Boolean);
var
  begindate:string;
begin
   inherited;
   begindate:=FormatDateTime('yyyy.mm',now)+'.01';
   SelectFromSQL:=' select WipWaster.*,Dept.DeptName, '
                 +' i.ItemName as ite_ItemName, '
                 +' Item.ItemName, '
                 +' Employee.EmployeeName, '
                 +' E1.EmployeeName As EdItEmployeeName '
                 +' from WipWaster '
                 +' Left join Item on Item.ItemCode=WipWaster.ItemCode '
                 +' Left join Item i on i.ItemCode=WipWaster.ite_ItemCode '
                 +' left join Dept on Dept.DeptCode=WipWaster.DeptCode '
                 +' Left Join Employee On Employee.EmployeeCode=WipWaster.EmployeeCode_Create '
                 +' Left Join Employee E1 On E1.EmployeeCode=WipWaster.EmployeeCode_Edit ';
   OrderByFields:='WipDate,ItemCode';
   Condition:='wipdate>='+QuotedStr(begindate);
   GetData;
   Frm_Sys_Detail:=TFrm_Sfc_WipWaster_D.Create(Self);
end;

function TFrm_Sfc_WipWaster.SetDeleteSql: String;
begin
  Result:='delete from WipWaster '+
                ' where wipdate='+QuotedStr(AdoQry_Main.fieldbyname('wipdate').AsString)+
                ' and DeptCode='+QuotedStr(AdoQry_Main.fieldbyname('DeptCode').AsString)+
                ' and shiftType='+QuotedStr(AdoQry_Main.fieldbyname('shiftType').AsString)+
                ' and mono='+QuotedStr(AdoQry_Main.fieldbyname('mono').AsString)+
                ' and MoLineno='+QuotedStr(AdoQry_Main.fieldbyname('MoLineno').AsString)+
                ' and ite_ItemCode='+QuotedStr(AdoQry_Main.fieldbyname('ite_ItemCode').AsString)+
                ' and ItemCode='+QuotedStr(AdoQry_Main.fieldbyname('ItemCode').AsString);
end;

procedure TFrm_Sfc_WipWaster.FormDestroy(Sender: TObject);
begin
  inherited;
  Frm_Sfc_WipWaster:=nil;
end;

end.

⌨️ 快捷键说明

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