]> git.stg.codes - stg.git/commitdiff
Ticket. if (!data.tariffConf.changePolicy.empty()) construction added in
authorElena Mamontova <helenh463@gmail.com>
Wed, 13 Jul 2016 07:19:39 +0000 (10:19 +0300)
committerElena Mamontova <helenh463@gmail.com>
Wed, 13 Jul 2016 07:19:39 +0000 (10:19 +0300)
the Serialize() function.

stglibs/srvconf.lib/parsers/chg_tariff.cpp

index 158e6f890642af0a744525691ea825774e429901..5c6fd720128587cc60577af8d0c5f676481c462d 100644 (file)
@@ -69,6 +69,15 @@ if (!data.tariffConf.period.empty())
         case TARIFF::MONTH: stream << "<period value=\"month\"/>"; break;
         }
 
+if (!data.tariffConf.changePolicy.empty())
+    switch (data.tariffConf.changePolicy.data())
+        {
+        case TARIFF::DAY: stream << "<changePolicy value=\"allow\"/>"; break;
+        case TARIFF::MONTH: stream << "<changePolicy value=\"to_cheap\"/>"; break;
+        case TARIFF::MONTH: stream << "<changePolicy value=\"to_expensive\"/>"; break;
+        case TARIFF::MONTH: stream << "<changePolicy value=\"deny\"/>"; break;
+        }
+
 for (size_t i = 0; i < DIR_NUM; ++i)
     if (!data.dirPrice[i].hDay.empty() &&
         !data.dirPrice[i].mDay.empty() &&