Exemplo n.º 1
0
        //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);
                }
            }
        }
Exemplo n.º 2
0
        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;
                }
            }
        }
Exemplo n.º 3
0
        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);
            }
        }
Exemplo n.º 4
0
        //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;
            }
        }
Exemplo n.º 5
0
 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;
     }
 }
Exemplo n.º 6
0
        //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;
        }
Exemplo n.º 7
0
 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;
     }
 }
Exemplo n.º 8
0
        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;
            }
        }
Exemplo n.º 9
0
        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;
            }
        }
Exemplo n.º 10
0
        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;
            }
        }
Exemplo n.º 11
0
        //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);
            }
        }
Exemplo n.º 12
0
        //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);
                }
            }
        }
Exemplo n.º 13
0
 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;
     }
 }
Exemplo n.º 14
0
        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;
                }

            }
        }
Exemplo n.º 15
0
        //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);
                }

            }
        }
Exemplo n.º 16
0
 //Method that processes Theater selection
 private void TheaterSelection(SelectedParamterArgs esp)
 {
 }
Exemplo n.º 17
0
 //Method that processes Performance selection and redirects to payment
 private void PerformanceSelection(SelectedParamterArgs esp)
 {
 }
Exemplo n.º 18
0
 //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;
 }
Exemplo n.º 19
0
 //Method that process Movie selection - the movie was selected by pressing the button
 private void MovieWasSelected(SelectedParamterArgs esp)
 {
 }
Exemplo n.º 20
0
 //Method that processes Movie selection - presents short description of the movie
 private void MovieSelection(SelectedParamterArgs esp)
 {
 }
Exemplo n.º 21
0
        //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);
                }
            }
        }
Exemplo n.º 22
0
 //Method that processes the City Selection
 private void CitySelection(SelectedParamterArgs esp)
 {
 }
Exemplo n.º 23
0
 //Method that processes Movie selection - presents short description of the movie
 private void MovieSelection(SelectedParamterArgs esp)
 {
 }
Exemplo n.º 24
0
 //Method that processes the City Selection
 private void CitySelection(SelectedParamterArgs esp)
 {
 }
Exemplo n.º 25
0
 //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;
     }
 }
Exemplo n.º 26
0
 //Method that process Movie selection - the movie was selected by pressing the button
 private void MovieWasSelected(SelectedParamterArgs esp)
 {
 }
Exemplo n.º 27
0
 //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);
     }
 }
Exemplo n.º 28
0
 //Method that processes Performance selection and redirects to payment
 private void PerformanceSelection(SelectedParamterArgs esp)
 {
 }
Exemplo n.º 29
0
 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);
     }
 }
Exemplo n.º 30
0
 //Method that processes Theater selection
 private void TheaterSelection(SelectedParamterArgs esp)
 {
 }