Пример #1
0
 public Layots(LayoutEnt layoutEnt)
 {
     Id = layoutEnt.Id;
     foreach (var x in layoutEnt.ProductForDish)
     {
         ProductForDish.Add(new Product(x.Key), x.Value);
     }
     Dish = layoutEnt.Dish;
 }
Пример #2
0
 public Dish(DishEnt dish)
 {
     Id         = dish.Id;
     Name       = dish.Name;
     Weight     = dish.Weight;
     Price      = dish.Price;
     LayoutDish = new Layots(dish.LayoutDish);
     RecipeDish = new RecipeDish(dish.RecipeDish);
     Kitchen    = dish.Kitchen;
 }
Пример #3
0
        /// <summary>
        /// Creates an item Dish
        /// </summary>
        /// <param name="dishEnt">Convertible item DishEnt</param>
        /// <returns>Dish</returns>
        public static Dish NewDish(DishEnt dishEnt)
        {
            Dish dishs = new Dish();

            dishs.Id         = dishEnt.Id;
            dishs.Name       = dishEnt.Name;
            dishs.Weight     = dishEnt.Weight;
            dishs.Price      = dishEnt.Price;
            dishs.LayoutDish = NewLayouts(dishEnt.LayoutDish);
            dishs.RecipeDish = NewRecipeDish(dishEnt.RecipeDish);
            dishs.Kitchen    = dishEnt.Kitchen;
            return(dishs);
        }
Пример #4
0
        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);
        }
Пример #5
0
        /// <summary>
        /// Creates an item DishEnt
        /// </summary>
        /// <param name="dish">Convertible item Dish</param>
        /// <returns>DishEnt</returns>
        public static DishEnt NewDishEnt(Dish dish)
        {
            DishEnt dishEnt = new DishEnt(dish.Name, dish.Weight, dish.Price, NewLayoutEnt(dish.LayoutDish), NewRecipeDishEnt(dish.RecipeDish), dish.Kitchen);

            return(dishEnt);
        }
Пример #6
0
        void AddRecipe(string recipe, DishEnt dish)
        {
            RecipeDishEnt recipeForDish = new RecipeDishEnt(recipe, dish);

            Unit.RecipesRepository.AddItem(recipeForDish);
        }
Пример #7
0
 public LayoutEnt(Dictionary <ProductEnt, decimal> productForDish, DishEnt dish)
 {
     ProductForDish = productForDish;
     Dish           = dish;
 }
Пример #8
0
        void AddLayots(Dictionary <ProductEnt, decimal> productForDish, DishEnt dish)
        {
            LayoutEnt layot = new LayoutEnt(productForDish, dish);

            Unit.LayotsRepository.AddItem(layot);
        }