📄 mrouteh.cpp
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#include "mRouteh.h"
//---------------------------------------------------------------------------
#pragma hdrstop
#pragma package(smart_init)
TKSRouteh *sdRouteh;
//---------------------------------------------------------------------------
__fastcall TKSRouteh::TKSRouteh()
:TKSMidBase()
{
}
//---------------------------------------------------------------------------
void __fastcall TKSRouteh::ValidHeadValues()
{
//工艺路线代码
ValidRoutehCode();
//名称
ValidRoutehName();
//物料编码
ValidRoutehGoods();
//说明
ValidRoutehDesc();
//关键路线
ValidRoutehKey();
//操作员
ValidRoutehUser();
//生管员
ValidRoutehProducter();
//取消
ValidRoutehCancel();
//取消日期
ValidRoutehCancelDate();
//开始日期
ValidRoutehEdate();
//结束日期
ValidRoutehIdate();
//系统时间
ValidRoutehSysDate();
}
//---------------------------------------------------------------------------
void __fastcall TKSRouteh::ValidRoutehCode() //工艺路线代码
{
}
//---------------------------------------------------------------------------
void __fastcall TKSRouteh::ValidRoutehName() //名称
{
}
//---------------------------------------------------------------------------
void __fastcall TKSRouteh::ValidRoutehGoods() //物料编码
{
}
//---------------------------------------------------------------------------
void __fastcall TKSRouteh::ValidRoutehDesc() //说明
{
}
//---------------------------------------------------------------------------
void __fastcall TKSRouteh::ValidRoutehKey() //关键路线
{
int m_RoutehKey;
AnsiString m_RoutehGoods,b_RoutehGoods;
m_RoutehKey=GetMasterValue("RoutehKey");
m_RoutehGoods=GetMasterValue("RoutehGoods");
b_RoutehGoods=GetMasterOldValue("RoutehGoods");
if(m_RoutehKey!=0 && m_RoutehKey!=1)
throw Exception("关键路线的标志只能为(0-非关键路线,1-关键路线.)");
if(m_RoutehKey==1 && m_RoutehGoods.UpperCase()!=b_RoutehGoods.UpperCase())
{
Query->Close();
Query->SQL->Clear();
Query->SQL->Add("select RoutehGoods from sdRouteh where RoutehGoods='"+m_RoutehGoods+"' and RoutehKey='"+AnsiString(m_RoutehKey)+"'");
Query->Open();
if(Query->RecordCount>0)
{
Query->Close();
throw Exception("货物编码:'"+m_RoutehGoods+"'已经定义为关键路线!");
}
Query->Close();
}
}
//---------------------------------------------------------------------------
void __fastcall TKSRouteh::ValidRoutehUser() //操作员
{
}
//---------------------------------------------------------------------------
void __fastcall TKSRouteh::ValidRoutehProducter() //生管员
{
}
//---------------------------------------------------------------------------
void __fastcall TKSRouteh::ValidRoutehCancel() //取消
{
int m_RoutehCancel;
m_RoutehCancel=GetMasterValue("RoutehCancel");
if(m_RoutehCancel!=0 && m_RoutehCancel!=1)
throw Exception("工艺路线作废的标识只能是0-未作废,1-已作废.");
}
//---------------------------------------------------------------------------
void __fastcall TKSRouteh::ValidRoutehCancelDate() //取消日期
{
}
//---------------------------------------------------------------------------
void __fastcall TKSRouteh::ValidRoutehEdate() //开始日期
{
}
//---------------------------------------------------------------------------
void __fastcall TKSRouteh::ValidRoutehIdate() //结束日期
{
AnsiString m_RoutehIdate;
AnsiString m_RoutehEdate;
m_RoutehIdate=GetMasterValue("RoutehIdate");
m_RoutehEdate=GetMasterValue("RoutehEdate");
if(m_RoutehIdate.IsEmpty()==false)
if(m_RoutehIdate<=m_RoutehEdate)
throw Exception("失效日期不能小于等于生效日期!");
}
//---------------------------------------------------------------------------
void __fastcall TKSRouteh::ValidRoutehSysDate() //系统时间
{
}
//---------------------------------------------------------------------------
void __fastcall TKSRouteh::ValidItemValues()
{
ValidRoutedSn();
ValidRoutedCode();
ValidRoutedProcess();
ValidRoutedWc();
ValidRoutedName();
ValidRoutedLoc();
ValidRoutedState();
ValidRoutedChkFlg();
ValidRoutedWxFlg();
ValidRoutedWxAmt();
ValidRoutedType();
ValidRoutedSpec();
ValidRoutedQlt();
ValidRoutedSlt();
ValidRoutedRlt();
ValidRoutedWlt();
ValidRoutedMlt();
ValidRoutedDesc();
}
//---------------------------------------------------------------------------
void __fastcall TKSRouteh::ValidRoutedSn()
{
int m_RoutedSn;
m_RoutedSn=GetDetailValue("RoutedSn");
if(m_RoutedSn <= 0)
throw Exception("工艺路线单的序号不能小于等于零!");
}
//---------------------------------------------------------------------------
void __fastcall TKSRouteh::ValidRoutedCode()
{
}
//---------------------------------------------------------------------------
void __fastcall TKSRouteh::ValidRoutedProcess()
{
AnsiString m_RoutehCode;
AnsiString m_RoutedProcess;
AnsiString b_RoutedProcess;
m_RoutehCode=GetMasterValue("RoutehCode");
m_RoutedProcess=GetDetailValue("RoutedProcess");
b_RoutedProcess=GetDetailOldValue("RoutedProcess");
if(m_RoutedProcess.UpperCase()!=b_RoutedProcess.UpperCase())
{
//only property
Query->Close();
Query->SQL->Clear();
Query->SQL->Add("select * from sdRouted where RoutedCode='"+m_RoutehCode+"' and RoutedProcess='"+m_RoutedProcess+"'");
Query->Open();
if(Query->RecordCount>0)
{
Query->Close();
throw Exception("工艺路线维护中,工序代码:'"+m_RoutedProcess+"'已存在!");
}
//exist Property
Query->Close();
Query->SQL->Clear();
AnsiString m_Sql=AnsiString("SELECT ProcessCode FROM sdProcess WHERE ProcessCode='"+m_RoutedProcess+"'");
Query->SQL->Add(m_Sql);
Query->Open();
if(Query->RecordCount<=0)
{
Query->Close();
throw Exception("工序代码:'"+m_RoutedProcess+"'的资料不存在!");
}
}
}
//---------------------------------------------------------------------------
void __fastcall TKSRouteh::ValidRoutedWc()
{
}
//---------------------------------------------------------------------------
void __fastcall TKSRouteh::ValidRoutedName()
{
}
//---------------------------------------------------------------------------
void __fastcall TKSRouteh::ValidRoutedLoc()
{
}
//---------------------------------------------------------------------------
void __fastcall TKSRouteh::ValidRoutedState()
{
}
//---------------------------------------------------------------------------
void __fastcall TKSRouteh::ValidRoutedChkFlg()
{
int m_RoutedChkFlg;
m_RoutedChkFlg=GetDetailValue("RoutedChkFlg");
if(m_RoutedChkFlg!=0 && m_RoutedChkFlg!=1)
throw Exception("检验标识只能为(0-需检验,1-不须检验.)");
}
//---------------------------------------------------------------------------
void __fastcall TKSRouteh::ValidRoutedWxFlg()
{
int m_RoutedWxFlg;
m_RoutedWxFlg=GetDetailValue("RoutedWxFlg");
if(m_RoutedWxFlg!=0 && m_RoutedWxFlg!=1)
throw Exception("外协标识只能为(0-标准工序,1-外协工序.)");
}
//---------------------------------------------------------------------------
void __fastcall TKSRouteh::ValidRoutedWxAmt()
{
double m_RoutedWxAmt;
int m_RoutedWxFlg;
m_RoutedWxAmt=GetDetailValue("RoutedWxAmt");
m_RoutedWxFlg=GetDetailValue("RoutedWxFlg");
if(m_RoutedWxFlg==1)
if(m_RoutedWxAmt<0 ||m_RoutedWxAmt==0)
throw Exception("当属于外协工序时,外协费率不能小于和等于零!");
}
//---------------------------------------------------------------------------
void __fastcall TKSRouteh::ValidRoutedType()
{
}
//---------------------------------------------------------------------------
void __fastcall TKSRouteh::ValidRoutedSpec()
{
}
//---------------------------------------------------------------------------
void __fastcall TKSRouteh::ValidRoutedQlt()
{
double m_RoutedQlt;
m_RoutedQlt=GetDetailValue("RoutedQlt");
if(m_RoutedQlt<0)
throw Exception("排队时间不能小于零!");
}
//---------------------------------------------------------------------------
void __fastcall TKSRouteh::ValidRoutedSlt()
{
double m_RoutedSlt;
m_RoutedSlt=GetDetailValue("RoutedSlt");
if(m_RoutedSlt<0)
throw Exception("准备时间不能小于零!");
}
//---------------------------------------------------------------------------
void __fastcall TKSRouteh::ValidRoutedRlt()
{
double m_RoutedRlt;
m_RoutedRlt=GetDetailValue("RoutedRlt");
if(m_RoutedRlt<0)
throw Exception("加工时间不能小于零!");
}
//---------------------------------------------------------------------------
void __fastcall TKSRouteh::ValidRoutedWlt()
{
double m_RoutedWlt;
m_RoutedWlt=GetDetailValue("RoutedWlt");
if(m_RoutedWlt<0)
throw Exception("等待时间不能小于零!");
}
//---------------------------------------------------------------------------
void __fastcall TKSRouteh::ValidRoutedMlt()
{
double m_RoutedMlt;
m_RoutedMlt=GetDetailValue("RoutedMlt");
if(m_RoutedMlt<0)
throw Exception("移动时间不能小于零!");
}
//---------------------------------------------------------------------------
void __fastcall TKSRouteh::ValidRoutedDesc()
{
}
//---------------------------------------------------------------------------
void __fastcall TKSRouteh::CmdExec(AnsiString Param)
{
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -