Ejemplo n.º 1
0
        public Dish(string name, List <string> ingredientNames, float price = 0f)
        {
            dishDAL = DishFactory.CreateIDishDal();

            this.Name        = name;
            this.Price       = price;
            this.Ingredients = new IngredientContainer().FindByNames(ingredientNames);
        }
Ejemplo n.º 2
0
 public DishContainer(IDishContainerDAL dal = null)
 {
     if (dal == null)
     {
         this.dishContainerDAL = DishFactory.CreateIDishContainerDal();
     }
     else
     {
         dishContainerDAL = dal;
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        ///     Creates a new menu and adds it to the current active profile
        /// </summary>
        /// <param name="menuType">MenuType to create</param>
        /// <param name="drinkType">Type of drink to add</param>
        /// <param name="sideType">Type of menu side to add</param>
        /// <param name="mainDishType">Type of the main dish</param>
        /// <param name="sizeType">Size of the dish</param>
        public void AddProductToProfile(MenuType menuType, DrinkType drinkType, SideType sideType,
                                        MainDishType mainDishType, SizeType sizeType)
        {
            var menu = new DishFactory(
                menuType,
                drinkType,
                sideType,
                mainDishType,
                sizeType)
                       .CreateMenu();

            ActiveProfile.AddItem(menu);
        }
Ejemplo n.º 4
0
 public Dish(string name, float price = 0, IDishDAL dal = null)
 {
     if (dal != null)
     {
         this.dishDAL = dal;
     }
     else
     {
         this.dishDAL = DishFactory.CreateIDishDal();
     }
     this.Name  = name;
     this.Price = price;
 }
Ejemplo n.º 5
0
        public Dish(string name, List <Ingredient> ingredients, float price = 0, IDishDAL dal = null)
        {
            if (dal != null)
            {
                this.dishDAL = dal;
            }
            else
            {
                this.dishDAL = DishFactory.CreateIDishDal();
            }

            this.Name        = name;
            this.Price       = price;
            this.Ingredients = ingredients;
        }
Ejemplo n.º 6
0
        public Order TryParse(string input)
        {
            var inputs = input.Split(',');

            if (!inputs.Any())
            {
                return(null);
            }

            var result = new Order(GetOrderType(inputs[0]));

            for (int i = 1; i < inputs.Length; i++)
            {
                result.Dishes.Add(DishFactory.CreateDish(result.OrderType, Convert.ToInt32(inputs[i].Trim())));
            }

            return(result);
        }
Ejemplo n.º 7
0
 public void SetUp()
 {
     _dishFactory = new DishFactory();
 }
Ejemplo n.º 8
0
 public void SetUp()
 {
     _dishFactory = new DishFactory();
 }