private QuoteView GetQuoteView(Quote quote)
        {
            var quoteView = new QuoteView()
            {
                Id     = quote.Id,
                Actor  = quote.Actor,
                Detail = quote.Detail
            };

            return(quoteView);
        }
Exemple #2
0
        private QuoteView ConvertQuote(Quote quote)
        {
            QuoteView quoteView = new QuoteView()
            {
                Id     = quote.Id,
                Actor  = quote.Actor,
                Detail = quote.Detail
            };

            return(quoteView);
        }
Exemple #3
0
        public ActionResult <QuoteView> GetAnyQuote()
        {
            var       quote     = _service.GetAnyQuote();
            QuoteView quoteView = new QuoteView()
            {
                Actor  = quote.Actor,
                Detail = quote.Detail,
                Id     = quote.Id
            };

            return(quoteView);
        }
Exemple #4
0
        public async Task <IActionResult> GetById(Guid id, CancellationToken cancellationToken = default)
        {
            var quote = await _dbContext.Quotes
                        .Include(q => q.Items)
                        .ThenInclude(qi => qi.Product)
                        .FirstOrDefaultAsync(q => q.Id == id, cancellationToken);

            if (null != quote)
            {
                return(Ok(QuoteView.FromModel(quote, _currencyConverter, Currency.CanadianDollar)));
            }
            return(NotFound());
        }
        public ActionResult <QuoteView> GetAnyQuote(string actor)
        {
            var anyQuoteActor = _service.GetAnyQuote(actor);

            if (anyQuoteActor != null)
            {
                var getJsonResponse = new QuoteView()
                {
                    Id     = anyQuoteActor.Id,
                    Actor  = anyQuoteActor.Actor,
                    Detail = anyQuoteActor.Detail
                };
                return(getJsonResponse);
            }
            return(NotFound());
        }
Exemple #6
0
        public ActionResult <QuoteView> GetAnyQuote(string actor)
        {
            var quoteView = new QuoteView();
            var quote     = _service.GetAnyQuote(actor);

            if (quote == null)
            {
                return(new NotFoundResult());
            }

            quoteView.Actor  = quote.Actor;
            quoteView.Detail = quote.Detail;
            quoteView.Id     = quote.Id;

            return(new ActionResult <QuoteView>(quoteView));
        }
Exemple #7
0
        public ActionResult <QuoteView> GetAnyQuote(string actor)
        {
            var obj    = new QuoteView();
            var result = _service.GetAnyQuote(actor);

            if (result == null)
            {
                return(new NotFoundResult());
            }

            obj.Actor  = result.Actor;
            obj.Detail = result.Detail;
            obj.Id     = result.Id;

            return(new ActionResult <QuoteView>(obj));
        }
Exemple #8
0
        public ActionResult <QuoteView> GetAnyQuote(string actor)
        {
            var actorQuote = _service.GetAnyQuote(actor);

            if (actorQuote == null)
            {
                return(NotFound());
            }

            QuoteView quoteView = new QuoteView()
            {
                Actor  = actorQuote.Actor,
                Detail = actorQuote.Detail,
                Id     = actorQuote.Id
            };

            return(quoteView);
        }
Exemple #9
0
        public ActionResult <QuoteView> GetAnyQuote(string actor)
        {
            var quote = _service.GetAnyQuote(actor);

            if (quote != null)
            {
                var quoteView = new QuoteView();
                quoteView.Id     = quote.Id;
                quoteView.Actor  = quote.Actor;
                quoteView.Detail = quote.Detail;

                return(quoteView);
            }
            else
            {
                return(NotFound());
            }
        }
        private void OnQuoteUpdated()
        {
            int  oldRowSelectIndex = 0;
            bool bIsSelected       = false;

            if (null != QuoteView.CurrentRow)
            {
                oldRowSelectIndex = QuoteView.CurrentRow.Index;
                bIsSelected       = true;
            }

            QuoteView.DataSource = DataManager.Quote.QuoteWholeMgr.QuoteDict.Values.ToList();
            QuoteView.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
            if (bIsSelected)
            {
                QuoteView.CurrentCell = QuoteView[0, oldRowSelectIndex];
            }
            QuoteView.Refresh();
        }
Exemple #11
0
        public ActionResult <QuoteView> GetAnyQuote(string actor)
        {//Retorna uma frase aleatória do ator passado como parâmetro.
            var aleatorio = _service.GetAnyQuote(actor);

            if (aleatorio != null)
            {
                var retornoAux = new QuoteView()
                {
                    Id     = aleatorio.Id,
                    Actor  = aleatorio.Actor,
                    Detail = aleatorio.Detail
                };
                return(retornoAux);
            }
            else
            {
                return(NotFound());
            }
        }
