private QuoteView GetQuoteView(Quote quote) { var quoteView = new QuoteView() { Id = quote.Id, Actor = quote.Actor, Detail = quote.Detail }; return(quoteView); }
private QuoteView ConvertQuote(Quote quote) { QuoteView quoteView = new QuoteView() { Id = quote.Id, Actor = quote.Actor, Detail = quote.Detail }; return(quoteView); }
public ActionResult <QuoteView> GetAnyQuote() { var quote = _service.GetAnyQuote(); QuoteView quoteView = new QuoteView() { Actor = quote.Actor, Detail = quote.Detail, Id = quote.Id }; return(quoteView); }
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()); }
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)); }
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)); }
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); }
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(); }
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()); } }
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()); } }
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()); } }
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()); } }
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)); } }
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(); }
private void NewCall_Click(object sender, RoutedEventArgs e) { var QuoteWindow = new QuoteView(); QuoteWindow.Show(); }