//Method that processes Theater selection private void TheaterSelection(SelectedParamterArgs esp) { IUser UserServices = new UserServices(); IList <UserPerformanceDTO> ListOfPerformances = new List <UserPerformanceDTO>(); Guid TheaterID = new Guid(); String SelectedTheaterID = esp.SelectedValue; bool isGuid = Guid.TryParse(SelectedTheaterID, out TheaterID); int movieID = 0; String SelectedMovieID = esp.OptionalSlectedValue; bool isInt = int.TryParse(SelectedMovieID, out movieID); if (isGuid && isInt) { ListOfPerformances = UserServices.GetPerformancesByTheaterIDandMovieID(TheaterID, movieID); TicketView.Model.PerformanceList = new List <PerformanceLine>(); foreach (var item in ListOfPerformances) { PerformanceLine row = new PerformanceLine(); row.PerformanceID = item.performanceID.ToString(); row.PerformaceDate = item.Date; row.StartingTime = item.StartingTime; row.Duration = item.Duration; row.Price = item.price.ToString(); TicketView.Model.PerformanceList.Add(row); } } }
protected void GridViewTheater_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Select") { int index = Convert.ToInt32(e.CommandArgument); GridViewRow row = GridViewTheater.Rows[index]; String SelectedTheaterID = row.Cells[0].Text; String SelectedTheaterName = row.Cells[1].Text; String SelectedMovieID = lblMovieID.Text; SelectedParamterArgs esp = new SelectedParamterArgs(SelectedTheaterID, SelectedMovieID); if (TheaterSelection != null) { TheaterSelection(esp); GridViewPerformance.DataSource = Model.PerformanceList; GridViewPerformance.DataBind(); lblTheater.Text = "Selected Theater: "; lblSelectedTheater.Text = string.Format("{0}.", SelectedTheaterName); ddlCityList.Enabled = false; } } }
protected void GridViewPerformance_SelectedIndexChanged(object sender, EventArgs e) { String SelectedPerformanceID = GridViewPerformance.SelectedRow.Cells[0].Text; SelectedParamterArgs esp = new SelectedParamterArgs(SelectedPerformanceID); if (PerformanceSelection != null) { PerformanceSelection(esp); } }
//Method that takes the selected movie and presents movie description protected void MovieListBox_SelectedIndexChanged(object sender, EventArgs e) { String SlectedMovieID = ListBoxMovies.SelectedItem.Value.ToString(); SelectedParamterArgs esp = new SelectedParamterArgs(SlectedMovieID); if (MovieSelection != null) { MovieSelection(esp); lblMovieDescription.Text = Model.MovieDescription; } }
protected void ddlCityList_SelectedIndexChanged(object sender, EventArgs e) { String SelectedCity = ddlCityList.SelectedItem.Text; SelectedParamterArgs esp = new SelectedParamterArgs(SelectedCity); if (CitySelection != null) { CitySelection(esp); GridViewTheater.DataSource = Model.TheaterList; GridViewTheater.DataBind(); lblCity.Text = "Selected city: "; lblSelectedCity.Text = string.Format("{0}.", SelectedCity); btnSelectMovie.Enabled = false; } }
//Method that processes Movie selection - presents short description of the movie private void MovieSelection(SelectedParamterArgs esp) { IUser UserServices = new UserServices(); String Description = null; String SelectedMovieID = esp.SelectedValue; int movieID = 0; bool checkGuid = int.TryParse(SelectedMovieID, out movieID); if (checkGuid) { Description = UserServices.GetMovieDescriptionByMovieID(movieID); } TicketView.Model.MovieDescription = Description; }
protected void btnSelectMovie_Click(object sender, EventArgs e) { String SlectedMovieID = ListBoxMovies.SelectedItem.Value.ToString(); String SelectedMovieName= ListBoxMovies.SelectedItem.Text; SelectedParamterArgs esp = new SelectedParamterArgs(SlectedMovieID); if (MovieWasSelected != null) { MovieWasSelected(esp); ddlCityList.DataSource = Model.CityList; ddlCityList.DataBind(); lblMovie.Text = "Selected movie: "; lblSelectedMovie.Text = string.Format("{0}.", SelectedMovieName); //btnSelectMovie.Enabled = false; } }
protected void ddlCityList_SelectedIndexChanged(object sender, EventArgs e) { String SelectedCity = ddlCityList.SelectedItem.Text; SelectedParamterArgs esp = new SelectedParamterArgs(SelectedCity); if (CitySelection != null) { CitySelection(esp); GridViewTheater.DataSource = Model.TheaterList; GridViewTheater.DataBind(); lblCity.Text = "Selected city: "; lblSelectedCity.Text = string.Format("{0}.", SelectedCity); btnSelectMovie.Enabled = false; } }
protected void GridViewTheater_SelectedIndexChanged(object sender, EventArgs e) { String SelectedTheaterID = GridViewTheater.SelectedRow.Cells[0].Text; String SelectedTheaterName = GridViewTheater.SelectedRow.Cells[1].Text; SelectedParamterArgs esp = new SelectedParamterArgs(SelectedTheaterID); if (TheaterSelection != null) { TheaterSelection(esp); GridViewPerformance.DataSource = Model.PerformanceList; GridViewPerformance.DataBind(); lblTheater.Text = "Selected Theater: "; lblSelectedTheater.Text = string.Format("{0}.", SelectedTheaterName); ddlCityList.Enabled = false; } }
protected void btnSelectMovie_Click(object sender, EventArgs e) { String SlectedMovieID = ListBoxMovies.SelectedItem.Value.ToString(); String SelectedMovieName = ListBoxMovies.SelectedItem.Text; SelectedParamterArgs esp = new SelectedParamterArgs(SlectedMovieID); if (MovieWasSelected != null) { MovieWasSelected(esp); ddlCityList.DataSource = Model.CityList; ddlCityList.DataBind(); lblMovie.Text = "Selected movie: "; lblSelectedMovie.Text = string.Format("{0}.", SelectedMovieName); //btnSelectMovie.Enabled = false; } }
//Method that processes the City Selection private void CitySelection(SelectedParamterArgs esp) { IUser UserServices = new UserServices(); IList <UserTheaterDTO> ListOfTheters = new List <UserTheaterDTO>(); String SelectedCity = esp.SelectedValue; String SelectedMovie = esp.OptionalSlectedValue; int movieID = int.Parse(SelectedMovie); ListOfTheters = UserServices.GetTheatersByCity(SelectedCity, movieID); TicketView.Model.TheaterList = new List <TheaterLine>(); foreach (var item in ListOfTheters) { TheaterLine row = new TheaterLine(); row.TheaterID = item.TheaterID.ToString(); row.TheaterName = item.TheaterName; row.Address = item.TheaterAddress; TicketView.Model.TheaterList.Add(row); } }
//Method that process Movie selection - the movie was selected by pressing the button private void MovieWasSelected(SelectedParamterArgs esp) { int movieID = 0; bool checkIfInt = int.TryParse(esp.SelectedValue.ToString(), out movieID); if (checkIfInt) { IUser UserServices = new UserServices(); IList <String> ListOfCities = new List <String>(); ListOfCities = UserServices.GetCitiesByMovieID(movieID); List <String> ListOfCitiesRevised = new List <String>(); TicketView.Model.CityList = new List <CityLine>(); //Running loop in order to remove repeation of cities in the list foreach (var item in ListOfCities) { if (!ListOfCitiesRevised.Contains(item)) { ListOfCitiesRevised.Add(item); } } TicketView.Model.CityList = new List <CityLine>(); //Adding first value to CityList that will be dispalyed CityLine row1 = new CityLine(); row1.CityID = "None"; row1.CityName = "Select city..."; TicketView.Model.CityList.Add(row1); //Loop to transfer data from City Revised to List that will be displayed= List<CityLine> foreach (var item in ListOfCitiesRevised) { CityLine row = new CityLine(); row.CityID = item; row.CityName = item; TicketView.Model.CityList.Add(row); } } }
protected void GridViewTheater_SelectedIndexChanged(object sender, EventArgs e) { String SelectedTheaterID = GridViewTheater.SelectedRow.Cells[0].Text; String SelectedTheaterName=GridViewTheater.SelectedRow.Cells[1].Text; SelectedParamterArgs esp = new SelectedParamterArgs(SelectedTheaterID); if (TheaterSelection != null) { TheaterSelection(esp); GridViewPerformance.DataSource = Model.PerformanceList; GridViewPerformance.DataBind(); lblTheater.Text = "Selected Theater: "; lblSelectedTheater.Text = string.Format("{0}.", SelectedTheaterName); ddlCityList.Enabled = false; } }
protected void GridViewTheater_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Select") { int index = Convert.ToInt32(e.CommandArgument); GridViewRow row = GridViewTheater.Rows[index]; String SelectedTheaterID = row.Cells[0].Text; String SelectedTheaterName = row.Cells[1].Text; String SelectedMovieID = lblMovieID.Text; SelectedParamterArgs esp = new SelectedParamterArgs(SelectedTheaterID, SelectedMovieID); if (TheaterSelection != null) { TheaterSelection(esp); GridViewPerformance.DataSource = Model.PerformanceList; GridViewPerformance.DataBind(); lblTheater.Text = "Selected Theater: "; lblSelectedTheater.Text = string.Format("{0}.", SelectedTheaterName); ddlCityList.Enabled = false; } } }
//Method that process Movie selection - the movie was selected by pressing the button private void MovieWasSelected(SelectedParamterArgs esp) { int movieID = 0; bool checkIfInt = int.TryParse(esp.SelectedValue.ToString(), out movieID); if (checkIfInt) { IUser UserServices = new UserServices(); IList<String> ListOfCities = new List<String>(); ListOfCities = UserServices.GetCitiesByMovieID(movieID); List<String> ListOfCitiesRevised = new List<String>(); TicketView.Model.CityList = new List<CityLine>(); //Running loop in order to remove repeation of cities in the list foreach (var item in ListOfCities) { if(!ListOfCitiesRevised.Contains(item)) { ListOfCitiesRevised.Add(item); } } TicketView.Model.CityList = new List<CityLine>(); //Adding first value to CityList that will be dispalyed CityLine row1 = new CityLine(); row1.CityID = "None"; row1.CityName = "Select city..."; TicketView.Model.CityList.Add(row1); //Loop to transfer data from City Revised to List that will be displayed= List<CityLine> foreach (var item in ListOfCitiesRevised) { CityLine row = new CityLine(); row.CityID = item; row.CityName = item; TicketView.Model.CityList.Add(row); } } }
//Method that processes Theater selection private void TheaterSelection(SelectedParamterArgs esp) { }
//Method that processes Performance selection and redirects to payment private void PerformanceSelection(SelectedParamterArgs esp) { }
//Method that processes Movie selection - presents short description of the movie private void MovieSelection(SelectedParamterArgs esp) { IUser UserServices = new UserServices(); String Description = null; String SelectedMovieID = esp.SelectedValue; int movieID = 0; bool checkGuid= int.TryParse(SelectedMovieID, out movieID); if(checkGuid) Description = UserServices.GetMovieDescriptionByMovieID(movieID); TicketView.Model.MovieDescription = Description; }
//Method that process Movie selection - the movie was selected by pressing the button private void MovieWasSelected(SelectedParamterArgs esp) { }
//Method that processes Movie selection - presents short description of the movie private void MovieSelection(SelectedParamterArgs esp) { }
//Method that processes Theater selection private void TheaterSelection(SelectedParamterArgs esp) { IUser UserServices = new UserServices(); IList<UserPerformanceDTO> ListOfPerformances = new List<UserPerformanceDTO>(); Guid TheaterID = new Guid(); String SelectedTheaterID = esp.SelectedValue; bool isGuid = Guid.TryParse(SelectedTheaterID, out TheaterID); int movieID = 0; String SelectedMovieID = esp.OptionalSlectedValue; bool isInt = int.TryParse(SelectedMovieID, out movieID); if (isGuid&&isInt) { ListOfPerformances = UserServices.GetPerformancesByTheaterIDandMovieID(TheaterID, movieID); TicketView.Model.PerformanceList = new List<PerformanceLine>(); foreach (var item in ListOfPerformances) { PerformanceLine row = new PerformanceLine(); row.PerformanceID = item.performanceID.ToString(); row.PerformaceDate = item.Date; row.StartingTime = item.StartingTime; row.Duration = item.Duration; row.Price = item.price.ToString(); TicketView.Model.PerformanceList.Add(row); } } }
//Method that processes the City Selection private void CitySelection(SelectedParamterArgs esp) { }
//Method that processes Movie selection - presents short description of the movie private void MovieSelection(SelectedParamterArgs esp) { }
//Method that processes the City Selection private void CitySelection(SelectedParamterArgs esp) { }
//Method that takes the selected movie and presents movie description protected void MovieListBox_SelectedIndexChanged(object sender, EventArgs e) { String SlectedMovieID = ListBoxMovies.SelectedItem.Value.ToString(); SelectedParamterArgs esp = new SelectedParamterArgs(SlectedMovieID); if (MovieSelection != null) { MovieSelection(esp); lblMovieDescription.Text = Model.MovieDescription; } }
//Method that process Movie selection - the movie was selected by pressing the button private void MovieWasSelected(SelectedParamterArgs esp) { }
//Method that processes the City Selection private void CitySelection(SelectedParamterArgs esp) { IUser UserServices = new UserServices(); IList <UserTheaterDTO> ListOfTheters = new List<UserTheaterDTO>(); String SelectedCity = esp.SelectedValue; String SelectedMovie = esp.OptionalSlectedValue; int movieID = int.Parse(SelectedMovie); ListOfTheters = UserServices.GetTheatersByCity(SelectedCity,movieID); TicketView.Model.TheaterList = new List<TheaterLine>(); foreach (var item in ListOfTheters) { TheaterLine row = new TheaterLine(); row.TheaterID = item.TheaterID.ToString(); row.TheaterName = item.TheaterName; row.Address = item.TheaterAddress; TicketView.Model.TheaterList.Add(row); } }
//Method that processes Performance selection and redirects to payment private void PerformanceSelection(SelectedParamterArgs esp) { }
protected void GridViewPerformance_SelectedIndexChanged(object sender, EventArgs e) { String SelectedPerformanceID = GridViewPerformance.SelectedRow.Cells[0].Text; SelectedParamterArgs esp = new SelectedParamterArgs(SelectedPerformanceID); if (PerformanceSelection != null) { PerformanceSelection(esp); } }
//Method that processes Theater selection private void TheaterSelection(SelectedParamterArgs esp) { }