public ActionResult CreateGenre(Genre genre) { try { genresDb.Create(genre); messagesGenreTable = Resources.Resource.MessageCreated; return(RedirectToAction("GenresTable", "Admin")); } catch { messagesGenreTable = Resources.Resource.Error; return(RedirectToAction("GenresTable", "Admin")); } }
public string Create(Genre genre) { int number = _genreDao.Create(genre); return(number > 0 ? $"Добавление успешно" : $"Ошибка при добавлении жанра"); }