public ActionResult EditUser(UserProfile userprofile) { if (IsAdmin() != true) { return RedirectToAction("Index", "Dashboard"); } try { if (ModelState.IsValid) { _usrService.SaveUserProfil(userprofile); return RedirectToAction("Index"); } return RedirectToAction("UserList"); } catch { return View(); } }
public void CreateUserProfil(UserProfile userprofile) { db.UserProfile.Add(userprofile); db.SaveChanges(); }
public void SaveUserProfil(UserProfile userprofile) { db.Entry(userprofile).State = EntityState.Modified; db.SaveChanges(); }
public ActionResult Settings(UserProfile userprofile) { try { if (ModelState.IsValid) { _usrService.SaveUserProfil(userprofile); } return RedirectToAction("Dashboard/Index"); } catch { return View(); } return View(); }