public APIResult User_UpdateUserProFile(int userID, bbsMax.Enums.Gender gender, Int16 birthYear, short birthMonth, Int16 birthday, string signature, float timeZone, Passport.Proxy.UserExtendedValueProxy[] extendedFields) { if (!CheckClient()) { return(null); } UserExtendedValueCollection fields = new UserExtendedValueCollection(); foreach (UserExtendedValueProxy proxy in extendedFields) { fields.Add(UserBO.Instance.GetUserExtendedValue(proxy)); } AuthUser user = UserBO.Instance.GetAuthUser(userID); if (user != null) { APIResult result = new APIResult(); using (ErrorScope es = new ErrorScope()) { result.IsSuccess = UserBO.Instance.Server_UpdateUserProfile(user, gender, birthYear, birthMonth, birthday, signature, timeZone, fields); if (result.IsSuccess == false) { es.CatchError <ErrorInfo>(delegate(ErrorInfo err) { result.AddError(err.TatgetName, err.Message); }); } return(result); } } return(null); }
public APIResult User_AdminUpdateUserProFile( int operatorUserID , int targetUserId , string realname , string email , bbsMax.Enums.Gender gender , DateTime birthday , string signature , bool realnameChecked , bool isActive , bool emailValidated , Passport.Proxy.UserExtendedValueProxy[] extendedFields) { if (!CheckClient()) { return(null); } UserExtendedValueCollection fields = new UserExtendedValueCollection(); foreach (UserExtendedValueProxy proxy in extendedFields) { fields.Add(UserBO.Instance.GetUserExtendedValue(proxy)); } AuthUser user = UserBO.Instance.GetAuthUser(targetUserId); if (user != null) { APIResult result = new APIResult(); using (ErrorScope es = new ErrorScope()) { result.IsSuccess = UserBO.Instance.AdminUpdateUserProfile(UserBO.Instance.GetAuthUser(operatorUserID) , targetUserId, realname, email, gender, birthday, signature, realnameChecked, isActive, emailValidated, fields); if (result.IsSuccess == false) { es.CatchError <ErrorInfo>(delegate(ErrorInfo err) { result.AddError(err.TatgetName, err.Message); }); } return(result); } } return(null); }