mintax.cpp

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

CPP
61
字号
//---------------------------------------------------------------------------
#include <vcl.h>
#include "mInTax.h"
//---------------------------------------------------------------------------
#pragma hdrstop
#pragma package(smart_init)
TKSInTax *sdInTax;
//---------------------------------------------------------------------------
__fastcall TKSInTax::TKSInTax()
  :TKSMidBase()
{
}
//---------------------------------------------------------------------------
void __fastcall TKSInTax::ValidHeadValues()
{
    int m_InTaxLine;
    int b_InTaxLine;
    m_InTaxLine=GetMasterValue("InTaxLine");
    b_InTaxLine=GetMasterOldValue("InTaxLine");

    if(m_InTaxLine<0)
      throw Exception("行号不能为负");
    if(m_InTaxLine!=b_InTaxLine)
    {
      Query->Close();
      Query->SQL->Clear();
      Query->SQL->Add("SELECT InTaxLine FROM SDInTax WHERE InTaxLine='" +AnsiString(m_InTaxLine)+"'");
      Query->Open();
      if(Query->RecordCount>0)
      {
        Query->Close();
        throw Exception("行号'"+AnsiString(m_InTaxLine)+"'已存在");
      }
      Query->Close();
    }

    double m_InTaxBegAmt;
    m_InTaxBegAmt=GetMasterValue("InTaxBegAmt");
    if(m_InTaxBegAmt<0)
       throw Exception("起始金额不能小于零");

    double m_InTaxEndAmt;
    m_InTaxEndAmt=GetMasterValue("InTaxEndAmt");

    if(m_InTaxEndAmt<=0)
      throw Exception("结束金额不能小于等于零");
    if(m_InTaxEndAmt<=m_InTaxBegAmt)
      throw Exception("结束金额不能小于等于起始金额");

    double m_InTaxRate;
    m_InTaxRate=GetMasterValue("InTaxRate");
    if(m_InTaxRate<=0 ||m_InTaxRate>=100)
      throw Exception("税率不能小于等于'0'或大于等于'100'");
}
//---------------------------------------------------------------------------
void __fastcall TKSInTax::CmdExec(AnsiString Param)
{

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

⌨️ 快捷键说明

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