Beispiel #1
0
 public void addCosto(Costo c)
 {
     if (this.costos == null)
     {
         this.costos = new List <Costo>();
     }
     this.costos.Add(c);
 }
Beispiel #2
0
        public List <Costo> calCostoXNivel(int nivel, int cant)
        {
            var lista = new List <Costo>();

            foreach (var costo in costos)
            {
                var c = new Costo(costo.recurso, costo.producto, costo.valor, costo.incrementoNivel);
                c.incrementoNivel = costo.incrementoNivel / 100 + 1;
                for (int i = 0; i < nivel; i++)
                {
                    c.valor = Convert.ToInt32(c.valor * c.incrementoNivel);
                }
                c.valor *= cant;
                lista.Add(c);
            }
            return(lista);
        }