Пример #1
0
        public JsonResult ChangePassword(SEC_USER_CHANGE_PASSWORD user_info)
        {
            bool    is_success = false;
            string  msg        = "";
            decimal ret_val    = 0;

            try {
                ret_val = db.SEC_USER_CHANGE_PASS(user_info.USER_NAME, user_info.OLD_PASSWORD, user_info.NEW_PASSWORD).FirstOrDefault().Value;
            } catch (Exception ex) {
                is_success = false;
                msg        = "Failed to Change Password.";
            }

            if (ret_val > 0)
            {
                is_success = true;
                msg        = "Password Changed successfully.";
            }
            else
            {
                is_success = false;
                msg        = "Failed to Change Password.";
            }

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

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