public DishEnt(string name, decimal weight, decimal price, LayoutEnt layot, RecipeDishEnt recipe, string kitchen) { Name = name; Weight = weight; Price = price; LayoutDish = layot; RecipeDish = recipe; Kitchen = kitchen; }
public Layots(LayoutEnt layoutEnt) { Id = layoutEnt.Id; foreach (var x in layoutEnt.ProductForDish) { ProductForDish.Add(new Product(x.Key), x.Value); } Dish = layoutEnt.Dish; }
/// <summary> /// Creates an item LayoutEnt /// </summary> /// <param name="layouts">Convertible item Layouts</param> /// <returns> LayoutEnt</returns> public static LayoutEnt NewLayoutEnt(Layouts layouts) { Dictionary <ProductEnt, double> productList = new Dictionary <ProductEnt, double>(); foreach (var x in layouts.ProductForDish) { productList.Add(NewProductEnt(x.Key), x.Value); } LayoutEnt layoutEnt = new LayoutEnt(productList, NewDishEnt(layouts.Dish)); return(layoutEnt); }
/// <summary> /// Creates an item Layouts /// </summary> /// <param name="layoutEnt">Convertible item LayoutEnt</param> /// <returns>Layouts</returns> public static Layouts NewLayouts(LayoutEnt layoutEnt) { Layouts layouts = new Layouts(); layouts.Id = layoutEnt.Id; layouts.Dish = NewDish(layoutEnt.Dish); Dictionary <Product, double> ProductForDish = new Dictionary <Product, double>(); foreach (var x in layoutEnt.ProductForDish) { ProductForDish.Add(NewProduct(x.Key), x.Value); } layouts.ProductForDish = ProductForDish; return(layouts); }
void AddDish(string name, decimal weight, decimal price, LayoutEnt layot, RecipeDishEnt recipe, string kitchen) { DishEnt dish = new DishEnt(name, weight, price, layot, recipe, kitchen); Unit.DishesRepository.AddItem(dish); }
void AddLayots(Dictionary <ProductEnt, decimal> productForDish, DishEnt dish) { LayoutEnt layot = new LayoutEnt(productForDish, dish); Unit.LayotsRepository.AddItem(layot); }