예제 #1
0
        public ActionResult UserInfoEdit(UserInfoModel model)
        {
            if (string.IsNullOrEmpty(model.UserID))
            {
                ViewData[EditFlag] = true;

                if (model.Insert() != null)
                {
                    return(JsonSuccess(""));
                }
                return(JsonError(""));
            }
            ViewData[EditFlag] = true;
            if (model.Update() > 0)
            {
                LogDAL.AppendSQLLog(MTConfig.CurrentUserID, typeof(UserInfoModel));
                return(JsonSuccess(""));
            }
            return(JsonError(""));
        }
예제 #2
0
        public ActionResult UpdatePassword(string oldPwd, string newPwd, string new2Pwd)
        {
            UserInfoModel umInfoModel = UserInfoModel.FirstOrDefault("select * from UserInfo where UserID=@0", MTConfig.CurrentUserInfo.UserID);

            if (newPwd != new2Pwd)
            {
                return(JsonError(Passowrd1));
            }
            if (PwdThreeEncrypt.PasswordThreeMd5Encrypt(oldPwd) != umInfoModel.Password)
            {
                return(JsonError(Passowrd2));
            }
            umInfoModel.Password = PwdThreeEncrypt.PasswordThreeMd5Encrypt(newPwd);
            if (umInfoModel.Update() > 0)
            {
                return(JsonSuccess(SaveSuccess));
            }
            else
            {
                return(JsonError(SaveError));
            }
        }