コード例 #1
0
        public void Apply(PriceOffered priceOffered)
        {
            // FIXME Add logging
            if (_priceOffersByDate.ContainsKey(priceOffered.Date))
            {
                _priceOffersByDate.Remove(priceOffered.Date);
            }

            _priceOffersByDate.Add(priceOffered.Date, priceOffered);
        }
コード例 #2
0
        private async void PostQuotation()
        {
            try
            {
                CanPost = (!string.IsNullOrEmpty(PriceOffered.ToString()) && !string.IsNullOrEmpty(Description));


                if (CanPost)
                {
                    Acr.UserDialogs.UserDialogs.Instance.ShowLoading("Post quotation");


                    var quotatation = await ServerPath.Path
                                      .AppendPathSegment("/api/quotations/add/" + TechnicianModule.TenantName)
                                      .PostJsonAsync(new
                    {
                        QuotationId,
                        Issue.IssueId,
                        PriceOffered,
                        Description,
                        TechnicianId = TechnicianModule.UserId
                    });

                    Acr.UserDialogs.UserDialogs.Instance.HideLoading();
                    if (quotatation.IsSuccessStatusCode)
                    {
                        await Acr.UserDialogs.UserDialogs.Instance.AlertAsync("Quotation submitted");
                    }
                }
                else
                {
                    Acr.UserDialogs.UserDialogs.Instance.HideLoading();
                    await Acr.UserDialogs.UserDialogs.Instance.AlertAsync("Values cannot be empty.");
                }
            }
            catch (Exception ex)
            {
                await Acr.UserDialogs.UserDialogs.Instance.AlertAsync("");
            }
        }