diff --git a/library/src/configuration.cpp b/library/src/configuration.cpp index b2c3ddc..8d0c255 100644 --- a/library/src/configuration.cpp +++ b/library/src/configuration.cpp @@ -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(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(WeekDay.m_id, WeekDay)); + // qCritical() << WeekDay; + break; case MemberType::PaymentMethodType: cfg->PaymentMethod.insert(pair(PaymentMethod.pme_id, PaymentMethod)); break;