public override void Prepare()
 {
     m_StatusBuilder.AppendLine("Preparing " + Name);
     Dough   = IngredientFactory.CreateDough();
     Sauce   = IngredientFactory.CreateSauce();
     Cheeses = IngredientFactory.CreateCheese();
 }
 public override void Prepare()
 {
     Console.WriteLine("Preparing " + Name);
     Dough  = IngredientFactory.CreateDough();
     Sauce  = IngredientFactory.CreateSauce();
     Cheese = IngredientFactory.CreateCheese();
 }
Example #3
0
        public void ApplyBitterToRecipe()
        {
            RecipeFactory     myFactory           = new RecipeFactory();
            IRecipe           myRecipe            = myFactory.GetRecipe(RecipeTypes.Beer);
            IngredientFactory myIngredientFactory = new IngredientFactory();
            var ingredient = myIngredientFactory.GetIngredient(IngredientType.Fermentable);

            ingredient.Amount = 10;
            (ingredient as IFermentable).DiastaticPower = 1.04;
            myRecipe.Ingredients.Add(ingredient);
            //adding bitters is just a test for my sanity in querying interfaces and dealing with Covariance
            //note it will be repeated on the IBU calculation as the fermentable power impacts bitterness
            ingredient        = myIngredientFactory.GetIngredient(IngredientType.BitterSeason);
            ingredient.Amount = 1.5;
            (ingredient as IBitter).BitteringFactor       = 15;
            (ingredient as IBitter).BitterCalculationTime = 60;
            myRecipe.Ingredients.Add(ingredient);
            myRecipe.BatchVolume            = 6.5;
            myRecipe.TotalEfficiencyPercent = 70;
            var ibus = myRecipe.GetEstimatedBitterness();

            Assert.AreEqual(myRecipe.Bitters.Count, 1);
            //May need to check formula.  BeerSmith usually is a little higher.  BeerSmith has been known to tweak their forumulas though.
            Assert.AreEqual(63.81, Math.Round(ibus, 2));
        }
Example #4
0
 public MYSweetPizza(IngredientFactory factory)
 {
     Name                   = "Mianyang sweet pizza";
     DoughOrigin            = "mianyang thin dough";
     SauceOrigin            = "mianyang spicy";
     this.ingredientFactory = factory;
 }
        public ActionResult LoadIngredient(LoadIngredientModel input)
        {
            IngredientFactory      IngFactory = new IngredientFactory();
            POIngredientViewModels model      = new POIngredientViewModels();
            //var listIng = IngFactory.GetIngredient("").Where(x => x.IsActive).ToList();

            var listIng = IngFactory.GetIngredientBySupplier(input.SupplierId, input.StoreId);

            foreach (var item in listIng)
            {
                model.ListItemView.Add(new POIngredient
                {
                    BaseUOM        = item.ReceivingUOMName,
                    IngredientId   = item.Id,
                    IngredientName = item.Name,
                    PurchasePrice  = item.PurchasePrice,

                    Description     = item.Description,
                    IngredientCode  = item.Code,
                    IngReceivingQty = item.ReceivingQty,
                    Qty             = item.ReOrderQty.HasValue ? item.ReOrderQty.Value : 0
                });
            }

            if (input.ListItemNew != null)
            {
                model.ListItemView = model.ListItemView.Where(x => !input.ListItemNew.Contains(x.IngredientId)).ToList();
            }
            model.ListItemView = model.ListItemView.OrderByDescending(x => x.IsSelect ? 1 : 0).ThenBy(x => x.IngredientName).ToList();
            return(PartialView("_TableChooseIngredient", model));
        }
Example #6
0
 public CDSweetPizza(IngredientFactory factory)
 {
     Name                   = "chengdu sweet pizza";
     DoughOrigin            = "chengdu sweet dough";
     SauceOrigin            = "chengdu sweet SauceOrigin";
     this.ingredientFactory = factory;
 }
        public static void RemoveIngredient(IngredientModel model)
        {
            UnitOfWorkRepository unitOfWork = new UnitOfWorkRepository();
            var ingredient = IngredientFactory.ConvertIngredientModel(model);

            unitOfWork.IngredientRepository.RemoveIngredient(ingredient.Id);
        }
