Configuration::ParseJson():
Call parseWeekDay() to reading the week-day-settings.
This commit is contained in:
parent
c6b8a37263
commit
f24f1fe646
@ -459,6 +459,36 @@ bool Configuration::ParseJson(Configuration* cfg, const char* json)
|
||||
{
|
||||
case MemberType::UnknownType:
|
||||
break;
|
||||
case MemberType::WeekDaysType: {
|
||||
ATBWeekDay WeekDay;
|
||||
if (QString(mb_name) == "Monday") {
|
||||
WeekDay = parseWeekDay(*cfg, k, inner_obj_name, Qt::Monday, mb_name);
|
||||
} else
|
||||
if (QString(mb_name) == "Tuesday") {
|
||||
WeekDay = parseWeekDay(*cfg, k, inner_obj_name, Qt::Tuesday, mb_name);
|
||||
} else
|
||||
if (QString(mb_name) == "Wednesday") {
|
||||
WeekDay = parseWeekDay(*cfg, k, inner_obj_name, Qt::Wednesday, mb_name);
|
||||
} else
|
||||
if (QString(mb_name) == "Thursday") {
|
||||
WeekDay = parseWeekDay(*cfg, k, inner_obj_name, Qt::Thursday, mb_name);
|
||||
} else
|
||||
if (QString(mb_name) == "Friday") {
|
||||
WeekDay = parseWeekDay(*cfg, k, inner_obj_name, Qt::Friday, mb_name);
|
||||
} else
|
||||
if (QString(mb_name) == "Saturday") {
|
||||
WeekDay = parseWeekDay(*cfg, k, inner_obj_name, Qt::Saturday, mb_name);
|
||||
} else
|
||||
if (QString(mb_name) == "Sunday") {
|
||||
WeekDay = parseWeekDay(*cfg, k, inner_obj_name, Qt::Sunday, mb_name);
|
||||
} else {
|
||||
qCritical() << "ERROR: unknown week day" << mb_name;
|
||||
}
|
||||
|
||||
cfg->WeekDays.insert(pair<Qt::DayOfWeek, ATBWeekDay>(WeekDay.m_id, WeekDay));
|
||||
// qCritical() << WeekDay;
|
||||
|
||||
} break;
|
||||
case MemberType::CarryOverType: {
|
||||
if (QString(inner_obj_name) == QString("carry_over_id")) {
|
||||
if (k->value.IsInt()) {
|
||||
@ -1062,6 +1092,11 @@ bool Configuration::ParseJson(Configuration* cfg, const char* json)
|
||||
switch (mb_type) {
|
||||
case MemberType::UnknownType:
|
||||
break;
|
||||
case MemberType::WeekDaysType:
|
||||
// qCritical() << "INSERT" << (int)WeekDay.m_id << WeekDay.m_date.toString(Qt::ISODate);
|
||||
// cfg->WeekDays.insert(pair<Qt::DayOfWeek, ATBWeekDay>(WeekDay.m_id, WeekDay));
|
||||
// qCritical() << WeekDay;
|
||||
break;
|
||||
case MemberType::PaymentMethodType:
|
||||
cfg->PaymentMethod.insert(pair<int, ATBPaymentMethod>(PaymentMethod.pme_id, PaymentMethod));
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user