Exemple #12
0
        public ActionResult <QuoteView> GetAnyQuote()
        {//Retorna uma frase aleatória de qualquer ator
            var aleatorio = _service.GetAnyQuote();

            if (aleatorio != null)
            {
                var retornoAux = new QuoteView()
                {
                    Id     = aleatorio.Id,
                    Actor  = aleatorio.Actor,
                    Detail = aleatorio.Detail
                };
                return(retornoAux);
            }
            else
            {
                return(NotFound());
            }
        }
Exemple #13
0
        public QuoteView GetQuote(int proposalId)
        {
            var quote      = new QuoteView();
            var query      = ProposalQueries.GetQuoteItems;
            var parameters = DataHelper.ExtractParameters(new { ProposalId = proposalId });
            var quoteItems = dbContext.GetList <ProposalItemView>(query, parameters);

            quote.Items = quoteItems;
            if (quote.Items.Count() > 0)
            {
                quote.SubTotal = quote.Items.ToList().Sum(t => t.LineTotal);
                quote.Discount = quote.Items.First().Discount;
                //invoice.VAT = ((invoice.SubTotal - invoice.Discount) * 5) / 100;
                //invoice.Total = (invoice.SubTotal- invoice.Discount) + invoice.VAT;
                quote.VAT   = (quote.SubTotal * quote.Items.First().VAT) / 100;
                quote.Total = (quote.SubTotal + quote.VAT) - quote.Discount;
            }
            return(quote);
        }
        public ActionResult <QuoteView> GetAnyQuote(string actor)
        {
            var quote = _service.GetAnyQuote(actor);

            if (quote == null)
            {
                return(NotFound());
            }


            var quoteView = new QuoteView
            {
                Id     = quote.Id,
                Actor  = quote.Actor,
                Detail = quote.Detail,
            };

            return(quoteView);
        }
        public ActionResult <QuoteView> GetAnyQuote()
        {
            var quote = _service.GetAnyQuote();

            if (quote != null)
            {
                var getJsonResponse = new QuoteView()
                {
                    Id     = quote.Id,
                    Actor  = quote.Actor,
                    Detail = quote.Detail
                };
                return(getJsonResponse);
            }
            else
            {
                return(NotFound());
            }
        }
Exemple #16
0
        public ActionResult <QuoteView> GetAnyQuote(string actor)
        {
            var itemAnyQuote = _service.GetAnyQuote(actor);

            if (itemAnyQuote != null)
            {
                var responseQuoteView = new QuoteView()
                {
                    Id     = itemAnyQuote.Id,
                    Actor  = itemAnyQuote.Actor,
                    Detail = itemAnyQuote.Detail
                };

                return(responseQuoteView);
            }
            else
            {
                return(NotFound());
            }
        }
Exemple #17
0
        public ActionResult <QuoteView> GetAnyQuote(string actor)
        {
            try
            {
                Quote quote = _service.GetAnyQuote(actor);
                if (quote == null)
                {
                    return(NotFound());
                }

                QuoteView quoteView = new QuoteView();
                quoteView.Id     = quote.Id;
                quoteView.Actor  = quote.Actor;
                quoteView.Detail = quote.Detail;
                return(quoteView);
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }
Exemple #18
0
        void initgvs()
        {
            
            // setting up all the model views supported by this quotopia instance

            // quotes
            QuoteView qv = new QuoteView();
            // custom bindings
            qv.SubscribeEvent+=new BasketDelegate(subscribe);
            qv.GetPositionsEvent += new PositionArrayDelegate(qv_GetPositionsEvent);
            qv.GetAllParentSymbols += new StringDelegate(qv_GetAllParentSymbols);
            qv.SendReconnectRequestEvent += new VoidDelegate(qv_SendReconnectRequestEvent);
            qv.Parent = split.Panel1;
            qv.KeyUp+=new KeyEventHandler(skub.KeyUp);
            gti = (GotTickIndicator)qv;
            bindaddview(qv);
            

            // account activity
            AccountActivityView av = new AccountActivityView();

            av.SendCancelEvent += new LongDelegate(av_SendCancelEvent);
            av.Parent = split.Panel1;
            actpos = (GotPositionIndicator)av;
            actord = (GotOrderIndicator)av;
            actfill = (GotFillIndicator)av;
            actcancel = (GotCancelIndicator)av;
            bindaddview(av);

            loadresponseview(rdll, rname);
            if (rmv!=null)
                bindaddview(rmv);

            updaterightclick();


        }
Exemple #19
0
        private void NewCall_Click(object sender, RoutedEventArgs e)
        {
            var QuoteWindow = new QuoteView();

            QuoteWindow.Show();
        }