Пример #1
0
 public ActionResult Delete(Genre genre)
 {
     try
     {
         // TODO: Add delete logic here
         genreService.deleteGenreFromDAL(genre);
         return RedirectToAction("Index");
     }
     catch
     {
         ViewBag.Message = "Delete is inpossible.";
         return View(genre);
     }
 }
Пример #2
0
 public ActionResult Edit(Genre model)
 {
     try
     {
         // TODO: Add update logic here
         if(!ModelState.IsValid)
             return View(model);
         return View("Details", genreService.addOrEditGenreInDAL(model));
     }
     catch
     {
         return RedirectToAction("Index");
     }
 }
Пример #3
0
 public void deleteGenreFromDAL(Genre genre)
 {
     genresDAL.deleteGenre(genre);
 }
Пример #4
0
 public Genre addOrEditGenreInDAL(Genre genre)
 {
     return genresDAL.createOrUpdateGenre(genre);
 }