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

📄 mfause.cpp

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

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

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

#pragma package(smart_init)
TKSFaUse *sdFaUse;
//---------------------------------------------------------------------------
__fastcall TKSFaUse::TKSFaUse()
  :TKSMidBase()
{
}
//---------------------------------------------------------------------------
void __fastcall TKSFaUse::ValidHeadValues()
{
   AnsiString  m_FaUseCode;
   AnsiString  b_FaUseCode;
   m_FaUseCode=GetMasterValue("FaUseCode");
   b_FaUseCode=GetMasterOldValue("FaUseCode");
    if(m_FaUseCode.LowerCase().IsEmpty())
        throw Exception("使用状态编码不能为空");
    if(m_FaUseCode.LowerCase().Length()>18)
        throw Exception("使用状态编码长度不能大于18");

   AnsiString  m_FaUseName;
   AnsiString  b_FaUseName;
   m_FaUseName=GetMasterValue("FaUseName");
   b_FaUseName=GetMasterOldValue("FaUseName");
    if(m_FaUseName.LowerCase().IsEmpty())
        throw Exception("使用状态名称不能为空");
    if(m_FaUseName.LowerCase().Length()>20)
        throw Exception("使用状态名称长度不能大于20");
    if(m_FaUseName.LowerCase()!=b_FaUseName.LowerCase())
    {
        Query->Close();
        Query->SQL->Clear();
        Query->SQL->Add("SELECT FAUSEname FROM sdfaUse WHERE FAUSEname='" +m_FaUseName+"'");
        Query->Open();
        if(Query->RecordCount>0)
        {
            Query->Close();
            throw Exception("状态名称'"+m_FaUseName+"'已存在");
        }
        Query->Close();
    }

   int m_FaUseType;
   m_FaUseType=GetMasterValue("FaUseType");
    if(m_FaUseType!=1&&m_FaUseType!=2&&m_FaUseType!=3)
        throw Exception("状态类型只能取值 1-使用中,2-未使用,3-不需用");

   int m_FaUseDepre;
   m_FaUseDepre=GetMasterValue("FaUseDepre");
    if(m_FaUseDepre!=1&&m_FaUseDepre!=0)
        throw Exception("计提标志只能取值 0-不计提 1-计提");

   AnsiString  m_FaUseDesc;
   m_FaUseDesc=GetMasterValue("FaUseDesc");
    if(m_FaUseDesc.LowerCase().Length()>40)
        throw Exception("备注长度不能大于40");
}

//---------------------------------------------------------------------------
void __fastcall TKSFaUse::CmdExec(AnsiString Param)
{

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

⌨️ 快捷键说明

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