Exemplo n.º 1
0
        public ActionResult Create(CatalogCreateViewModel vm)
        {
            if (ModelState.IsValid)
            {
                _catalogService.AddCatalog(vm.Code, vm.Description, vm.SelectedProducts.ToArray());
                return(RedirectToAction("Index"));
            }

            return(View(vm));
        }
Exemplo n.º 2
0
 public Catalog AddCatalog(Catalog catalog)
 {
     catalog.Date = DateTime.Now;
     return(catalogService.AddCatalog(catalog));
 }
 public async Task <ActionResult <Catalog> > Post(Catalog catalog)
 {
     return(await _catalogService.AddCatalog(catalog));
 }