예제 #1
0
        //
        // GET: /Shows/

        public ActionResult Index(bool noPages = false)
        {
            if (!noPages)
            {
                return(RedirectToAction("Page", new { pageNumber = 1 }));
            }

            IEnumerable <Show> shows = Service.GetAllShows();

            return(View(shows));
        }
예제 #2
0
 public ActionResult Shows()
 {
     return(View(new SearchShowsViewModel
     {
         Shows = ShowService.GetAllShows(User.Identity.GetUserId())
     }));
 }
예제 #3
0
        private List <ShowViewModel> EnactShowSearch(string searchTerm, int?releaseYear, int?rating, AwardStatus?accolades)
        {
            var results = ShowService.GetAllShows(User.Identity.GetUserId());

            if (!String.IsNullOrEmpty(searchTerm))
            {
                results = results.Where(r => r.MediaName.ToUpperInvariant().Contains(searchTerm.ToUpperInvariant())).ToList();
            }

            if (releaseYear != null)
            {
                results = results.Where(r => r.DateOfRelease.Year == releaseYear).ToList();
            }

            if (rating != null)
            {
                results = results.Where(r => (r.Rating >= rating - 1) && (r.Rating <= rating + 1)).ToList();
            }

            if (accolades != null)
            {
                results = results.Where(r => r.Accolades == accolades).ToList();
            }

            return(results);
        }
예제 #4
0
        // GET: All Shows
        public ActionResult AllShows()
        {
            ShowService service = new ShowService();
            IEnumerable <ShowListItem> allShows = service.GetAllShows();

            return(View(allShows));
        }
예제 #5
0
        public async Task <IActionResult> GetShows(ShowParams showParams)
        {
            var shows = await _service.GetAllShows(showParams);

            Response.AddPagination(shows.CurrentPage,
                                   shows.PageSize, shows.TotalCount,
                                   shows.TotalPages);
            return(Ok(shows));
        }
예제 #6
0
        private void Bind()
        {
            ShowService showService = new ShowService(Ioc.GetInstance <IShowRepository>());

            var shows = showService.GetAllShows();

            gridShows.DataSource = shows;
            gridShows.DataBind();
        }
예제 #7
0
        public void ServiceTest()
        {
            var shows = showService.GetAllShows();

            foreach (var show in shows)
            {
                var tl = showService.TicketsLeftForShow(show);
                Assert.IsTrue(tl >= 0 && tl <= Constants.Rows * Constants.Seats);
            }
        }
예제 #8
0
        private void Bind()
        {
            ShowService service    = new ShowService(Ioc.GetInstance <IShowRepository>());
            SetService  setService = new SetService(Ioc.GetInstance <ISetRepository>());

            var shows = service.GetAllShows();
            var sets  = setService.GetAllSets();

            foreach (var show in shows)
            {
                ddlShows.Items.Add(new ListItem(show.GetShowName(), show.ShowId.ToString()));
            }

            ListItem item = new ListItem("Please select a show", "-1");

            ddlShows.Items.Insert(0, item);

            item.Selected = true;

            foreach (Set set in sets)
            {
                StringBuilder setName = new StringBuilder();

                setName.Append(set.Notes);

                if (set.Official)
                {
                    setName.Append("***");
                }

                if (set.Encore)
                {
                    setName.Append(" (E)");
                }

                if (set.ShowId != null)
                {
                    setName.Append(" (S)");
                }

                if (set.SetNumber > 0)
                {
                    setName.Append(string.Format(" - {0}", set.SetNumber));
                }

                ddlSets.Items.Add(new ListItem(setName.ToString(), set.SetId.ToString()));
            }
            ListItem item2 = new ListItem("Please select a set", "-1");

            ddlSets.Items.Insert(0, item2);

            item2.Selected = true;
        }
예제 #9
0
 public IActionResult GetAllShows()
 {
     try
     {
         return(Ok(_eventService.GetAllShows()));
     }
     catch (ServiceException)
     {
         //TODO: Exception-Logging/Tracing
         return(BadRequest());
     }
 }
예제 #10
0
        //
        // GET: /Search/
        public ActionResult Index(string query)
        {
            if (!string.IsNullOrEmpty(query))
            {
                IEnumerable <Show> shows = Service.GetAllShows().Where(show => show.Name.IndexOf(query, StringComparison.OrdinalIgnoreCase) >= 0);

                if (Request.IsAjaxRequest())
                {
                    return(PartialView("_Suggestion", shows));
                }
                return(View("Index", shows));
            }
            return(null);
        }
예제 #11
0
        private void Bind()
        {
            TourService tourService = new TourService(Ioc.GetInstance <ITourRepository>());
            ShowService showService = new ShowService(Ioc.GetInstance <IShowRepository>());

            ddlTourType.Items.AddRange((from x in tourService.GetAllToursDescending() select new ListItem(x.TourName, x.TourId.ToString())).ToArray());
            ddlShowType.Items.AddRange((from x in showService.GetAllShows() select new ListItem(x.GetShowName(), x.ShowId.ToString())).ToArray());

            ListItem item = new ListItem("Please select either a tour or a song", "-1");

            ddlTourType.Items.Insert(0, item);
            ddlShowType.Items.Insert(0, item);

            item.Selected = true;
        }
예제 #12
0
        private void Bind()
        {
            var showService = new ShowService(Ioc.GetInstance <IShowRepository>());

            var shows = showService.GetAllShows();

            foreach (var show in shows)
            {
                ddlShow.Items.Add(new ListItem(show.GetShowName(), show.ShowId.ToString()));
            }

            var item = new ListItem("None", "0");

            ddlShow.Items.Insert(0, item);

            item.Selected = true;
        }
예제 #13
0
        private void Bind()
        {
            var showService = new ShowService(Ioc.GetInstance <IShowRepository>());

            var shows = showService.GetAllShows();

            foreach (var show in shows)
            {
                ddlShow.Items.Add(new ListItem(show.GetShowName(), show.ShowId.ToString()));
            }

            var item = new ListItem("None", "0");

            ddlShow.Items.Insert(0, item);

            item.Selected = true;

            ddlStatus.Items.AddRange(GetDropDownFromEnum(typeof(PosterStatus), 0, "Select a Status"));
        }
예제 #14
0
        public void Process(IQueryable <IWantedList> activeWantedLists)
        {
            var showService    = new ShowService(Ioc.GetInstance <IShowRepository>());
            var setService     = new SetService(Ioc.GetInstance <ISetRepository>());
            var setSongService = new SetSongService(Ioc.GetInstance <ISetSongRepository>());

            var liveSongManglers = (from show in showService.GetAllShows().OrderByDescending(x => x.ShowDate).Take(10)
                                    from set in setService.GetSetsForShow(show.ShowId)
                                    from setsong in setSongService.GetSetSongsBySet(set.SetId)
                                    select new LiveSongDateMangler {
                LiveSong = (SetSong)setsong, ShowDate = show.ShowDate.Value
            });

            foreach (var wanted in activeWantedLists)
            {
                //bust it raw dawg
                ///LEFT OFF HERE
            }
        }
예제 #15
0
 public ActionResult <List <Show> > GetAllShows()
 {
     return(_showService.GetAllShows());
 }
예제 #16
0
        public ActionResult ViewShows()
        {
            var shows = showService.GetAllShows();

            return(View(shows));
        }
예제 #17
0
 public ActionResult Index()
 {
     return(View(ShowService.GetAllShows(User.Identity.GetUserId())));
 }