Beispiel #1
0
 public IActionResult Create(CreateViewModel model, IFormFile[] ImageFiles)
 {
     if (ModelState.IsValid)
     {
         var result = sachRepository.Create(model, ImageFiles);
         if (result > 0)
         {
             return(RedirectToAction("Index", "Sach"));
         }
     }
     ViewData["Message"] = "Sản phẩm đã tồn tại";
     return(View());
 }
Beispiel #2
0
 public bool Create(SachModel model)
 {
     return(_res.Create(model));
 }