Пример #1
0
        public ActionResult Create()
        {
            // We create a shell of a quote and redirect to the edit
            var quote = new Quote();

            quote.CreatedOn  = DateTime.Now;
            quote.ModifiedOn = DateTime.Now;
            quote.IsActive   = false;
            using (var um = new UserManager())
            {
                var user = um.ByUsername(User.Identity.Name);
                if (user.CompanyID != null)
                {
                    quote.CompanyID = user.CompanyID;
                }
                quote.EmployeeID = user.ID;
            }
            using (var qm = new QuoteManager())
            {
                quote = qm.Create(quote);
            }
            return(RedirectToAction("Options", new { id = quote.ID }));
        }