private async Task OnSave()
        {
            try
            {
                IsBusy = true;
                var context = new QuotationUpdateQueryContext
                {
                    CustomerInfo = Api.GetCustomerContext(),
                    CustAccount  = _inquiry.CustAccount,
                    Id           = _inquiry.QuotationId,
                    FollowUpDate = _followUpDate,
                };
                var result = await Api.PostQuotationUpdate(context);

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

                    return;
                }

                await OnClose();
            }
            catch (Exception e)
            {
                await Alert.DisplayError(e);
            }
            finally
            {
                IsBusy = false;
            }
        }
示例#2
0
        private async Task OnSave()
        {
            try
            {
                IsBusy = true;
                Enum.TryParse <QuotationUpdateQueryContextLeadTime>(_selectedLeadTime.Key.ToString(), out var leadTime);
                var context = new QuotationUpdateQueryContext
                {
                    CustomerInfo = Api.GetCustomerContext(),
                    CustAccount  = _inquiry.CustAccount,
                    Id           = _inquiry.QuotationId,
                    Percent      = _inquiry.Probability,
                    ExpiryDate   = _expiryDate,
                    FollowUpDate = _followUpDate,
                    Notes        = _inquiry.Note,
                    LeadTime     = leadTime
                };
                var result = await Api.PostQuotationUpdate(context);

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

                    return;
                }

                await OnClose();
            }
            catch (Exception e)
            {
                await Alert.DisplayError(e);
            }
            finally
            {
                IsBusy = false;
            }
        }
示例#3
0
 public async Task <ApiResponseOfBoolean> PostQuotationUpdate(QuotationUpdateQueryContext context)
 {
     return(await AXClient.Instance.PostQuotationUpdateAsync(context)
            .ConfigureAwait(false));
 }