Ejemplo n.º 1
0
        public JsonResult Logout(string USER_NAME)
        {
            bool   is_success = false;
            string msg        = "";

            decimal?LOGON_NO = Session["sess_LOGON_NO"] as decimal?;

            try {
                if (LOGON_NO == null)
                {
                    if (!string.IsNullOrEmpty(USER_NAME) && !string.IsNullOrWhiteSpace(USER_NAME))
                    {
                        db.SEC_USERS_LOGOUT_APPS(USER_NAME);
                    }
                }
                else
                {
                    db.SEC_USERS_LOGOUT(LOGON_NO);

                    Session.Clear();
                    //Session.RemoveAll();
                    Session.Abandon();

                    is_success = true;
                    msg        = "Logout successfully.";
                }
            } catch (Exception ex) {
            }


            var result = new { @is_success = is_success, @msg = msg };

            return(Json(result, JsonRequestBehavior.AllowGet));
        }