예제 #1
0
        public void EditPlace_NormalCase()
        {
            const string url = "https://api.vk.com/method/groups.editPlace?group_id=103292418&title=Test&address=1&country_id=1&city_id=1&latitude=30&longitude=30&v=" + VkApi.VkApiVersion + "&access_token=token";
            const string json =
                @"{
                    'response': {
                      'success': 1,
                      'address': ''
                    }
                  }";

            var cat = GetMockedGroupCategory(url, json);
            var place = new Place
            {
                Title = "Test",
                CityId = 1,
                CountryId = 1,
                Longitude = 30,
                Latitude = 30,
                Address = "1"
            };
            var groups = cat.EditPlace(103292418, place);

            Assert.That(groups, Is.True);
        }
예제 #2
0
 public void Create(Place place)
 {
     {
         using (var Connection = new SqlConnection(ConnectionString))
         {
             Connection.Open();
             using (var command = Connection.CreateCommand())
             {
                 command.CommandText =
                     "insert into [dbo].[Place] (id, name, title) values (@id, @name, @title)";
                 command.Parameters.AddWithValue("@id", place.Id);
                 command.Parameters.AddWithValue("@name", place.Name);
                 command.Parameters.AddWithValue("@name", place.Title);
                 command.ExecuteNonQuery();
             }
         }
     }
 }
예제 #3
0
 public bool EditPlace(ulong groupId, Place place = null)
 {
     if (place == null)
     {
         place = new Place();
     }
     var parameters = new VkParameters
     {
         { "group_id", groupId },
         { "title", place.Title },
         { "address", place.Address },
         { "country_id", place.CountryId },
         { "city_id", place.CityId },
         { "latitude", place.Latitude },
         { "longitude", place.Longitude }
     };
     var result = _vk.Call("groups.editPlace", parameters);
     return result["success"];
 }