Example #8
0
 public MYSaltyPizza(IngredientFactory factory)
 {
     Name                   = "Mianyang salty pissa";
     DoughOrigin            = "mianyang dough";
     SauceOrigin            = "mianyang salty SauceOrigin";
     this.ingredientFactory = factory;
 }
Example #9
0
 public CDSaltyPizza(IngredientFactory factory)
 {
     Name              = "chengdu salty pizza";
     DoughOrigin       = "chengdu dough";
     SauceOrigin       = "chengdu salty SauceOrigin";
     ingredientFactory = factory;
 }
Example #10
0
 public override void Prepare()
 {
     Console.WriteLine($"Preparing {Name}");
     Dough  = IngredientFactory.CreateDough();
     Sauce  = IngredientFactory.CreateSauce();
     Cheese = IngredientFactory.CreateCheese();
     Clams  = IngredientFactory.CreateClams();
 }
 public override void Prepare()
 {
     m_StatusBuilder.AppendLine("Preparing : " + Name);
     this.Dough   = IngredientFactory.CreateDough();
     this.Sauce   = IngredientFactory.CreateSauce();
     this.Cheeses = IngredientFactory.CreateCheese();
     this.Clams   = IngredientFactory.CreateClam();
 }
Example #12
0
 //aqui se establecen los ingredientes de la pizza que se utilizaran en base a la fabrica de ingredientes
 public override void Prepare()
 {
     Console.WriteLine("Preparando " + Name);
     Dough = IngredientFactory.CreateDough();
     Console.WriteLine("Agregando " + Dough.Name);
     Sauce = IngredientFactory.CreateSauce();
     Console.WriteLine("Agregando " + Sauce.Name);
     Cheese = IngredientFactory.CreateCheese();
     Console.WriteLine("Agregando " + Cheese.Name);
 }
        public static IngredientModel AddIngredient(IngredientModel model)
        {
            UnitOfWorkRepository unitOfWork = new UnitOfWorkRepository();

            model.Id = Guid.NewGuid();
            var ingredient = IngredientFactory.ConvertIngredientModel(model);

            unitOfWork.IngredientRepository.AddIngredient(ingredient);
            return(model);
        }
Example #14
0
 public IngredientContainer(IIngredientContainerDAL dal = null)
 {
     if (dal != null)
     {
         this.ingredientContainerDAL = dal;
     }
     else
     {
         this.ingredientContainerDAL = IngredientFactory.CreateIIngredientContainerDal();
     }
 }
        public IngReceiptNoteSelfMadeController()
        {
            _factory           = new ReceiptNoteSelfMadeFactory();
            _ingredientFactory = new IngredientFactory();
            _recipeFactory     = new RecipeFactory();
            _inventoryFactory  = new InventoryFactory();

            ViewBag.ListStore = GetListStore();
            lstStore          = ViewBag.ListStore;
            //==========
        }
Example #16
0
 public IngIngredientsController()
 {
     _factory = new IngredientFactory();
     _IngredientUOMFactory      = new IngredientUOMFactory();
     _IngredientSupplierFactory = new IngredientSupplierFactory();
     _SupplierFactory           = new SupplierFactory();
     ViewBag.ListCompany        = GetListCompany();
     //==========
     lstCompany    = ViewBag.ListCompany;
     listCompanyId = lstCompany.Select(x => x.Value).ToList();
 }
Example #17
0
        public IngRecipesController()
        {
            _factory           = new RecipeFactory();
            _UOMFactory        = new UnitOfMeasureFactory();
            _IngredientFactory = new IngredientFactory();

            ViewBag.ListStore = GetListStore();
            //==========
            lstStore         = ViewBag.ListStore;
            listStoreId      = lstStore.Select(x => x.Value).ToList();
            ViewBag.IsAction = Commons.IsAction;
        }
