예제 #1
0
        public ActionResult Create(QuotationViewModel quotation)
        {
            if (ModelState.IsValid)
            {
                var entity = Mapper.Map <Quotation>(quotation);
                quotationService.Insert(entity);
                return(RedirectToAction("Index"));
            }

            ViewBag.CustomerId = new SelectList(customerService.GetAll(), "Id", "FullName");
            ViewBag.ProductId  = new SelectList(productService.GetAll(), "Id", "Name");
            ViewBag.TaxId      = new SelectList(taxService.GetAll(), "Id", "Name");
            return(View(quotation));
        }