mcd.cpp

来自「一个以前收集的基于C/S架构的ERP客户端源代码」· C++ 代码 · 共 89 行

CPP
89
字号
//---------------------------------------------------------------------------

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

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

#pragma package(smart_init)
TKSCd *sdCd;
//---------------------------------------------------------------------------
__fastcall TKSCd::TKSCd()
  :TKSMidBase()
{
}
//---------------------------------------------------------------------------
void __fastcall TKSCd::ValidHeadValues()
{

    AnsiString l_CdFmonth;
    AnsiString l_CurFmonth;
    l_CdFmonth=GetMasterValue("CdFmonth");
    if(l_CdFmonth.IsEmpty())
      throw Exception("财务月份不能为空");
      Query->Close();
      Query->SQL->Clear();
      Query->SQL->Add("select fcmonth from sdfc where fcmonth='"+l_CdFmonth+"'");
      Query->Open();
      if(Query->RecordCount<=0)
      {
        Query->Close();
        throw Exception("财务月份:"+l_CdFmonth+"未定义");
      }
      Query->Close();
      Query->SQL->Clear();
      Query->SQL->Add("select fcmonth from sdfc where fccurrent=1");
      Query->Open();
      if(Query->RecordCount<=0)
      {
        Query->Close();
        throw Exception("未定义当前财务月份");
      }
      l_CurFmonth=Query->FieldValues["FcMonth"];
      if(l_CdFmonth<l_CurFmonth)
      {
        Query->Close();
        throw Exception("财务月份不能小于当前月份");
      }
      Query->Close();

   AnsiString l_CdGoods;
   l_CdGoods=GetMasterValue("CdGoods");
   if(l_CdGoods.IsEmpty())
      throw Exception("物料编码不能为空");
    if(l_CdGoods.Length()>18)
      throw Exception("物料编码长度不能大于18");
      Query->Close();
      Query->SQL->Clear();
      Query->SQL->Add("select goodsName from sdgoods where goodsCode='"+l_CdGoods+"'");
      Query->Open();
      if(Query->RecordCount<=0)
      {
        Query->Close();
        throw Exception("物料编码 "+l_CdGoods+"未定义");
      }
      Query->Close();

    AnsiString l_CdBopPrice;
    l_CdBopPrice=GetMasterValue("CdBopPrice");
    if(l_CdBopPrice<0)
      throw Exception("期初单价不能小于零");

    AnsiString l_CdBopAmt;
    l_CdBopAmt=GetMasterValue("CdBopAmt");
    if(l_CdBopAmt<0)
      throw Exception("期初金额不能小于零");

    int l_CdInitFlg;
    l_CdInitFlg=GetMasterValue("CdInitFlg");
    if(l_CdInitFlg!=0 && l_CdInitFlg!=1)
      throw Exception("初始化标志只能取值0-未初始化1-已初始化");
}
//---------------------------------------------------------------------------
void __fastcall TKSCd::CmdExec(AnsiString Param)
{

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

⌨️ 快捷键说明

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