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; } }
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; } }
public async Task <ApiResponseOfBoolean> PostQuotationUpdate(QuotationUpdateQueryContext context) { return(await AXClient.Instance.PostQuotationUpdateAsync(context) .ConfigureAwait(false)); }