示例#1
0
 public HomeController()
 {
     authorsDb = AuthorsTableConnection.Instance;
     genresDb  = GenresTableConnection.Instance;
     datesDb   = DatesTableConnection.Instance;
     playsDb   = PlaysTableConnection.Instance;
 }
示例#2
0
 public RepositoryMovie(IConnectionFactory connectionFactory) : base(connectionFactory)
 {
     _movieDao      = DaoFactory.CreateMovieDao();
     _genreDao      = DaoFactory.CreateGenreDao();
     _movieActorDao = DaoFactory.CreateMovieActorDao();
     _actorDao      = DaoFactory.CreateActorDao();
 }
示例#3
0
        /// <summary>
        /// Gets all need information in ViewBag
        /// </summary>
        /// <param name="id">Date id</param>
        private void getViewBagForOrderPage(int id)
        {
            ViewBag.DateId = id;

            IOrderDao orders = OrdersTableConnection.Instance;

            IDateDao datesDb     = DatesTableConnection.Instance;
            DatePlay currentDate = datesDb.GetDateById(id);

            IPlayDao playsDb = PlaysTableConnection.Instance;
            Play     play    = playsDb.GetPlayById(currentDate.PlayId);

            ViewBag.Play = play;

            IGenreDao genresDb = GenresTableConnection.Instance;

            ViewBag.Genre = genresDb.GetGenreById(play.GenreId);

            IAuthorDao authorsDb = AuthorsTableConnection.Instance;

            ViewBag.Author = authorsDb.GetAuthorById(play.AuthorId);

            ViewBag.Dates = datesDb.GetDatesByIdPlay(play.Id).OrderBy(x => x.Date).ToList();

            ViewBag.TotalCountBalconySeats = TheaterInformation.TotalCountBalconySeats;
            ViewBag.PriceBalconySeats      = TheaterInformation.PriceBalcony;
            ViewBag.FreeBalconySeats       = (TheaterInformation.TotalCountBalconySeats -
                                              orders.GetCountBusySeetsByDateIdAndCategory(id, 0));

            ViewBag.TotalCountParterreSeats = TheaterInformation.TotalCountParterreSeats;
            ViewBag.PriceParterreSeats      = TheaterInformation.PriceParterre;
            ViewBag.FreeParterreSeats       = (TheaterInformation.TotalCountParterreSeats -
                                               orders.GetCountBusySeetsByDateIdAndCategory(id, 1));
        }
示例#4
0
 public PlaysController()
 {
     loginsDb  = LoginsTableConnection.Instance;
     datesDb   = DatesTableConnection.Instance;
     ordersDb  = OrdersTableConnection.Instance;
     playsDb   = PlaysTableConnection.Instance;
     authorsDb = AuthorsTableConnection.Instance;
     genresDb  = GenresTableConnection.Instance;
 }
示例#5
0
        // GET: Home
        public ActionResult Index()
        {
            IPlayDao playsDb = PlaysTableConnection.Instance;

            ViewBag.Plays = playsDb.GetAllPlays();

            IAuthorDao authorsDb = AuthorsTableConnection.Instance;

            ViewBag.Authors = authorsDb.GetAllAuthors();

            IGenreDao genresDb = GenresTableConnection.Instance;

            ViewBag.Genres = genresDb.GetAllGenres();

            IDateDao datesDb = DatesTableConnection.Instance;

            ViewBag.Dates = datesDb.GetAllDates().OrderBy(x => x.Date).ToList();

            return(View());
        }
示例#6
0
        // GET: Plays/Description
        public ActionResult Description(int id)
        {
            try
            {
                IPlayDao playsDb = PlaysTableConnection.Instance;
                Play     play    = playsDb.GetPlayById(id);
                ViewBag.Play = play;

                IGenreDao genresDb = GenresTableConnection.Instance;
                ViewBag.Genre = genresDb.GetGenreById(play.GenreId);

                IAuthorDao authorsDb = AuthorsTableConnection.Instance;
                ViewBag.Author = authorsDb.GetAuthorById(play.AuthorId);

                IDateDao datesDb = DatesTableConnection.Instance;
                ViewBag.Dates = datesDb.GetDatesByIdPlay(play.Id).OrderBy(x => x.Date).ToList();
            }
            catch (NullReferenceException)
            {
                return(RedirectToAction("Index", "Home"));
            }
            return(View());
        }
示例#7
0
 public GenreLogic(IGenreDao genreDao)
 {
     _genreDao = genreDao;
 }
 public GenreService(IGenreDao genreDao, IGenreFactory genreFactory)
 {
     _genreDao = genreDao;
     _genreFactory = genreFactory;
 }
 public GenreService(IGenreDao genreDao, IGenreFactory genreFactory)
 {
     _genreDao     = genreDao;
     _genreFactory = genreFactory;
 }
 public GenresController(IGenreDao genreDao)
 {
     this.genreDao = genreDao;
 }
示例#11
0
 public GenreLogic(IGenreDao genreDao)
 {
     this._genreDao = genreDao;
 }