]> git.stg.codes - stg.git/commitdiff
Ticket 37. if (schemaVersion > 1) check added and td->tariffConf.changePolicy variable
authorElena Mamontova <helenh463@gmail.com>
Tue, 21 Jun 2016 08:30:50 +0000 (11:30 +0300)
committerElena Mamontova <helenh463@gmail.com>
Tue, 21 Jun 2016 08:30:50 +0000 (11:30 +0300)
value assignment added in the RestoreTariff() function.

projects/stargazer/plugins/store/mysql/mysql_store.cpp

index 37da860b94f627244265f9d9ced24e76f37f0548..754a9ee223483094ca8dd90437a3a275bf16e6e4 100644 (file)
@@ -1661,6 +1661,26 @@ else
     td->tariffConf.period = TARIFF::MONTH;
     }
 
+if (schemaVersion > 1)
+{
+    str = row[6+8*DIR_NUM];
+    param = "ChangePolicy";
+
+    if (str.length() == 0)
+        {
+        mysql_free_result(res);
+        errorStr = "Cannot read tariff " + tariffName + ". Parameter " + param;
+        mysql_close(sock);
+        return -1;
+        }
+
+    td->tariffConf.changePolicy = TARIFF::StringToChangePolicy(str);
+    }
+else
+    {
+    td->tariffConf.changePolicy = TARIFF::ALLOW;
+    }
+
 mysql_free_result(res);
 mysql_close(sock);
 return 0;