示例#1
0
        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
 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);
 }