示例#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);
                }
            }
        }
        //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);
                }
            }
        }