示例#1
0
        public ActionResult Create(CreateProductModel model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    var entity = model.ToEntity();
                    _productService.Add(entity);
                }

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
示例#2
0
 //
 // GET: /Admin/Product/Create
 public ActionResult Create()
 {
     var model = new CreateProductModel();
     model.AllCategories = _productCategoryService.GetProductCategorySelectList(model.CategoryName, GlobalHelper.SelectListDefaultOption);
     return View(model);
 }