Пример #1
0
        // GET: Catalog/Activate/5?item=2
        public ActionResult Activate(int?id, decimal?item)
        {
            if (id == null || item == null)
            {
                return(RedirectToAction("Index", "Home"));
            }
            if (id == 1)
            {
                db.PR_ActiveQuality((int)item);
            }
            else if (id == 2)
            {
                db.PR_ActivePrice((int)item);
            }
            else if (id == 3)
            {
                db.PR_ActiveDifficulty((int)item);
            }
            else if (id == 4)
            {
                db.PR_ActiveHikeType((int)item);
            }
            else if (id == 5)
            {
                db.PR_ActiveHiker((int)item);
                return(RedirectToAction("User", "Home", new { id = 3 }));
            }
            else if (id == 6)
            {
                db.PR_ActiveAdmin((decimal)item);
                return(RedirectToAction("User", "Home", new { id = id - 5 }));
            }
            else if (id == 7)
            {
                db.PR_ActiveAdminICT((decimal)item);
                return(RedirectToAction("User", "Home", new { id = id - 5 }));
            }
            else
            {
                return(RedirectToAction("Index", "Home"));
            }

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