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

📄 mfadn.cpp

📁 科思ERP部分源码及控件
💻 CPP
📖 第 1 页 / 共 2 页
字号:
    }
    else
    {
     if(m_FadnPeriod<=1)
       throw Exception("使用期限不能小于等于'1'");
     if(m_FadnAPeriod>m_FadnPeriod)
       throw Exception("累计使用期限不能大于使用期限");
     if(m_FadnBPeriod>m_FadnAPeriod)
       throw Exception("入帐前累计使用期限不能大于累计使用期限");
    }

   AnsiString  m_FadnUDate;
   m_FadnUDate=GetMasterValue("FadnUDate");
   m_FadnOfDate=GetMasterValue("FadnOfDate");
    if (m_FadnUDate.IsEmpty())
       throw Exception("使用日期不能为空");
    if(m_FadnUDate.Length()>18)
      throw Exception("使用日期长度不能超过18");
    if(StrToDate(m_FadnOfDate)>StrToDate(m_FadnUDate))
      throw Exception("使用日期不能早于出产日期");

   AnsiString  m_FadnAddType;
   AnsiString  b_FadnAddType;
   m_FadnAddType=GetMasterValue("FadnAddType");
   b_FadnAddType=GetMasterOldValue("FadnAddType");
    if (m_FadnAddType.IsEmpty())
       throw Exception("增加方式不能为空");
    if(m_FadnAddType.Length()>18)
      throw Exception("增加方式长度不能超过18");
    if (m_FadnAddType!=b_FadnAddType)
    {
      Query->Close();
      Query->SQL->Clear();
      Query->SQL->Add("SELECT favcode FROM sdfav where favcode='"+m_FadnAddType+"'");
      Query->Open();
      if(Query->RecordCount<1 )
      {
        Query->Close();
        throw Exception("增加方式 '"+m_FadnAddType+"' 未定义");
      }
      Query->Close();
    }

   int m_FadnStop;
   m_FadnStop=GetMasterValue("FadnStop");
    if(m_FadnStop!=1 &&m_FadnStop!=0)
        throw Exception("停用标志只能取 0-未停用 1-停用 ");

   int m_FadnDiscard;
   m_FadnDiscard=GetMasterValue("FadnDiscard");
    if(m_FadnDiscard!=1 &&m_FadnDiscard!=0)
        throw Exception("报废标志只能取 0-未报废 1-报废 ");

   int m_FadnRent;
   m_FadnRent=GetMasterValue("FadnRent");
    if(m_FadnRent!=1 &&m_FadnRent!=0)
        throw Exception("租出标志只能取 0-未租出 1-租出 ");

   int m_FadnFix;
   m_FadnFix=GetMasterValue("FadnFix");
    if(m_FadnFix!=1 &&m_FadnFix!=0)
        throw Exception("大修标志只能取 0-未大修 1-大修 ");

   int m_FadnDec;
   m_FadnDec=GetMasterValue("FadnDec");
    if(m_FadnDec!=1 &&m_FadnDec!=0)
        throw Exception("减少标志只能取 0-未减少 1-减少 ");

   int m_FadnAe;
   m_FadnAe=GetMasterValue("FadnAe");
    if(m_FadnAe!=1 &&m_FadnAe!=0)
        throw Exception("附属设备标志只能取 0-未有附属设备 1-有附属设备 ");

   int m_FadnFc;
   m_FadnFc=GetMasterValue("FadnFc");
    if(m_FadnFc!=1 &&m_FadnFc!=0)
        throw Exception("封存标志只能取 1-封存 0-未封存");

   AnsiString  m_FadnFvct;
   AnsiString  b_FadnFvct;
   m_FadnFvct=GetMasterValue("FadnFvct");
   b_FadnFvct=GetMasterOldValue("FadnFvct");
    if (m_FadnFvct.IsEmpty())
       throw Exception("凭证类型编码不能为空");
    if(m_FadnFvct.Length()>18)
      throw Exception("凭证类型编码长度不能超过18");
    if (m_FadnFvct!=b_FadnFvct)
    {
      Query->Close();
      Query->SQL->Clear();
      Query->SQL->Add("SELECT fvctcode FROM sdfvct where fvctcode='"+m_FadnFvct+"'");
      Query->Open();
      if(Query->RecordCount<1 )
      {
        Query->Close();
        throw Exception("凭证类型编码'"+m_FadnFvct+"'未定义");
      }
      Query->Close();
    }

   AnsiString  m_FadnYzGlkm;
   m_FadnYzGlkm=GetMasterValue("FadnYzGlkm");
    if(!m_FadnYzGlkm.IsEmpty())
    {
      if(m_FadnYzGlkm.Length()>18)
        throw Exception("科目编码长不能大于18");
      {
        Query->Close();
        Query->SQL->Clear();
        Query->SQL->Add("select * from sdGlkm where glkmcode='"+m_FadnYzGlkm+"' and glkmmx=1");
        Query->Open();
        if(Query->RecordCount<=0)
        {
          Query->Close();
          throw Exception("科目编码不存在或不是明细科目");
        }
        Query->Close();
      }
    }

  double m_FadnYzDir;
   m_FadnYzDir=GetMasterValue("FadnYzDir");
    if(m_FadnYzDir!=-1&&m_FadnYzDir!=1)
      throw Exception("科目方向只能取值 1-借方, -1-贷方");

   AnsiString  m_FadnZjGlkm;
   m_FadnZjGlkm=GetMasterValue("FadnZjGlkm");
    if(m_FadnZjGlkm.IsEmpty())
       throw Exception("折旧科目编码不能为空");
    if(m_FadnZjGlkm.Length()>18)
        throw Exception("科目编码长不能大于18");
    {
        Query->Close();
        Query->SQL->Clear();
        Query->SQL->Add("select * from sdGlkm where glkmcode='"+m_FadnZjGlkm+"' and glkmmx=1");
        Query->Open();
        if(Query->RecordCount<=0)
        {
          Query->Close();
          throw Exception("科目编码不存在或不是明细科目");
        }
        Query->Close();
    }

  double m_FadnZjDir;
   m_FadnZjDir=GetMasterValue("FadnZjDir");
    if(m_FadnZjDir!=-1&&m_FadnZjDir!=1)
      throw Exception("科目方向只能取值 1-借方, -1-贷方");

   AnsiString  m_FadnQoGlkm;
   m_FadnQoGlkm=GetMasterValue("FadnQoGlkm");
    if(!m_FadnQoGlkm.IsEmpty())
    {
      if(m_FadnQoGlkm.Length()>18)
        throw Exception("科目编码长不能大于18");
      {
        Query->Close();
        Query->SQL->Clear();
        Query->SQL->Add("select * from sdGlkm where glkmcode='"+m_FadnQoGlkm+"' and glkmmx=1");
        Query->Open();
        if(Query->RecordCount<=0)
        {
          Query->Close();
          throw Exception("科目编码不存在或不是明细科目");
        }
        Query->Close();
      }
    }

  double m_FadnQoDir;
   m_FadnQoDir=GetMasterValue("FadnQoDir");
    if(m_FadnQoDir!=-1&&m_FadnQoDir!=1)
      throw Exception("科目方向只能取值 1-借方, -1-贷方");

   AnsiString  m_FadnQiGlkm;
   m_FadnQiGlkm=GetMasterValue("FadnQiGlkm");
    if(!m_FadnQiGlkm.IsEmpty())
    {
      if(m_FadnQiGlkm.Length()>18)
        throw Exception("科目编码长不能大于18");
      {
        Query->Close();
        Query->SQL->Clear();
        Query->SQL->Add("select * from sdGlkm where glkmcode='"+m_FadnQiGlkm+"' and glkmmx=1");
        Query->Open();
        if(Query->RecordCount<=0)
        {
          Query->Close();
          throw Exception("科目编码不存在或不是明细科目");
        }
        Query->Close();
      }
    }

  double m_FadnQiDir;
   m_FadnQiDir=GetMasterValue("FadnQiDir");
    if(m_FadnQiDir!=-1&&m_FadnQiDir!=1)
      throw Exception("科目方向只能取值 1-借方, -1-贷方");

   AnsiString  m_FadnCzGlkm;
   m_FadnCzGlkm=GetMasterValue("FadnCzGlkm");
    if(!m_FadnCzGlkm.IsEmpty())
    {
      if(m_FadnCzGlkm.Length()>18)
        throw Exception("科目编码长不能大于18");
      {
        Query->Close();
        Query->SQL->Clear();
        Query->SQL->Add("select * from sdGlkm where glkmcode='"+m_FadnCzGlkm+"' and glkmmx=1");
        Query->Open();
        if(Query->RecordCount<=0)
        {
          Query->Close();
          throw Exception("科目编码不存在或不是明细科目");
        }
        Query->Close();
      }
    }

  double m_FadnCzDir;
   m_FadnCzDir=GetMasterValue("FadnCzDir");
    if(m_FadnCzDir!=-1&&m_FadnCzDir!=1)
      throw Exception("科目方向只能取值 1-借方, -1-贷方");

   AnsiString  m_FadnZlGlkm;
   m_FadnZlGlkm=GetMasterValue("FadnZlGlkm");
    if(!m_FadnZlGlkm.IsEmpty())
    {
      if(m_FadnZlGlkm.Length()>18)
        throw Exception("科目编码长不能大于18");
      {
        Query->Close();
        Query->SQL->Clear();
        Query->SQL->Add("select * from sdGlkm where glkmcode='"+m_FadnZlGlkm+"' and glkmmx=1");
        Query->Open();
        if(Query->RecordCount<=0)
        {
          Query->Close();
          throw Exception("科目编码不存在或不是明细科目");
        }
        Query->Close();
      }
    }

  double m_FadnZlDir;
   m_FadnZlDir=GetMasterValue("FadnZlDir");
    if(m_FadnZlDir!=-1&&m_FadnZlDir!=1)
      throw Exception("科目方向只能取值 1-借方, -1-贷方");
}
//---------------------------------------------------------------------------
void __fastcall TKSFadn::CmdExec(AnsiString Param)
{

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

⌨️ 快捷键说明

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