Exemple #1
0
        private async void Button_Clicked(object sender, EventArgs e)
        {
            if (!activityIndicator.IsRunning)
            {
                var command = new CreateOrUpdatePositionCommand()
                {
                    ZoneId = zone.Id,
                    Name   = name.Text
                };
                try
                {
                    activityIndicator.IsRunning = true;
                    await positionsService.CreatePosition(command);

                    await localeProvider.RefreshLocale();

                    activityIndicator.IsRunning = false;
                    await Navigation.PopAsync();
                }
                catch (Exception ex)
                {
                    await DisplayAlert(AppResources.Error, ex.Message, "OK");

                    activityIndicator.IsRunning = false;
                }
                finally
                {
                    activityIndicator.IsRunning = false;
                }
            }
        }
Exemple #2
0
 public async Task <ActionResult <Position> > UpdatePosition(
     [FromServices] IPositionService positionService,
     [FromRoute] int positionId,
     [FromBody] CreateOrUpdatePositionCommand command)
 {
     return(await positionService.UpdatePosition(positionId, command));
 }
Exemple #3
0
 public Task <Position> UpdatePosition(int positionId, CreateOrUpdatePositionCommand command)
 {
     throw new NotImplementedException();
 }
Exemple #4
0
 public async Task <Position> CreatePosition(CreateOrUpdatePositionCommand command)
 {
     return(await client.Post <Position>(positionsController, command));
 }
Exemple #5
0
 public async Task <ActionResult <Position> > CreatePosition(
     [FromServices] IPositionService positionService,
     [FromBody] CreateOrUpdatePositionCommand command)
 {
     return(await positionService.CreatePosition(command));
 }