Reworked.
This commit is contained in:
@@ -65,7 +65,7 @@ namespace Apostol {
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------------------------
|
||||
|
||||
CString DateToString(const CDateTime &Value, const CString &Format) {
|
||||
CString DateToString(CDateTime Value, const CString &Format) {
|
||||
TCHAR Buffer[25] = {0};
|
||||
DateTimeToStr(Value, Buffer, sizeof(Buffer), Format.c_str());
|
||||
return Buffer;
|
||||
@@ -226,9 +226,9 @@ namespace Apostol {
|
||||
CDealType CDeal::StringToType(const CString &Value) {
|
||||
const auto &status = Value.Lower();
|
||||
|
||||
if (status.Find("prepaid") != CString::npos || status.Find("prepayment") != CString::npos) {
|
||||
if (status.Find("prepayment") != CString::npos || status.Find("prepaid") != CString::npos) {
|
||||
return dtPrepaid;
|
||||
} else if (status.Find("postpaid") != CString::npos || status.Find("postpayment") != CString::npos) {
|
||||
} else if (status.Find("postpayment") != CString::npos || status.Find("postpaid") != CString::npos) {
|
||||
return dtPostpaid;
|
||||
} else {
|
||||
throw ExceptionFrm(R"(Invalid order type value: "%s".)", status.c_str());
|
||||
@@ -239,9 +239,9 @@ namespace Apostol {
|
||||
CString CDeal::TypeToString(CDealType Type) {
|
||||
switch (Type) {
|
||||
case dtPrepaid:
|
||||
return "Prepaid";
|
||||
return "Prepayment";
|
||||
case dtPostpaid:
|
||||
return "Postpaid";
|
||||
return "Postpayment";
|
||||
default:
|
||||
return "Unknown";
|
||||
}
|
||||
@@ -250,9 +250,9 @@ namespace Apostol {
|
||||
|
||||
CString CDeal::TypeCodeToString(const CString &Code) {
|
||||
if (Code == "prepaid.deal") {
|
||||
return CString("Prepaid");
|
||||
return {"Prepayment"};
|
||||
} else if (Code == "postpaid.deal") {
|
||||
return CString("Postpaid");
|
||||
return {"Postpayment"};
|
||||
} else {
|
||||
throw ExceptionFrm(R"(Invalid type code value: "%s".)", Code.c_str());
|
||||
}
|
||||
@@ -526,7 +526,6 @@ namespace Apostol {
|
||||
}
|
||||
}
|
||||
|
||||
using namespace Apostol::Deal;
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif // __cplusplus
|
||||
|
||||
Reference in New Issue
Block a user