public JsonResult UpdateMobilePhone(string userID) { bool flag = false; int result = 0; if (!string.IsNullOrEmpty(CurrentUser.LoginName)) { Users item = WinWarBusiness.OrganizationBusiness.GetUserByUserID(userID); if (!string.IsNullOrEmpty(item.BindMobilePhone)) { flag = OrganizationBusiness.ClearAccountBindMobile(userID, CurrentUser.AgentID); if (flag) { result = 1; if (!string.IsNullOrEmpty(item.MobilePhone)) { result = 2; } } } else { result = 3; } } JsonDictionary.Add("result", result); return(new JsonResult() { Data = JsonDictionary, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }
/// <summary> /// 重置手机号 /// </summary> /// <param name="bindMobile"></param> /// <param name="option"></param> /// <param name="code"></param> /// <returns></returns> public JsonResult UpdateMobilePhone(string userID) { bool flag = false; int result = 0; if (OrganizationBusiness.IsExistAccountType(EnumAccountType.UserName, userID)) { Users item = IntFactoryBusiness.OrganizationBusiness.GetUserByUserID(userID, CurrentUser.ClientID); if (OrganizationBusiness.IsExistAccountType(EnumAccountType.Mobile, CurrentUser.UserID)) { flag = OrganizationBusiness.ClearAccountBindMobile(userID); if (flag) { result = 1; if (!string.IsNullOrEmpty(item.MobilePhone)) { result = 2; } } } else { result = 3; } } JsonDictionary.Add("result", result); return(new JsonResult() { Data = JsonDictionary, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }
public JsonResult SaveAccountBindMobile(string bindMobile, int option, string code) { bool flag = false; int result = 0; bool bl = Common.Common.ValidateMobilePhoneCode(bindMobile, code); if (!bl) { result = 2; } else { if (option == 1) { flag = OrganizationBusiness.UpdateAccountBindMobile(CurrentUser.UserID, bindMobile, CurrentUser.AgentID); } else { flag = OrganizationBusiness.ClearAccountBindMobile(CurrentUser.UserID, CurrentUser.AgentID); } if (flag) { if (option == 1) { CurrentUser.BindMobilePhone = bindMobile; } else { CurrentUser.BindMobilePhone = string.Empty; } Session["ClientManager"] = CurrentUser; Common.Common.ClearMobilePhoneCode(bindMobile); } } JsonDictionary.Add("Result", result); return(new JsonResult() { Data = JsonDictionary, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }