public ActionResult RemoveProfile() { BusinessLayerResult <EveryNoteUser> res = everynoteuser_mngr.RemoveUserById(CurrentSession.User.Id); if (res.Errors.Count > 0) { ErrorViewModel error_notifyobj = new ErrorViewModel() { Items = res.Errors, title = "Your profile did not delete!", text = "Please contact the management!", RedirectingUrl = "/Home/ShowProfile" }; return(View("Error", error_notifyobj)); } Session.Clear(); //return RedirectToAction("Index"); SuccessfulOperationsViewModel successful_notifyobj = new SuccessfulOperationsViewModel() { title = "Your account has been deleted.", text = "If you accidentally deleted your account, please contact us.", RedirectingUrl = "/Home/Index" }; successful_notifyobj.Items.Add("If you do not make a request within 30 days, your account will be permanently deleted."); return(View("SuccessfulOperation", successful_notifyobj)); }
public ActionResult DeleteProfile() { EverynoteUser currentUser = Session["login"] as EverynoteUser; BusinessLayerResult <EverynoteUser> res = everynoteUserManager.RemoveUserById(currentUser.Id); if (res.Errors.Count > 0) { ErrorViewModel errorNotifyObj = new ErrorViewModel() { Items = res.Errors, Title = "Profil Silinemedi.", RedirectingUrl = "/Home/ShowProfile" }; return(View("Error", errorNotifyObj)); } Session.Clear(); return(RedirectToAction("Index")); }
// Delete işlemi yapan action public ActionResult ProfileDelete() { EverynoteUserManager everynoteUserManager = new EverynoteUserManager(); BusinessLayerResult <User> businessLayerResultUser = everynoteUserManager.RemoveUserById(CurrentSession.User.Id); if (businessLayerResultUser.Errors.Count > 0) { ErrorViewModel errorViewModel = new ErrorViewModel { Title = "Profil silinemedi", RedirectingTimeout = 4000, Items = businessLayerResultUser.Errors, RedirectingUrl = "/Profile/ProfileShow" }; return(View("Error", errorViewModel)); // Shared altındaki Error sayfasına gider } Session.Clear(); return(RedirectToAction("Index", "Home")); }