public ActionResult DeleteConfirmed(int id)
        {
            CurrentIngredientStock currentIngredientStock = db.CurrentIngredientStocks.Find(id);

            currentIngredientStock.IsActive = false;
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "Id,Warehouse_Id,Ingredient_Id,Quantity,Remark,IsActive,CreatedBy,CreatedDate,ChangedBy,ChangedDate")] CurrentIngredientStock currentIngredientStock)
 {
     if (ModelState.IsValid)
     {
         db.Entry(currentIngredientStock).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Ingredient_Id = new SelectList(db.Ingredients, "Id", "Name", currentIngredientStock.Ingredient_Id);
     ViewBag.CreatedBy     = new SelectList(db.SystemUsers, "Id", "Email", currentIngredientStock.CreatedBy);
     ViewBag.ChangedBy     = new SelectList(db.SystemUsers, "Id", "Email", currentIngredientStock.ChangedBy);
     ViewBag.Warehouse_Id  = new SelectList(db.Warehouses, "Id", "Name", currentIngredientStock.Warehouse_Id);
     return(View(currentIngredientStock));
 }
        // GET: CurrentIngredientStocks/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CurrentIngredientStock currentIngredientStock = db.CurrentIngredientStocks.Find(id);

            if (currentIngredientStock == null)
            {
                return(HttpNotFound());
            }
            return(View(currentIngredientStock));
        }
        // GET: CurrentIngredientStocks/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CurrentIngredientStock currentIngredientStock = db.CurrentIngredientStocks.Find(id);

            if (currentIngredientStock == null)
            {
                return(HttpNotFound());
            }
            ViewBag.Ingredient_Id = new SelectList(db.Ingredients, "Id", "Name", currentIngredientStock.Ingredient_Id);
            ViewBag.CreatedBy     = new SelectList(db.SystemUsers, "Id", "Email", currentIngredientStock.CreatedBy);
            ViewBag.ChangedBy     = new SelectList(db.SystemUsers, "Id", "Email", currentIngredientStock.ChangedBy);
            ViewBag.Warehouse_Id  = new SelectList(db.Warehouses, "Id", "Name", currentIngredientStock.Warehouse_Id);
            return(View(currentIngredientStock));
        }