Example #18
0
        public void ReturnInstanceOfIngredient()
        {
            var name = "Name";
            var unit = "Unit";

            var sut        = new IngredientFactory();
            var ingredient = sut.Create(name, unit);

            Assert.IsInstanceOfType(ingredient, typeof(Ingredient));
            Assert.AreEqual(name, ingredient.Name);
            Assert.AreEqual(unit, ingredient.Unit);
        }
Example #19
0
        public ActionResult LoadIngredientIngredient(string Id)
        {
            IngredientFactory IngFactory = new IngredientFactory();
            var listProductRecipe        = _factory.GetListRecipeIngredient(Id);

            RecipeProductIngredientViewModels model = new RecipeProductIngredientViewModels();
            var listIng = IngFactory.GetIngredientUnlessData(Id);
            //listIng = listIng.Where(x => x.IsActive == true).ToList();

            var m_CompanyIds = GetListCompany().Select(x => x.Value).ToList();

            if (m_CompanyIds.Count > 0)
            {
                listIng = listIng.Where(x => m_CompanyIds.Contains(x.CompanyId)).ToList();
            }

            foreach (var item in listIng)
            {
                var ProIngre = new ProductIngredient()
                {
                    BaseUOM        = item.BaseUOMName,
                    IngredientId   = item.Id,
                    IngredientName = item.Name,

                    Usage = listProductRecipe.Where(x => x.IngredientId.Equals(item.Id)).FirstOrDefault() == null
                                                    ? 0 : Math.Round(listProductRecipe.FirstOrDefault(x => x.IngredientId.Equals(item.Id)).Usage, 4),
                    BaseUsage = listProductRecipe.Where(x => x.IngredientId.Equals(item.Id)).FirstOrDefault() == null
                                                    ? 0 : Math.Round(listProductRecipe.FirstOrDefault(x => x.IngredientId.Equals(item.Id)).BaseUsage, 4),

                    BaseUOMId = listProductRecipe.Where(x => x.IngredientId.Equals(item.Id)).FirstOrDefault() == null
                                                    ? item.BaseUOMId : listProductRecipe.FirstOrDefault(x => x.IngredientId.Equals(item.Id)).UOMId,

                    IsSelect = listProductRecipe.Any(x => x.IngredientId.Equals(item.Id))
                };
                var lstItem = _UOMFactory.GetDataUOMRecipe(item.Id).ToList();
                if (lstItem != null)
                {
                    foreach (UnitOfMeasureModel uom in lstItem)
                    {
                        ProIngre.ListUOM.Add(new SelectListItem
                        {
                            Text     = uom.Name,
                            Value    = uom.Id,
                            Selected = uom.Id.Equals(ProIngre.BaseUOMId) == true ? true : false
                        });
                    }
                }

                model.ListItem.Add(ProIngre);
            }
            model.ListItem = model.ListItem.OrderByDescending(x => x.IsSelect ? 1 : 0).ThenBy(x => x.IngredientName).ToList();
            return(PartialView("_TableChooseIngredient", model));
        }
Example #20
0
 public Ingredient(string name, int diet = 0, IIngredientDAL dal = null)
 {
     if (dal != null)
     {
         this.ingredientDAL = dal;
     }
     else
     {
         this.ingredientDAL = IngredientFactory.CreateIIngredientDal();
     }
     this.Name = name;
     this.Diet = diet;
 }
        /// <summary>
        /// Adds the ingredients(Factory).
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AddIngredientBtn_Click(object sender, RoutedEventArgs e)
        {
            this.pizza.AddIngredient(IngredientFactory.CreateIngredient(IngredientList.ThinCrust));
            this.pizza.AddIngredient(IngredientFactory.CreateIngredient(IngredientList.Marinara));
            this.pizza.AddIngredient(IngredientFactory.CreateIngredient(IngredientList.Mozzarella));
            this.pizza.AddIngredient(IngredientFactory.CreateIngredient(IngredientList.Pepperoni));

            // This should throw exceptions
            // this.pizza.AddIngredient(IngredientFactory.CreateIngredient(IngredientList.ThickCrust));
            // this.pizza.AddIngredient(IngredientFactory.CreateIngredient(IngredientList.BBQ));

            this.PizzaLbl.Text    = this.pizza.ToString();
            this.PriceLbl.Content = string.Format("Price: {0:C}", this.pizza.CalculatePrice());
        }
