public ActionResult RemoveShow() { ShowDal shows = new ShowDal(); shows.GetAllShows(); return(View(shows)); }
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")); }
public void UpdateShow(Contracts.Show showToUpdate) { ShowDal dal = new ShowDal(); dal.UpdateEntity(showToUpdate); }
int IShowsManager.CreateShow(Contracts.Show showToCreate) { ShowDal dal = new ShowDal(); return dal.CreateEntity(showToCreate); }
public Contracts.Show FindShow(int showID) { ShowDal dal = new ShowDal(); return dal.GetEntity(showID); }
public void DeleteShow(int showId) { ShowDal dal = new ShowDal(); dal.DeleteEntity(showId); }
public void CreateShow(Contracts.Show showToCreate) { ShowDal dal = new ShowDal(); dal.CreateEntity(showToCreate); }
public Contracts.Show[] FindShows(Contracts.ShowCriteria showCriteria) { ShowDal dal = new ShowDal(); return dal.GetShowsByCriteria(showCriteria); }