Esempio n. 1
0
 /// <summary>
 /// Action to add an area to the sub admin
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public ActionResult AddArea(long id)
 {
     try
     {
         AddAreaViewModel model = new AddAreaViewModel
         {
             SubAdminId = id
         };
         return(View(model));
     }
     catch (Exception ex)
     {
         return(RedirectToAction("ErrorPage", "Error", ex));
     }
 }
Esempio n. 2
0
 public ActionResult AddArea(AddAreaViewModel model)
 {
     if (!ModelState.IsValid)
     {
         return(View());
     }
     try
     {
         SubAdmin subAdmin = new SubAdmin(model.SubAdminId);
         subAdmin.AddArea(model.AreaName);
         return(RedirectToAction("Index"));
     }
     catch (Exception ex)
     {
         return(RedirectToAction("ErrorPage", "Error", ex));
     }
 }