public ActionResult Create(RegisteredUserType registeredUserType) { try { if (ModelState.IsValid) { db.RegisteredUserTypes.Add(registeredUserType); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(registeredUserType)); } catch (Exception e) { Console.WriteLine(e); return(View(registeredUserType)); } }
public ActionResult Edit(RegisteredUserType registeredUserType) { try { if (ModelState.IsValid) { db.Entry(registeredUserType).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(registeredUserType)); } catch (Exception e) { Console.WriteLine(e); return(Redirect("~/ErrorHandler.html")); } }
public ActionResult EditRegUserType(int Id) { try { if (Id != 0) { var edtregusetype = db.RegisteredUserTypes .Where(x => x.RegisteredUserTypeId == Id) .FirstOrDefault(); var regusrtype1 = new RegisteredUserType { RegisteredUserTypeId = edtregusetype.RegisteredUserTypeId, RegisteredUserTypeName = edtregusetype.RegisteredUserTypeName }; return(PartialView("~/Views/Shared/PartialViewsForms/_EditRegUserType.cshtml", regusrtype1)); } } catch (Exception e) { Console.WriteLine(e); return(Redirect("~/ErrorHandler.html")); } return(new HttpStatusCodeResult(204)); }