Example #22
0
        public void CreateNewRecipe()
        {
            RecipeFactory myFactory = new RecipeFactory();
            IRecipe       myRecipe  = myFactory.GetRecipe(RecipeTypes.Beer);

            myRecipe.BatchVolume            = 6.5;
            myRecipe.Name                   = "My Beer Name";
            myRecipe.TotalEfficiencyPercent = 70;
            myRecipe.Style                  = new Style();
            IngredientFactory myIngredientFactory = new IngredientFactory();

            myRecipe.Ingredients.Add(myIngredientFactory.GetIngredient(IngredientType.Fermentable));
            myRecipe.BatchVolume = 6.5;
            Assert.AreEqual(1, myRecipe.Ingredients.Count);
        }
        public override void Prepare()
        {
            Dough  = IngredientFactory.CreateDough();
            Sauce  = IngredientFactory.CreateSauce();
            Cheese = IngredientFactory.CreateCheese();

            StringBuilder sb = new StringBuilder();

            sb.AppendLine("Preparing: " + Name);
            sb.AppendLine(Dough.Name);
            sb.AppendLine(Sauce.Name);
            sb.AppendLine(Cheese.Name);

            Console.WriteLine(sb.ToString());
        }
Example #24
0
        //aqui se establecen los ingredientes de la pizza que se utilizaran en base a la fabrica de ingredientes

        public override void Prepare()
        {
            Console.WriteLine("Preparando " + Name);
            Dough = IngredientFactory.CreateDough();
            Console.WriteLine("Agregando " + Dough.Name);
            Sauce = IngredientFactory.CreateSauce();
            Console.WriteLine("Agregando " + Sauce.Name);
            Cheese = IngredientFactory.CreateCheese();
            Console.WriteLine("Agregando " + Cheese.Name);
            Veggies = IngredientFactory.CreateVeggies();
            foreach (var V in Veggies)
            {
                Console.WriteLine("Agregando " + V.Name);
            }
        }
Example #25
0
        public static void OrderOrder(OrderViewModel model)
        {
            var pizza       = PizzaFactory.ConvertPizzaModel(model.pizza);
            var bottom      = BottomFactory.ConvertBottom(model.bottom);
            var sauce       = SauceFactory.ConvertSauce(model.sauce);
            var ingredients = IngredientFactory.ConvertIngredientModels(model.ingredients);

            UnitOfWorkRepository unitOfWork = new UnitOfWorkRepository();

            unitOfWork.BottomRepository.RemoveBottom(bottom.Id);
            unitOfWork.PizzaRepository.RemovePizza(pizza.Id);
            unitOfWork.SauceRepository.RemoveSauce(sauce.Id);

            foreach (var ing in ingredients)
            {
                unitOfWork.IngredientRepository.RemoveIngredient(ing.Id);
            }
        }
Example #26
0
        public IngReceiptNoteController()
        {
            _factory           = new ReceiptNoteFactory();
            _Detailfactory     = new ReceiptNoteDetailFactory();
            _POfactory         = new PurchaseOrderFactory();
            _PODFactory        = new PurchaseOrderDetailFactory();
            _RTFactory         = new ReturnNoteFactory();
            _InventoryFactory  = new InventoryFactory();
            _UOMFactory        = new UnitOfMeasureFactory();
            _IngredientFactory = new IngredientFactory();

            ViewBag.ListStore = GetListStore();
            lstStore          = ViewBag.ListStore;
            //listStoreId = lstStore.Select(x => x.Value).ToList();
            //==========
            lstCompany    = GetListCompany();
            listCompanyId = lstCompany.Select(x => x.Value).ToList();
        }
Example #27
0
        public static Menu GetMenu()
        {
            if (_instance is null)
            {
                ProductFactory           pizzaFactory      = new PizzaFactory();
                ItemFactory <Soda>       sodaFactory       = new SodaFactory();
                ItemFactory <Ingredient> ingredientFactory = new IngredientFactory();

                _instance = new Menu()
                {
                    Pizzas = new List <Product>
                    {
                        pizzaFactory.GetProduct(nameof(Margherita)),
                        pizzaFactory.GetProduct(nameof(Hawaii)),
                        pizzaFactory.GetProduct(nameof(Kebabpizza)),
                        pizzaFactory.GetProduct(nameof(QuatroStagioni))
                    },
                    Sodas = new List <Soda>
                    {
                        sodaFactory.GetItem(nameof(Fanta)),
                        sodaFactory.GetItem(nameof(CocaCola)),
                        sodaFactory.GetItem(nameof(Sprite))
                    },
                    Ingredients = new List <Ingredient>
                    {
                        ingredientFactory.GetItem(nameof(Ham)),
                        ingredientFactory.GetItem(nameof(Pineapple)),
                        ingredientFactory.GetItem(nameof(Mushrooms)),
                        ingredientFactory.GetItem(nameof(Onion)),
                        ingredientFactory.GetItem(nameof(KebabSauce)),
                        ingredientFactory.GetItem(nameof(Shrimps)),
                        ingredientFactory.GetItem(nameof(Mussels)),
                        ingredientFactory.GetItem(nameof(Artichoke)),
                        ingredientFactory.GetItem(nameof(Kebab)),
                        ingredientFactory.GetItem(nameof(Coriander)),
                    }
                };
            }

            return(_instance);
        }
Example #28
0
        public void ApplyFermentableToRecipe()
        {
            RecipeFactory     myFactory           = new RecipeFactory();
            IRecipe           myRecipe            = myFactory.GetRecipe(RecipeTypes.Beer);
            IngredientFactory myIngredientFactory = new IngredientFactory();
            var ingredient = myIngredientFactory.GetIngredient(IngredientType.Fermentable);

            ingredient.Amount = 10;
            (ingredient as IFermentable).DiastaticPower = 1.04;
            myRecipe.Ingredients.Add(ingredient);
            //adding bitters is just a test for my sanity in querying interfaces and dealing with Covariance
            //note it will be repeated on the IBU calculation as the fermentable power impacts bitterness
            ingredient        = myIngredientFactory.GetIngredient(IngredientType.BitterSeason);
            ingredient.Amount = 1.5;
            myRecipe.Ingredients.Add(ingredient);
            myRecipe.BatchVolume            = 6.5;
            myRecipe.TotalEfficiencyPercent = 70;
            var og = myRecipe.GetEstimatedOriginalGravity();

            Assert.AreEqual(myRecipe.Fermentables.Count, 1);
            Assert.AreEqual(Math.Round(og, 3), 1.043);
        }
Example #29
0
        public void ApplyFermenterToRecipe()
        {
            RecipeFactory     myFactory           = new RecipeFactory();
            IRecipe           myRecipe            = myFactory.GetRecipe(RecipeTypes.Beer);
            IngredientFactory myIngredientFactory = new IngredientFactory();
            var ingredient = myIngredientFactory.GetIngredient(IngredientType.Fermentable);

            ingredient.Amount = 10;
            (ingredient as IFermentable).DiastaticPower = 1.04;
            myRecipe.Ingredients.Add(ingredient);
            myRecipe.BatchVolume            = 6.5;
            myRecipe.TotalEfficiencyPercent = 70;
            var og = myRecipe.GetEstimatedOriginalGravity();

            Assert.AreEqual(myRecipe.Fermentables.Count, 1);
            Assert.AreEqual(Math.Round(og, 3), 1.043);
            ingredient = myIngredientFactory.GetIngredient(IngredientType.Fermenter);
            (ingredient as IFerment).PitchType   = FermenterPitchType.Dry;
            (ingredient as IFerment).Attenuation = 75;
            myRecipe.Ingredients.Add(ingredient);
            var fg = myRecipe.GetEstimatedFinalGravity();

            Assert.AreEqual(Math.Round(fg, 3), 1.011);
        }
Example #30
0
 public DeluxePizza(IngredientFactory factory, PizzaType t)
 {
     this.factory = factory;
     this.t       = t;
 }