// GET: Tickets/Details/5 public ActionResult CreateTicket() { int nooftickets = int.Parse(Request.QueryString["noofseats"]); int viewerId = int.Parse(Request.QueryString["viewerid"]); int showId = int.Parse(Request.QueryString["showid"]); int movieId = int.Parse(Request.QueryString["movieId"]); string seatnos = Request.QueryString["seatnumbers"]; ViewerProfileEntity viewer = ViewrProfilesBL.SearchViewerProfileByIdBL(viewerId); ShowEntity show = ShowsBL.SearchShowByIdBL(showId); MovyEntity movie = MovieBL.SearchMovieByIdBL(movieId); ScreenEntity screen = ScreenBL.SearchScreenByIdBL(show.ScreenId); ViewBag.ShowDate = show.ShowDate.ToShortDateString(); ViewBag.ShowId = show.ShowId; ViewBag.ViewerId = viewer.ViewersId; ViewBag.MovieName = movie.MovieName; ViewBag.Price = show.Price * nooftickets; ViewBag.NameOfCustomer = viewer.FirstName + " " + viewer.LastName; ViewBag.ScreenName = screen.ScreenName; ViewBag.noOfTickets = nooftickets; ViewBag.seatNos = seatnos; return(View()); }
public ActionResult ViewTicket(int id) { TicketEntity createTicket = new TicketEntity(); createTicket = TicketsBL.SearchTicketByIdBL(id); ViewerProfileEntity viewer = ViewrProfilesBL.SearchViewerProfileByIdBL(createTicket.ViewersId); ShowEntity show = ShowsBL.SearchShowByIdBL(createTicket.ShowId); MovyEntity movie = MovieBL.SearchMovieByIdBL(createTicket.MovieId); ScreenEntity screen = ScreenBL.SearchScreenByIdBL(show.ScreenId); ViewBag.ShowDate = show.ShowDate.ToShortDateString(); ViewBag.ShowId = show.ShowId; ViewBag.ViewerId = viewer.ViewersId; ViewBag.MovieName = movie.MovieName; ViewBag.Price = show.Price * createTicket.NoOfTickets; ViewBag.NameOfCustomer = viewer.FirstName + " " + viewer.LastName; ViewBag.ScreenName = screen.ScreenName; ViewBag.noOfTickets = createTicket.NoOfTickets; ViewBag.seatNos = createTicket.Seats; if (createTicket != null) { return(View()); } else { return(Redirect(string.Format("/Movies/ListAllMovies"))); } }
public int GetRoleValueByScreenCode(string screenCode) { int roleValue = 0; List <ScreenEntity> screenRoles = this.GetCacheScreenRoles(); if (!string.IsNullOrWhiteSpace(screenCode) && screenRoles != null) { ScreenEntity screen = screenRoles.FirstOrDefault(x => x.ScreenCode.ToUpper(CultureInfo.InvariantCulture).Equals(screenCode.ToUpper(CultureInfo.InvariantCulture))); if (screen != null) { roleValue = screen.Roles.Sum(x => x.RoleValue); } } return(roleValue); }
public static ScreenEntity SearchScreenByIdBL(int screenId) { ScreenEntity searchScreen = null; try { searchScreen = ScreenDAL.SearchScreenByIdDAL(screenId); } catch (MovieExceptions ex) { throw ex; } catch (Exception ex) { throw ex; } return(searchScreen); }
public List <ScreenEntity> ViewAllScreenDAL() { List <ScreenEntity> ObjLanguageList = new List <ScreenEntity>(); var objcontext = new CinestarEntitiesDAL(); var query = from s in objcontext.Screens select s; ScreenEntity objLanguageL = null; foreach (var newGenre in query) { objLanguageL = new ScreenEntity(); objLanguageL.ScreenId = newGenre.ScreenId; objLanguageL.ScreenName = newGenre.ScreenName; ObjLanguageList.Add(objLanguageL); } return(ObjLanguageList); }
public ActionResult CreateTicket(TicketEntity ticket) { int nooftickets = int.Parse(Request.QueryString["noofseats"]); int viewerId = int.Parse(Request.QueryString["viewerid"]); int showId = int.Parse(Request.QueryString["showid"]); int movieId = int.Parse(Request.QueryString["movieId"]); string seatnos = Request.QueryString["seatnumbers"]; ViewerProfileEntity viewer = ViewrProfilesBL.SearchViewerProfileByIdBL(viewerId); ShowEntity show = ShowsBL.SearchShowByIdBL(showId); MovyEntity movie = MovieBL.SearchMovieByIdBL(movieId); ScreenEntity screen = ScreenBL.SearchScreenByIdBL(show.ScreenId); TicketEntity createTicket = new TicketEntity(); createTicket.NoOfTickets = nooftickets; createTicket.ShowId = showId; ViewBag.MovieName = movie.MovieName; createTicket.Price = show.Price * nooftickets; createTicket.ViewersId = viewer.ViewersId; createTicket.TransactionDate = DateTime.Now.Date; createTicket.MovieId = movie.MovieId; createTicket.Seats = seatnos; if (ModelState.IsValid) { var IsAdded = TicketsBL.CreateTicketBL(createTicket); if (IsAdded) { return(Redirect(string.Format("/Payments/CompletePayment"))); } else { return(Redirect(string.Format("/SeatLayout/SelectSeatsView"))); } } else { return(Redirect(string.Format("/SeatLayout/SelectSeatsView"))); } }
public static ScreenEntity SearchScreenByIdDAL(int id) { ScreenEntity searchScreen = new ScreenEntity(); try { CinestarEntitiesDAL ObjContext = new CinestarEntitiesDAL(); var ObjScreen = ObjContext.Screens.Find(id); if (ObjScreen != null) { searchScreen.ScreenId = ObjScreen.ScreenId; searchScreen.ScreenName = ObjScreen.ScreenName; } } catch (Exception ex) { throw new MovieExceptions("Error : Reading searching data", ex); } return(searchScreen); }