public ActionResult Create(NurserySchoolUserRole nurserySchoolUserRole)
 {
     try
     {
         if (ModelState.IsValid)
         {
             db.NurserySchoolUserRoles.Add(nurserySchoolUserRole);
             db.SaveChanges();
             return(RedirectToAction("Index"));
         }
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         return(View(nurserySchoolUserRole));
     }
     return(View(nurserySchoolUserRole));
 }
 public ActionResult Edit(NurserySchoolUserRole nurserySchoolUserRole)
 {
     try
     {
         if (ModelState.IsValid)
         {
             db.Entry(nurserySchoolUserRole).State = EntityState.Modified;
             db.SaveChanges();
             return(RedirectToAction("Index"));
         }
         return(View(nurserySchoolUserRole));
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         return(Redirect("~/ErrorHandler.html"));
     }
 }
 public ActionResult EditNursSchRole(int Id)
 {
     try
     {
         if (Id != 0)
         {
             var edtsecschrl  = db.NurserySchoolUserRoles.Where(x => x.NurserySchoolUserRoleId == Id).FirstOrDefault();
             var edtsecschrl1 = new NurserySchoolUserRole
             {
                 NurserySchoolUserRoleId = edtsecschrl.NurserySchoolUserRoleId,
                 RoleName = edtsecschrl.RoleName
             };
             return(PartialView("~/Views/Shared/PartialViewsForms/_EditNursSchRole.cshtml", edtsecschrl1));
         }
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         return(Redirect("~/ErrorHandler.html"));
     }
     return(new HttpStatusCodeResult(204));
 }