Exemplo n.º 1
0
        public ActionResult Logout()
        {
            CurrentSession.Clear();


            return(RedirectToAction("Index", "Home"));
        }
Exemplo n.º 2
0
 /// <summary>
 /// Rollback NHibernate transaction.
 /// </summary>
 public static void RollbackTransaction()
 {
     _logger.Debug("Rollback NHibernate transaction.");
     if (CurrentSession != null && CurrentSession.Transaction.IsActive)
     {
         CurrentSession.Transaction.Rollback();
         CurrentSession.Clear();
     }
 }
Exemplo n.º 3
0
 public static void FlushSessionToDbAndClear()
 {
     CurrentSession.Flush();
     if (DoNotClearSession)
     {
         return;
     }
     CurrentSession.Clear();
 }
Exemplo n.º 4
0
 public static void ClearSession()
 {
     CurrentSession.Clear();
     CurrentSession.Close();
     CurrentSession.SessionFactory.Close();
     CurrentSession.Dispose();
     CurrentSession.SessionFactory.Dispose();
     mSession = null;
     GC.Collect();
     GC.WaitForPendingFinalizers();
 }
Exemplo n.º 5
0
        public ActionResult Logout()
        {
            //if (Session["login"] != null)
            //{
            //    Session.RemoveAll();
            //}

            if (CurrentSession.Login != null)
            {
                CurrentSession.Clear();
            }

            return(RedirectToAction("Index"));
        }
Exemplo n.º 6
0
        public ActionResult RemoveProfile()
        {
            LayerResult <NoteUser> res = um.RemoveUserById(CurrentSession.user.Id);

            if (res.Errors.Count > 0)
            {
                ErrorViewModel evm = new ErrorViewModel()
                {
                    Title          = "Profil Silenemedi..",
                    Items          = res.Errors,
                    RedirectingUrl = "/Home/ShowProfile"
                };
                return(View("Error", evm));
            }
            CurrentSession.Clear();

            return(RedirectToAction("Index"));
        }
        public ActionResult DeleteProfile()
        {
            BusinessLayerResult <WebnoteUser> res = webnoteUserManager.RemoveUserById(CurrentSession.User.Id);

            if (res.Errors.Count > 0)
            {
                ErrorViewModel errorNotifyObj = new ErrorViewModel()
                {
                    Items          = res.Errors,
                    Title          = "Profil Silinemedi.",
                    RedirectingUrl = "/Home/ShowProfile"
                };

                return(View("Error", errorNotifyObj));
            }

            CurrentSession.Clear();

            return(RedirectToAction("Index"));
        }
Exemplo n.º 8
0
 public ActionResult Logout()
 {
     CurrentSession.Clear();
     return(RedirectToAction("Account"));
 }
 public ActionResult LogoutTercuman()
 {
     CurrentSession.Clear();
     return(RedirectToAction("Index"));
 }
 public ActionResult Logout()
 {
     CurrentSession.Clear();
     CurrentSession.Abandon();
     return(RedirectToAction(nameof(Index)));
 }
Exemplo n.º 11
0
 public ActionResult LogOut()
 {
     CurrentSession.Clear("loginuser");
     return(RedirectToAction("Home"));
 }