示例#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);
 }