public Orden(Receta rec, int cant) { OrdenEliminada = false; NombreReceta = rec.Nombre; Id_Receta = rec.Id; Cantidad = cant; Formula = GetFormula(rec); CostoMP = rec.CostoTotalIngredientes; CostoIndirecto = rec.CostoIndirecto; Ganancia = rec.Utilidad; }
private string GetFormula(Receta rec) { string formula = ""; foreach (var ing in rec.Ingredientes) { string terna = "(" + ing.MPAbreviatura + " - " + ing.Cantidad + " - " + ing.MPPrecio + ");"; formula += terna; } return(formula); }