예제 #1
0
 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"));
     }
 }
예제 #2
0
        public string Create(Genre genre)
        {
            int number = _genreDao.Create(genre);

            return(number > 0 ? $"Добавление успешно" : $"Ошибка при добавлении жанра");
        }