public bool SaveProfileInfo(string firstName = null, string lastName = null, string maidenName = null, Sex? sex = null, RelationType? relation = null, long? relationPartnerId = null, DateTime? birthDate = null, BirthdayVisibility? birthDateVisibility = null, string homeTown = null, long? countryId = null, long? cityId = null) { ChangeNameRequest request; var parameters = new AccountSaveProfileInfoParams { FirstName = firstName, LastName = lastName, MaidenName = maidenName, Sex = sex.Value, Relation = relation.Value, RelationPartner = relationPartnerId.HasValue ? new User { Id = relationPartnerId.Value } : null, BirthDate = birthDate?.ToShortDateString(), BirthdayVisibility = birthDateVisibility.Value, HomeTown = homeTown, Country = new Country { Id = countryId }, City = new City { Id = cityId } }; return SaveProfileInfo(out request, parameters); }
public bool SaveProfileInfo(out ChangeNameRequest changeNameRequest, string firstName = null, string lastName = null, string maidenName = null, Sex? sex = null, RelationType? relation = null, long? relationPartnerId = null, DateTime? birthDate = null, BirthdayVisibility? birthDateVisibility = null, string homeTown = null, long? countryId = null, long? cityId = null) { VkErrors.ThrowIfNumberIsNegative(() => relationPartnerId); VkErrors.ThrowIfNumberIsNegative(() => countryId); VkErrors.ThrowIfNumberIsNegative(() => cityId); changeNameRequest = null; var parameters = new VkParameters { {"first_name", firstName}, {"last_name", lastName}, {"maiden_name", maidenName}, {"sex", ((sex ?? Sex.Unknown) == Sex.Unknown) ? null : sex}, {"relation", relation}, {"relation_partner_id", relationPartnerId}, {"bdate", birthDate != null ? birthDate.Value.ToString("dd.MM.yyyy") : null}, {"bdate_visibility", birthDateVisibility}, {"home_town", homeTown}, {"country_id", countryId}, {"city_id", cityId} }; var response = _vk.Call("account.saveProfileInfo", parameters); changeNameRequest = response["name_request"]; return response["changed"]; }
public bool SaveProfileInfo(string firstName = null, string lastName = null, string maidenName = null, Sex? sex = null, RelationType? relation = null, long? relationPartnerId = null, DateTime? birthDate = null, BirthdayVisibility? birthDateVisibility = null, string homeTown = null, long? countryId = null, long? cityId = null) { ChangeNameRequest request; return SaveProfileInfo(out request, firstName, lastName, maidenName, sex, relation, relationPartnerId, birthDate, birthDateVisibility, homeTown,countryId, cityId); }
public bool SaveProfileInfo(out ChangeNameRequest changeNameRequest, string firstName = null, string lastName = null, string maidenName = null, Sex? sex = null, RelationType? relation = null, long? relationPartnerId = null, DateTime? birthDate = null, BirthdayVisibility? birthDateVisibility = null, string homeTown = null, long? countryId = null, long? cityId = null) { var parameters = new AccountSaveInfoParams { FirstName = firstName, LastName = lastName, MaidenName = maidenName, Sex = sex.Value, Relation = relation.Value, RelationPartnerId = relationPartnerId, BirthDate = birthDate, BirthDateVisibility = birthDateVisibility.Value, HomeTown = homeTown, CountryId = countryId, CityId = cityId }; return SaveProfileInfo(out changeNameRequest, parameters); }