private async Task OnSave()
        {
            try
            {
                if (_selectedReason.Key == null)
                {
                    await Alert.ShowMessage(nameof(AppResources.PleaseSelectReason).Translate());

                    return;
                }
                IsBusy = true;
                var context = new LostQuotationQueryContext
                {
                    QuotationId = _inquiry.QuotationId,
                    ReasonId    = _selectedReason.Key
                };
                var result = await Api.LostQuotation(context);

                if (!result.Successful.GetValueOrDefault() ||
                    result.ValidationErrors.Any())
                {
                    await Alert.DisplayApiCallError(result.ExceptionMessage, result.ValidationErrors);

                    return;
                }
                //This message is sent to force the refresh of
                //pipeline list as this quotation will not longer
                //appear on the list.
                MessengerInstance.Send(new RefreshPipelineScreenMessage());
                await Nav.Nav.PopToRootAsync();
            }
            catch (Exception e)
            {
                await Alert.DisplayError(e);
            }
            finally
            {
                IsBusy = false;
            }
        }
Exemplo n.º 2
0
 public async Task <ApiResponseOfBoolean> LostQuotation(LostQuotationQueryContext context)
 {
     return(await AXClient.Instance.LostQuotationAsync(context)
            .ConfigureAwait(false));
 }