Пример #1
0
        public ActionResult Deal(int quoteId)
        {
            var quote = session.QueryOver<Quote>()
                .Where(q => q.Id == quoteId)
                .SingleOrDefault();

            if (quote == null || quote.HasExpired(DateTimeOffset.UtcNow))
            {
                return RedirectToAction("Quote");
            }

            var model = new DealModel();
            model.Quote = quote;
            model.QuoteId = quoteId;

            return View(model);
        }
Пример #2
0
        public ActionResult Deal(int quoteId)
        {
            var quote = quoteRepository
                .FindBy(q => q.Id == quoteId)
                .SingleOrDefault();

            if (quote == null || quote.HasExpired(DateTimeOffset.UtcNow))
            {
                return RedirectToAction("Quote");
            }

            var model = new DealModel();
            model.Quote = quote;
            model.QuoteId = quoteId;

            return View(model);
        }