Exemplo n.º 1
0
        public void Add(Cost cost, double amount)
        {
            var costs = Costs.SingleOrDefault(c => c.Name == cost.Name);

            if (costs == null)
            {
                Costs.Add(cost);
            }
            CostsList.Add(cost, amount);
            Save(Costs);
            Save(new List <CostsList>()
            {
                CostsList
            });
        }
        public void Add(Costs cost, double price)
        {
            var costs = Costs.SingleOrDefault(c => c.Name == cost.Name);

            if (costs == null)
            {
                Costs.Add(cost);
                Cost.Add(cost, price);
                Save();
            }
            else
            {
                Cost.Add(costs, price);
                Save();
            }
        }