コード例 #1
0
        public ActionResult Delete(string id, ApplicationUserBase user)
        {
            if (id == null)
            {
                return(null);
            }
            try
            {
                // User stays logged in - need a way to kill the session - unAuth
                // If the user being deleted is user himself
                if (id == System.Web.HttpContext.Current.User.Identity.GetUserId())
                {
                    m.DeleteUser(id);
                }

                m.DeleteUser(id);
                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
コード例 #2
0
        public ActionResult Delete(string id, ApplicationUserBase user)
        {

            if (id == null)
            {
                return null;
            }
            try
            {
                // User stays logged in - need a way to kill the session - unAuth
                // If the user being deleted is user himself
                if (id == System.Web.HttpContext.Current.User.Identity.GetUserId())
                {
                    m.DeleteUser(id);
                }

                m.DeleteUser(id);
                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }

        }