Пример #1
0
        public ActionResult Edit(int?id, int?item)
        {
            if (id == null)
            {
                return(RedirectToAction("Index", "Home"));
            }
            if (id == 1 && item != null)
            {
                db.PR_EditQuality(Request.Form["itemNameEdit"], (int)item);
            }
            else if (id == 2 && item != null)
            {
                db.PR_EditPrice(Request.Form["itemNameEdit"], (int)item);
            }
            else if (id == 3 && item != null)
            {
                db.PR_EditDifficulty(Request.Form["itemNameEdit"], (int)item);
            }
            else if (id == 4 && item != null)
            {
                db.PR_EditHikeType(Request.Form["itemNameEdit"], (int)item);
            }
            else
            {
                return(RedirectToAction("Index", "Home"));
            }


            return(RedirectToAction("Index", "Catalog", new { id = id }));
        }