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; } }
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 }); } }
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(); }
public Task Update([FromBody] UpdateCity request) => _bus.Request(request);
public async Task <IActionResult> Put(Guid id, UpdateCity command) => await SendAsync(command.Bind(c => c.Id, id), resourceId : command.Id, resource : "cities");