예제 #1
0
        public IActionResult Create(ProductViewModel product, int[] selectedSuppliers)
        {
            if (!ModelState.IsValid)
            {
                return(StatusCode(400));
            }

            ViewBag.Suppliers = _supplierManager.GetSuppliers().ToList();
            product.Suppliers = _supplierManager.GetSuppliersByIds(selectedSuppliers);
            _productManager.AddGoods(new List <ProductViewModel> {
                product
            });
            return(View());
        }
예제 #2
0
 public void Post(IEnumerable <ProductViewModel> products)
 {
     _productManager.AddGoods(products);
 }