public JsonResult SaveMemberInfo(CustomerMember member) { var info = new ResultInfo(); var account = CookieOperate.AccountCookie; var id = account.AccountId; var data = CustomerMemberDBOperate.GetModelById(id); if (member.Sex != "") { data.Sex = member.Sex; } if (member.Name != "") { data.Name = member.Name; account.AccountName = member.Name; } if (member.Job != "") { data.Job = member.Job; } if (member.Email != "") { data.Email = member.Email; account.Email = member.Email; } if (member.Mobile != "") { data.Mobile = member.Mobile; account.Mobile = member.Mobile; } info.IsSuccess = CustomerMemberDBOperate.ModifyCustomerMember(data); AccountDBOperate.ModifyAccount(account); if (info.IsSuccess) { info.Message = "修改成功"; } else { info.Message = "修改失败"; } return(Json(info)); }
public JsonResult ModifyAccountPwd() { ResultInfo info = new ResultInfo(); var flag = false; string old = CommonMethod.GetString(Request["OldPwd"]); string newPwd = CommonMethod.GetString(Request["NewPwd"]); if (CookieOperate.AccountCookie.Password != CommonMethod.PasswordMD5(old)) { info.Message = "旧密码错误"; } var account = CookieOperate.AccountCookie; account.Password = CommonMethod.PasswordMD5(newPwd); flag = AccountDBOperate.ModifyAccount(account); if (flag) { CookieOperate.AccountCookie = null; info.Message = "修改成功,请重新登录"; info.IsSuccess = true; } return(Json(info)); }