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); } }
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"); } }
public void deleteGenreFromDAL(Genre genre) { genresDAL.deleteGenre(genre); }
public Genre addOrEditGenreInDAL(Genre genre) { return genresDAL.createOrUpdateGenre(genre); }