📄 emhdl.cpp
字号:
{
m_Query->Close();
throw Exception("增加方式 '"+value+"' 未定义");
}
m_Query->Close();
}
m_FadnAddType=value;
}
void __fastcall TsdFadn:: SetFadnDecType(AnsiString value)
{
m_FadnDecType=value;
}
void __fastcall TsdFadn:: SetFadnStop(int value)
{
if(value!=1 &&value!=0)
throw Exception("停用标志只能取 0-未停用 1-停用 ");
m_FadnStop=value;
}
void __fastcall TsdFadn:: SetFadnDiscard(int value)
{
if(value!=1 &&value!=0)
throw Exception("报废标志只能取 0-未报废 1-报废 ");
m_FadnDiscard=value;
}
void __fastcall TsdFadn:: SetFadnRent(int value)
{
if(value!=1 &&value!=0)
throw Exception("租出标志只能取 0-未租出 1-租出 ");
m_FadnRent=value;
}
void __fastcall TsdFadn:: SetFadnFix(int value)
{
if(value!=1 &&value!=0)
throw Exception("大修标志只能取 0-未大修 1-大修 ");
m_FadnFix=value;
}
void __fastcall TsdFadn:: SetFadnDec(int value)
{
if(value!=1 &&value!=0)
throw Exception("减少标志只能取 0-未减少 1-减少 ");
m_FadnDec=value;
}
void __fastcall TsdFadn:: SetFadnAe(int value)
{
if(value!=1 &&value!=0)
throw Exception("附属设备标志只能取 0-未有附属设备 1-有附属设备 ");
m_FadnAe=value;
}
void __fastcall TsdFadn:: SetFadnFc(int value)
{
if(value!=1 &&value!=0)
throw Exception("封存标志只能取 1-封存 0-未封存");
m_FadnFc=value;
}
void __fastcall TsdFadn:: SetFadnFvct(AnsiString value)
{
if (value.IsEmpty())
throw Exception("凭证类型编码不能为空");
if(value.Length()>18)
throw Exception("凭证类型编码长度不能超过18。");
if (value!=m_FadnFvct)
{
m_Query->Close();
m_Query->SQL->Clear();
m_Query->SQL->Add("SELECT fvctcode FROM sdfvct where fvctcode='"+value+"'");
m_Query->Open();
if(m_Query->RecordCount<1 )
{
m_Query->Close();
throw Exception("凭证类型编码'"+value+"'未定义");
}
m_Query->Close();
}
m_FadnFvct=value;
}
void __fastcall TsdFadn:: SetFadnYzGlkm(AnsiString value)
{
if(!value.IsEmpty())
{
if(value.Length()>18)
throw Exception("科目编码长不能大于18");
if(m_FadnYzGlkm!=value)
{
m_Query->Close();
m_Query->SQL->Clear();
m_Query->SQL->Add("select * from sdGlkm where glkmcode='"+value+"' and glkmmx=1");
m_Query->Open();
if(m_Query->RecordCount<=0)
{
m_Query->Close();
throw Exception("科目编码不存在或不是明细科目");
}
m_Query->Close();
}
}
m_FadnYzGlkm=value;
}
void __fastcall TsdFadn:: SetFadnYzDir(double value)
{
if(value!=-1&&value!=1)
throw Exception("科目方向只能取值 1-借方, -1-贷方");
m_FadnYzDir=value;
}
void __fastcall TsdFadn:: SetFadnZjGlkm(AnsiString value)
{
if(value.IsEmpty())
throw Exception("折旧科目编码不能为空");
if(value.Length()>18)
throw Exception("科目编码长不能大于18");
if(m_FadnZjGlkm!=value)
{
m_Query->Close();
m_Query->SQL->Clear();
m_Query->SQL->Add("select * from sdGlkm where glkmcode='"+value+"' and glkmmx=1");
m_Query->Open();
if(m_Query->RecordCount<=0)
{
m_Query->Close();
throw Exception("科目编码不存在或不是明细科目");
}
m_Query->Close();
}
m_FadnZjGlkm=value;
}
void __fastcall TsdFadn:: SetFadnZjDir(double value)
{
if(value!=-1&&value!=1)
throw Exception("科目方向只能取值 1-借方, -1-贷方");
m_FadnZjDir=value;
}
void __fastcall TsdFadn:: SetFadnQoGlkm(AnsiString value)
{
if(!value.IsEmpty())
{
if(value.Length()>18)
throw Exception("科目编码长不能大于18");
if(m_FadnQoGlkm!=value)
{
m_Query->Close();
m_Query->SQL->Clear();
m_Query->SQL->Add("select * from sdGlkm where glkmcode='"+value+"' and glkmmx=1");
m_Query->Open();
if(m_Query->RecordCount<=0)
{
m_Query->Close();
throw Exception("科目编码不存在或不是明细科目");
}
m_Query->Close();
}
}
m_FadnQoGlkm=value;
}
void __fastcall TsdFadn:: SetFadnQoDir(double value)
{
if(value!=-1&&value!=1)
throw Exception("科目方向只能取值 1-借方, -1-贷方");
m_FadnQoDir=value;
}
void __fastcall TsdFadn:: SetFadnQiGlkm(AnsiString value)
{
if(!value.IsEmpty())
{
if(value.Length()>18)
throw Exception("科目编码长不能大于18");
if(m_FadnQiGlkm!=value)
{
m_Query->Close();
m_Query->SQL->Clear();
m_Query->SQL->Add("select * from sdGlkm where glkmcode='"+value+"' and glkmmx=1");
m_Query->Open();
if(m_Query->RecordCount<=0)
{
m_Query->Close();
throw Exception("科目编码不存在或不是明细科目");
}
m_Query->Close();
}
}
m_FadnQiGlkm=value;
}
void __fastcall TsdFadn:: SetFadnQiDir(double value)
{
if(value!=-1&&value!=1)
throw Exception("科目方向只能取值 1-借方, -1-贷方");
m_FadnQiDir=value;
}
void __fastcall TsdFadn:: SetFadnCzGlkm(AnsiString value)
{
if(!value.IsEmpty())
{
if(value.Length()>18)
throw Exception("科目编码长不能大于18");
if(m_FadnCzGlkm!=value)
{
m_Query->Close();
m_Query->SQL->Clear();
m_Query->SQL->Add("select * from sdGlkm where glkmcode='"+value+"' and glkmmx=1");
m_Query->Open();
if(m_Query->RecordCount<=0)
{
m_Query->Close();
throw Exception("科目编码不存在或不是明细科目");
}
m_Query->Close();
}
}
m_FadnCzGlkm=value;
}
void __fastcall TsdFadn:: SetFadnCzDir(double value)
{
if(value!=-1&&value!=1)
throw Exception("科目方向只能取值 1-借方, -1-贷方");
m_FadnCzDir=value;
}
void __fastcall TsdFadn:: SetFadnZlGlkm(AnsiString value)
{
if(!value.IsEmpty())
{
if(value.Length()>18)
throw Exception("科目编码长不能大于18");
if(m_FadnZlGlkm!=value)
{
m_Query->Close();
m_Query->SQL->Clear();
m_Query->SQL->Add("select * from sdGlkm where glkmcode='"+value+"' and glkmmx=1");
m_Query->Open();
if(m_Query->RecordCount<=0)
{
m_Query->Close();
throw Exception("科目编码不存在或不是明细科目");
}
m_Query->Close();
}
}
m_FadnZlGlkm=value;
}
void __fastcall TsdFadn:: SetFadnZlDir(double value)
{
if(value!=-1&&value!=1)
throw Exception("科目方向只能取值 1-借方, -1-贷方");
m_FadnZlDir=value;
}
//---------------------------------------------------------------------------
AnsiString TsdFadn::GetFieldValue(euFadn sdFieldName)
{
switch(sdFieldName)
{
case fiFadnCode:
return FadnCode;
case fiFadnName:
return FadnName;
case fiFadnDesc:
return FadnDesc;
case fiFadnFat:
return FadnFat;
case fiFadnUnit:
return FadnUnit;
case fiFadnDate:
return FadnDate;
case fiFadnFmonth:
return FadnFmonth;
case fiFadnFaUse:
return FadnFaUse;
case fiFadnAddr:
return FadnAddr;
case fiFadnEuse:
return FadnEuse;
case fiFadnFav:
return FadnFav;
case fiFadnModel:
return FadnModel;
case fiFadnSupply:
return FadnSupply;
case fiFadnFactory:
return FadnFactory;
case fiFadnArea:
return FadnArea;
case fiFadnOfDate:
return FadnOfDate;
case fiFadnDept:
return FadnDept;
case fiFadnCurrency:
return FadnCurrency;
case fiFadnERate:
return FadnERate;
case fiFadnOVal:
return FadnOVal;
case fiFadnWbOVal:
return FadnWbOVal;
case fiFadnPVal:
return FadnPVal;
case fiFadnEVal:
return FadnEVal;
case fiFadnCVal:
return FadnCVal;
case fiFadnDVal:
return FadnDVal;
case fiFadnBVal:
return FadnBVal;
case fiFadnTWork:
return FadnTWork;
case fiFadnAWork:
return FadnAWork;
case fiFadnBWork:
return FadnBWork;
case fiFadnPeriod:
return FadnPeriod;
case fiFadnAPeriod:
return FadnAPeriod;
case fiFadnBPeriod:
return FadnBPeriod;
case fiFadnFadm:
return FadnFadm;
case fiFadnUDate:
return FadnUDate;
case fiFadnAddType:
return FadnAddType;
case fiFadnDecType:
return FadnDecType;
case fiFadnStop:
return FadnStop;
case fiFadnDiscard:
return FadnDiscard;
case fiFadnRent:
return FadnRent;
case fiFadnFix:
return FadnFix;
case fiFadnDec:
return FadnDec;
case fiFadnAe:
return FadnAe;
case fiFadnFc:
return FadnFc;
case fiFadnFvct:
return FadnFvct;
case fiFadnYzGlkm:
return FadnYzGlkm;
case fiFadnYzDir:
return FadnYzDir;
case fiFadnZjGlkm:
return FadnZjGlkm;
case fiFadnZjDir:
return FadnZjDir;
case fiFadnQoGlkm:
return FadnQoGlkm;
case fiFadnQoDir:
return FadnQoDir;
case fiFadnQiGlkm:
return FadnQiGlkm;
case fiFadnQiDir:
return FadnQiDir;
case fiFadnCzGlkm:
return FadnCzGlkm;
case fiFadnCzDir:
return FadnCzDir;
case fiFadnZlGlkm:
return FadnZlGlkm;
case fiFadnZlDir:
return FadnZlDir;
default:
throw Exception("当前未定义可取值");
}
}
//---------------------------------------------------------------------------
void TsdFadn::SetFieldValue(euFadn sdFieldName, AnsiString value)
{
switch(sdFieldName)
{
case fiFadnCode:
FadnCode=value;
break;
case fiFadnName:
FadnName=value;
break;
case fiFadnDesc:
FadnDesc=value;
break;
case fiFadnFat:
FadnFat=value;
break;
case fiFadnUnit:
FadnUnit=value;
break;
case fiFadnDate:
FadnDate=value;
break;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -