コード例 #1
0
ファイル: DishesV2Controller.cs プロジェクト: gamacias/RC
        public ActionResult AddNewIngredient(IndexIngredientsToNotify inxObj)
        {
            if (ModelState.IsValid)
            {
                // db.Entry(person).State = EntityState.Modified;
                var exist = GetIngredientsToCalculate().linesIngr.Where(x => x.IngredientDishName == inxObj.IngredientDishName).ToList();
                if (exist.Count() == 0 ) {
                    GetIngredientsToCalculate().linesIngr.Add(inxObj);
                }
                return Json(new { success = true });
            }

            ViewBag.UnitMeasure = new SelectList(db.Units, "Name", "Name");
            return PartialView("_AddNewIngredient", inxObj);
        }
コード例 #2
0
ファイル: Sessions.cs プロジェクト: gamacias/RC
        public void UpdateItem(IndexIngredientsToNotify ingredient)
        {
            //RemoveIngredient(ingredient.IngredientDishId);
            // AddItem(ingredient);

              var a = linesIngr.Where(x=> x.IngredientDishId == ingredient.IngredientDishId).FirstOrDefault();
            a.TotalRequired = ingredient.TotalRequired;
        }
コード例 #3
0
ファイル: DishesV2Controller.cs プロジェクト: gamacias/RC
 public ActionResult UpdateTotalRequired(IndexIngredientsToNotify inxObj)
 {
     if (ModelState.IsValid)
     {
         // db.Entry(person).State = EntityState.Modified;
         GetIngredientsToCalculate().UpdateItem(inxObj);
         return Json(new { success = true });
     }
     return PartialView("_UpdateTotalRequired", inxObj);
 }