Ejemplo n.º 1
0
        public ActionResult RemoveShow()
        {
            ShowDal shows = new ShowDal();

            shows.GetAllShows();
            return(View(shows));
        }
Ejemplo n.º 2
0
        public ActionResult AddShow(int hallId, string MovieName, DateTime time = default)
        {
            if (hallId == 0 || MovieName == "0" || time == null)
            {
                string msg = "You need to fill the details of the new show";
                return(RedirectToAction("AddShow", "Admin", new { msg }));
            }

            if (time < DateTime.Now.AddDays(1))
            {
                string msg = "Adding show time need to be 24 Hour before show!!";
                return(RedirectToAction("AddShow", "Admin", new { msg }));
            }
            ShowDal sd = new ShowDal();

            sd.GetAllHallShow(hallId);
            foreach (Show s in sd.MyList)
            {
                Movie m = new Movie();
                m.GetMovieById(s.movie);

                if (Math.Abs(s.dateTime.Subtract(time).TotalMinutes) < m.MovieLength + 30)
                {
                    string msg = "Invalid Date Or Time";
                    return(RedirectToAction("AddShow", "Admin", new { msg }));
                }
            }
            Show show = new Show
            {
                hall     = hallId,
                movie    = Movie.GetIdByName(MovieName),
                dateTime = time
            };

            show.AddToDb();

            return(RedirectToAction("AdminHomePage", "Admin"));
        }
Ejemplo n.º 3
0
 public void UpdateShow(Contracts.Show showToUpdate)
 {
     ShowDal dal = new ShowDal();
     dal.UpdateEntity(showToUpdate);
 }
Ejemplo n.º 4
0
 int IShowsManager.CreateShow(Contracts.Show showToCreate)
 {
     ShowDal dal = new ShowDal();
     return dal.CreateEntity(showToCreate);
 }
Ejemplo n.º 5
0
 public Contracts.Show FindShow(int showID)
 {
     ShowDal dal = new ShowDal();
     return dal.GetEntity(showID);
 }
Ejemplo n.º 6
0
 public void DeleteShow(int showId)
 {
     ShowDal dal = new ShowDal();
     dal.DeleteEntity(showId);
 }
Ejemplo n.º 7
0
 public void CreateShow(Contracts.Show showToCreate)
 {
     ShowDal dal = new ShowDal();
     dal.CreateEntity(showToCreate);
 }
Ejemplo n.º 8
0
 public Contracts.Show[] FindShows(Contracts.ShowCriteria showCriteria)
 {
     ShowDal dal = new ShowDal();
     return dal.GetShowsByCriteria(showCriteria);
 }