Esempio n. 1
0
 private error load_discounts(XmlNode d_node)        // funkce pro naprsování slev z xml souboru
 {
     foreach (XmlNode node in d_node)
     {
         Timed_Item dis = new Timed_Item(node.Attributes["discountItemName"].Value,
                                         node.Attributes["validFrom"].Value,
                                         node.Attributes["validTo"].Value,
                                         node.Attributes["count"].Value,
                                         str_to_float(node.Attributes["tax"].Value),
                                         str_to_float(node.Attributes["priceTax"].Value),
                                         str_to_float(node.Attributes["priceWithoutTax"].Value),
                                         str_to_float(node.Attributes["priceWithTax"].Value));
         discounts.Add(dis);
     }
     return(error.SUCCESS);
 }
Esempio n. 2
0
        private error load_one_time_regular_charges(XmlNode o_node) // funkce pro naprsování jednorázových a pravidelných plateb z xml souboru
        {
            foreach (XmlNode node in o_node.ChildNodes)
            {
                Timed_Item charge = new Timed_Item(node.Attributes["feeName"].Value,
                                                   node.Attributes["validFrom"].Value,
                                                   node.Attributes["validTo"].Value,
                                                   node.Attributes["count"].Value,
                                                   str_to_float(node.Attributes["tax"].Value),
                                                   str_to_float(node.Attributes["priceTax"].Value),
                                                   str_to_float(node.Attributes["priceWithoutTax"].Value),
                                                   str_to_float(node.Attributes["priceWithTax"].Value));

                if (o_node.Name == "regularCharges")
                {
                    regular_charges.Add(charge);
                }
                else if (o_node.Name == "oneTimeCharges")
                {
                    one_time_charges.Add(charge);
                }
            }
            return(error.SUCCESS);
        }