コード例 #1
0
 private void BtnUpdate_Click(object sender, RoutedEventArgs e)
 {
     popup.IsOpen = false;
     if (LvAll.SelectedItem != null)
     {
         UpdateCity update = new UpdateCity(LvAll.SelectedItem as City, AdminInterface);
         update.ShowDialog();
         RefreshList();
     }
     else
     {
         popup        = ConfigurePopup.Configure(popup, "Select item first!", LvAll, PlacementMode.Right);
         popup.IsOpen = true;
     }
 }
コード例 #2
0
        public IApiResult Update(UpdateCity operation)
        {
            var result = operation.ExecuteAsync().Result;

            if (result is ValidationsOutput)
            {
                return(new ApiResult <List <ValidationItem> >()
                {
                    Data = ((ValidationsOutput)result).Errors
                });
            }
            else
            {
                return(new ApiResult <object>()
                {
                    Status = ApiResult <object> .ApiStatus.Success
                });
            }
        }
コード例 #3
0
        public async Task Update()
        {
            _city.Id = (await Bus.Request(new CreateCity {
                City = _city
            })).CityId;

            _city.Name = UniqueUtils.MakeUnique("Moskow");
            var updateCity = new UpdateCity {
                City = _city
            };
            await Bus.Request(updateCity);

            (await Bus.Execute(new GetCity {
                CityId = _city.Id
            }))
            .City
            .Should()
            .BeEquivalentTo(_city);

            await AssertHasInSearchResults();
        }
コード例 #4
0
 public Task Update([FromBody] UpdateCity request) => _bus.Request(request);
コード例 #5
0
 public async Task <IActionResult> Put(Guid id, UpdateCity command)
 => await SendAsync(command.Bind(c => c.Id, id),
                    resourceId : command.Id, resource : "cities");