Пример #1
0
 public ActionResult AddSubCategory(tblsubcategory scat)
 {
     if (Session["AdminID"] == null)
     {
         return(RedirectToAction("doLogIn"));
     }
     else
     {
         res.tblsubcategories.Add(scat);
         res.SaveChanges();
         return(RedirectToAction("SubCategoryByCat", new { id = scat.CategoryID }));
     }
 }
Пример #2
0
 public ActionResult AddSubCategory(int id)
 {
     if (Session["AdminID"] == null)
     {
         return(RedirectToAction("doLogIn"));
     }
     else
     {
         tblsubcategory _subcat = new tblsubcategory();
         _subcat.CategoryID = id;
         ViewData.Model     = _subcat;
         return(View());
     }
 }