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

📄 mlop.cpp

📁 科思ERP部分源码及控件
💻 CPP
字号:
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop
#include "mLop.h"

//---------------------------------------------------------------------------

#pragma package(smart_init)
TKSLop *sdLop;
//---------------------------------------------------------------------------
__fastcall TKSLop::TKSLop()
  :TKSMidBase()
{
}
//---------------------------------------------------------------------------
void __fastcall TKSLop::ValidHeadValues()
{
   AnsiString  m_LopCode;
   AnsiString  b_LopCode;
   m_LopCode=GetMasterValue("LopCode");
   b_LopCode=GetMasterOldValue("LopCode");
    if(m_LopCode.IsEmpty())
      throw Exception("离职单号不能为空");
    if(m_LopCode.UpperCase()!=b_LopCode.UpperCase())
    {
      Query->Close();
      Query->SQL->Clear();
      Query->SQL->Add(" SELECT LopCode from sdLop where LopCode='"+m_LopCode+"'");
      Query->Open();
      if(Query->RecordCount >0)
      {
        Query->Close();
        throw Exception("该离职单号'"+m_LopCode+"'已存在");
      }
      Query->Close();
    }

   AnsiString  m_LopEmployee;
   AnsiString  b_LopEmployee;
   m_LopEmployee=GetMasterValue("LopEmployee");
   b_LopEmployee=GetMasterOldValue("LopEmployee");
    if(m_LopEmployee.IsEmpty())
      throw Exception("员工编号不能为空");
    if(m_LopEmployee!=b_LopEmployee)
    {
      Query->Close();
      Query->SQL->Clear();
      Query->SQL->Add("select EmployeeCode from sdEmployee where EmployeeCode='"+m_LopEmployee+"' and EmployeeState=0");
      Query->Open();
      if(Query->RecordCount<1)
      {
        Query->Close();
        throw Exception("该员工号'"+m_LopEmployee+"'不存在或已离职");
      }
      Query->Close();
    }

   AnsiString  m_LopAdate;
   m_LopAdate=GetMasterValue("LopAdate");
    if(m_LopAdate.IsEmpty())
      throw Exception("申请日期不能为空");

   AnsiString  m_LopRdate;
   m_LopRdate=GetMasterValue("LopRdate");
    if(m_LopRdate.IsEmpty())
      throw Exception("要求离职日期不能为空");
    if(m_LopRdate < GetMasterValue("LopAdate"))
      throw Exception("要求离职日期不能小于申请日期");

   AnsiString  m_LopLdate;
   m_LopLdate=GetMasterValue("LopLdate");
    if(m_LopLdate.IsEmpty())
      throw Exception("实际离职日期不能为空");
 //     throw Exception("实际离职日期应在录入日期之前");
 //     throw Exception("实际离职日期不能小于申请日期");

   AnsiString  m_LopCdate;
   m_LopCdate=GetMasterValue("LopCdate");
    if(m_LopCdate.IsEmpty())
      throw Exception("批准日期不能为空");
    if(m_LopCdate<GetMasterValue("LopAdate"))
      throw Exception("批准日期不能小于申请日期");

   AnsiString  m_LopMgr;
   m_LopMgr=GetMasterValue("LopMgr");
    if(m_LopMgr.IsEmpty())
      throw Exception("离职单的主管不能为空");

   int m_LopState;
   m_LopState=GetMasterValue("LopState");
    if(m_LopState!=0 && m_LopState!=1)
      throw Exception("离职单的状态取值为(0-预备,1-确认)");

   AnsiString  m_LopUser;
   m_LopUser=GetMasterValue("LopUser");
    if(m_LopUser.IsEmpty())
      throw Exception("操作员代码不能为空");

   AnsiString  m_LopLr;
   m_LopLr=GetMasterValue("LopLr");
    if(m_LopLr.IsEmpty())
      throw Exception("离职代码不能为空");
}
//---------------------------------------------------------------------------
void __fastcall TKSLop::CmdExec(AnsiString Param)
{

}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

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