📄 mpdmh.cpp
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#include "mPdmh.h"
//---------------------------------------------------------------------------
#pragma hdrstop
#pragma package(smart_init)
TKSPdmh *sdPdmh;
//---------------------------------------------------------------------------
__fastcall TKSPdmh::TKSPdmh()
:TKSMidBase()
{
}
//---------------------------------------------------------------------------
void __fastcall TKSPdmh::ValidHeadValues()
{
//报废单号
ValidPdmhCode();
//月份
ValidPdmhFMonth();
//日期
ValidPdmhDate();
//收发存类型
ValidPdmhPosType();
//工单号
ValidPdmhWo();
//备注
ValidPdmhDesc();
//操作员
ValidPdmhUser();
//审核
ValidPdmhCheck();
//审核人
ValidPdmhChecker();
//审核日期
ValidPdmhCheckDate();
//状态
ValidPdmhState();
//系统日期
ValidPdmhSysDate();
}
//---------------------------------------------------------------------------
void __fastcall TKSPdmh::ValidPdmhCode() //报废单号
{
}
//---------------------------------------------------------------------------
void __fastcall TKSPdmh::ValidPdmhFMonth() //月份
{
AnsiString m_PdmhFMonth;
m_PdmhFMonth=GetMasterValue("PdmhFMonth");
if(m_PdmhFMonth.Length()>6)
throw Exception("财务月份的长度不能大于6!");
}
//---------------------------------------------------------------------------
void __fastcall TKSPdmh::ValidPdmhDate() //日期
{
}
//---------------------------------------------------------------------------
void __fastcall TKSPdmh::ValidPdmhPosType() //收发存类型
{
}
//---------------------------------------------------------------------------
void __fastcall TKSPdmh::ValidPdmhWo() //工单号
{
AnsiString m_PdmhWo;
AnsiString b_PdmhWo;
m_PdmhWo=GetMasterValue("PdmhWo");
b_PdmhWo=GetMasterOldValue("PdmhWo");
if(m_PdmhWo != b_PdmhWo)
{
Query->Close();
Query->SQL->Clear();
Query->SQL->Add("Select WoCode from sdWo where WoCheck=1 and WoClose=0 and WoCancel=0 and WoCode='"+m_PdmhWo+"'");
Query->Open();
if(Query->RecordCount==0)
{
Query->Close();
throw Exception("加工单:'"+m_PdmhWo+"'不存在,或已结清,或已作废,或未审核!");
}
Query->Close();
}
}
//---------------------------------------------------------------------------
void __fastcall TKSPdmh::ValidPdmhDesc() //备注
{
}
//---------------------------------------------------------------------------
void __fastcall TKSPdmh::ValidPdmhUser() //操作员
{
}
//---------------------------------------------------------------------------
void __fastcall TKSPdmh::ValidPdmhCheck() //审核
{
int m_PdmhCheck;
m_PdmhCheck=GetMasterValue("PdmhCheck");
if(m_PdmhCheck!=0 && m_PdmhCheck!=1)
throw Exception("审核的标志只能为(0-未审核,1-已审核.)");
}
//---------------------------------------------------------------------------
void __fastcall TKSPdmh::ValidPdmhChecker() //审核人
{
int m_PdmhCheck;
AnsiString m_PdmhChecker;
AnsiString b_PdmhChecker;
m_PdmhCheck=GetMasterValue("PdmhCheck");
m_PdmhChecker=GetMasterValue("PdmhChecker");
b_PdmhChecker=GetMasterOldValue("PdmhChecker");
if(m_PdmhCheck==1)
{
if(m_PdmhChecker!=b_PdmhChecker)
{
Query->Close();
Query->SQL->Clear();
Query->SQL->Add("SELECT ProducterCode from sdProducter where ProducterCode='"+m_PdmhChecker+"' and ProducterCheck=1");
Query->Open();
if(Query->RecordCount<=0)
{
Query->Close();
throw Exception("审核人'"+m_PdmhChecker+"'没有定义或无审核的权限!");
}
Query->Close();
}
}
}
//---------------------------------------------------------------------------
void __fastcall TKSPdmh::ValidPdmhCheckDate() //审核日期
{
}
//---------------------------------------------------------------------------
void __fastcall TKSPdmh::ValidPdmhState() //状态
{
}
//---------------------------------------------------------------------------
void __fastcall TKSPdmh::ValidPdmhSysDate() //系统日期
{
}
//---------------------------------------------------------------------------
void __fastcall TKSPdmh::ValidItemValues()
{
ValidPdmdCode();
ValidPdmdLine();
ValidPdmdProcess();
ValidPdmdLoc();
ValidPdmdGoods();
ValidPdmdUnit();
ValidPdmdQty();
ValidPdmdType();
ValidPdmdDesc();
}
//---------------------------------------------------------------------------
void __fastcall TKSPdmh::ValidPdmdCode()
{
}
//---------------------------------------------------------------------------
void __fastcall TKSPdmh::ValidPdmdLine()
{
int m_PdmdLine;
m_PdmdLine=GetDetailValue("PdmdLine");
if(m_PdmdLine<0 || m_PdmdLine==0)
throw Exception("行号不能小于和等于零!");
}
//---------------------------------------------------------------------------
void __fastcall TKSPdmh::ValidPdmdProcess()
{
AnsiString m_PdmdProcess;
AnsiString b_PdmdProcess;
AnsiString m_PdmhWo;
m_PdmdProcess=GetDetailValue("PdmdProcess");
b_PdmdProcess=GetDetailOldValue("PdmdProcess");
m_PdmhWo=GetMasterValue("PdmhWo");
if(m_PdmdProcess != b_PdmdProcess)
{
Query->Close();
Query->SQL->Clear();
Query->SQL->Add("Select WrgProcess from sdWrg where WrgWo='"+m_PdmhWo+"' and WrgProcess='"+m_PdmdProcess+"'");
Query->Open();
if(Query->RecordCount==0)
{
Query->Close();
throw Exception("工单:'"+m_PdmhWo+"'的工序代码:'"+m_PdmdProcess+"'资料不存在!");
}
Query->Close();
}
}
//---------------------------------------------------------------------------
void __fastcall TKSPdmh::ValidPdmdLoc()
{
}
//---------------------------------------------------------------------------
void __fastcall TKSPdmh::ValidPdmdGoods()
{
}
//---------------------------------------------------------------------------
void __fastcall TKSPdmh::ValidPdmdUnit()
{
}
//---------------------------------------------------------------------------
void __fastcall TKSPdmh::ValidPdmdQty()
{
double m_PdmdQty;
m_PdmdQty=GetDetailValue("PdmdQty");
if(m_PdmdQty<0 || m_PdmdQty==0)
throw Exception("材料报废的数量不能小于和等于零.");
}
//---------------------------------------------------------------------------
void __fastcall TKSPdmh::ValidPdmdType()
{
int m_PdmdType;
m_PdmdType=GetDetailValue("PdmdType");
if(m_PdmdType!=1 && m_PdmdType!=2)
throw Exception("报废类型只能取值1-工废,2-料废.");
}
//---------------------------------------------------------------------------
void __fastcall TKSPdmh::ValidPdmdDesc()
{
}
//---------------------------------------------------------------------------
void __fastcall TKSPdmh::CmdExec(AnsiString Param)
{
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -