Ejemplo n.º 1
0
        void ReleaseDesignerOutlets()
        {
            if (TitleInput != null)
            {
                TitleInput.Dispose();
                TitleInput = null;
            }

            if (AuthorInput != null)
            {
                AuthorInput.Dispose();
                AuthorInput = null;
            }

            if (GenreInput != null)
            {
                GenreInput.Dispose();
                GenreInput = null;
            }

            if (ISBNInput != null)
            {
                ISBNInput.Dispose();
                ISBNInput = null;
            }

            if (LocationInput != null)
            {
                LocationInput.Dispose();
                LocationInput = null;
            }
        }
Ejemplo n.º 2
0
        public ActionResult DoCreate(GenreInput input)
        {
            var genre = input.CreateGenre(FilmsDao);

            GenresDao.Add(genre);

            return(RedirectToAction("Index"));
        }
Ejemplo n.º 3
0
        public static Genre CreateGenre(this GenreInput input, IDaoFilm daoFilm)
        {
            var genre = new Genre()
            {
                Name = input.Name
            };

            if (input.FilmsOfGenre != null)
            {
                foreach (var id in input.FilmsOfGenre)
                {
                    var film = daoFilm.Find(id);

                    genre.AddFilm(film);
                }
            }

            return(genre);
        }