Esempio n. 1
0
        //Creates a new ViewModel using the selected Type
        public AdminEventEditViewModel CreateAdminEventEditViewModel(EventTypeEnum type)
        {
            AdminEventEditViewModel vm = new AdminEventEditViewModel
            {
                EventType = type
            };
            var events = eventRepository.GetAllEvents();

            switch (type)
            {
            case EventTypeEnum.Bands:
                vm.ObjectList = bandRepository.GetAllBands().ToList <object>();
                vm.AdminBand  = new AdminBand();
                break;

            case EventTypeEnum.Concerts:
                vm.ObjectList   = concertRepository.GetAllConcerts().ToList <object>();
                vm.AdminConcert = CreateAdminConcert();
                break;

            case EventTypeEnum.Restaurants:
                vm.ObjectList      = CreateAdminRestaurantList();
                vm.AdminRestaurant = CreateAdminRestaurant();
                break;

            case EventTypeEnum.Locations:
                vm.Location   = new Location();
                vm.ObjectList = locationRepository.GetAllLocations().ToList <object>();
                break;
            }

            return(vm);
        }
Esempio n. 2
0
 public IEnumerable <Band> Get([FromQuery(Name = "rating")] int rating, [FromQuery(Name = "year")] int year)
 {
     if (rating == 0 && year == 0)
     {
         return(bandRepository.GetAllBands());
     }
     else
     {
         return(bandRepository.GetBandByQuery(rating, year));
     }
 }
Esempio n. 3
0
 // GET: api/band
 public IEnumerable <Band> Get()
 {
     return(bandRepository.GetAllBands());
 }
Esempio n. 4
0
        //
        // GET: /Album/Create

        public ActionResult Create()
        {
            ViewBag.PossibleBands  = bandRepository.GetAllBands();
            ViewBag.PossibleGenres = genreRepository.GetAllGenres();
            return(View());
        }
Esempio n. 5
0
 public async Task <IActionResult> Get()
 {
     return(new OkObjectResult(await _bandRepository.GetAllBands()));
 }
Esempio n. 6
0
        //
        // GET: /Bands/

        public ViewResult Index()
        {
            return(View(bandRepository.GetAllBands(band => band.Albums, band => band.Artists)));
        }