public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
            NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();

            string oldPwd = context.Request.Form["o"];
            if (string.IsNullOrEmpty(oldPwd))
            {
                result.Message = "原密码不能为空";
                context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
                context.Response.End();
            }

            string newPwd = context.Request.Form["n"];
            if (string.IsNullOrEmpty(newPwd))
            {
                result.Message = "新密码不能为空";
                context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
                context.Response.End();
            }

            NFMT.User.BLL.AccountBLL bll = new NFMT.User.BLL.AccountBLL();
            result = bll.ChangePwd(user, oldPwd, newPwd);
            context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
        }
示例#2
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
            NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();

            string idStr = context.Request.Form["id"];
            int empId = 0;
            if (string.IsNullOrEmpty(idStr) || !int.TryParse(idStr, out empId) || empId <= 0)
            {
                context.Response.Write("参数错误");
                context.Response.End();
            }

            try
            {
                NFMT.User.BLL.AccountBLL bll = new NFMT.User.BLL.AccountBLL();
                result = bll.ResetPassword(user, empId);
                if (result.ResultStatus == 0)
                {
                    result.Message = "重置密码成功";
                }
            }
            catch (Exception ex)
            {
                result.ResultStatus = -1;
                result.Message = ex.Message;
            }

            context.Response.Write(result.Message);
        }
        public void ProcessRequest(HttpContext context)
        {
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
            NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();
            context.Response.ContentType = "text/plain";
            if (string.IsNullOrEmpty(context.Request["accountName"]))
            {
                result.Message = "报关序号错误";
                context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
                context.Response.End();
            }

            NFMT.User.BLL.AccountBLL bll = new NFMT.User.BLL.AccountBLL();
            result = bll.ValidateAccountName(user, context.Request["accountName"].ToString());
            context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result));
        }