Exemple #1
0
        public IEnumerable <object> Get(string request)
        {
            try
            {
                if (request == null)
                {
                    throw new HttpResponseException(Request.CreateResponse(System.Net.HttpStatusCode.NotFound));
                }
                Festival.SingleFestival = Festival.GetFestival();

                Festival.SingleFestival.ComputeLineUps();
                switch (request.ToLower())
                {
                case "bands":
                    return(Festival.SingleFestival.Bands);

                case "optredens":
                    return(Festival.SingleFestival.Optredens);

                case "stages":
                    return(Festival.SingleFestival.Stages);

                case "genres":
                    return(Festival.SingleFestival.Genres);

                default: throw new HttpResponseException(Request.CreateResponse(System.Net.HttpStatusCode.NotFound));
                }
            }
            catch (Exception ex)
            {
                throw new HttpResponseException(Request.CreateResponse(System.Net.HttpStatusCode.NotFound));
            }
        }
Exemple #2
0
 //ophalen uit model
 public SettingsVM()
 {
     _types        = ContactPersonType.GetTypes();
     _changeTypes  = ContactPersonType.GetTypes();
     _festival     = Festival.GetFestival();
     _tickettypes  = TicketType.GetTicketTypes();
     _stagetypes   = Stage.GetStages();
     _Bands        = Band.GetBands();
     _genres       = Genre.GetGenres();
     _changeGenres = Genre.GetGenres();
 }
Exemple #3
0
        //
        // GET: /Dag/Details/5

        public ActionResult Details(DayOfWeekBE dag)
        {
            Festival.SingleFestival = Festival.GetFestival();
            Festival.SingleFestival.ComputeLineUps();
            var lineups = Festival.SingleFestival.LineUps.Where(lineup => lineup.Dag.BeDayOfWeek() == dag);

            if (lineups == null || lineups.Count() < 1)
            {
                return(RedirectToAction("Index"));
            }
            return(View(lineups.First()));
        }
Exemple #4
0
        //
        // GET: /Dag/

        public ActionResult Index()
        {
            Festival.SingleFestival = Festival.GetFestival();
            Festival.SingleFestival.ComputeLineUps();
            var lineups = Festival.SingleFestival.LineUps;

            if (lineups == null || lineups.Count() < 1)
            {
                return(RedirectToAction("Index", "Home"));
            }
            return(View(lineups));
        }
Exemple #5
0
        public IEnumerable <object> Get(string request, string id)
        {
            try
            {
                if (request == null || string.IsNullOrEmpty(id))
                {
                    throw new HttpResponseException(Request.CreateResponse(System.Net.HttpStatusCode.NotFound));
                }
                Festival.SingleFestival = Festival.GetFestival();

                Festival.SingleFestival.ComputeLineUps();
                switch (request.ToLower())
                {
                case "bands":
                    var bands = Festival.SingleFestival.Bands.Where(band => band.ID == id);
                    if (bands == null || bands.Count() < 1)
                    {
                        throw new HttpResponseException(Request.CreateResponse(System.Net.HttpStatusCode.NotFound));
                    }
                    return(bands);

                case "optredens":
                    var optredens = Festival.SingleFestival.Optredens.Where(optreden => optreden.ID == id);
                    if (optredens == null || optredens.Count() < 1)
                    {
                        throw new HttpResponseException(Request.CreateResponse(System.Net.HttpStatusCode.NotFound));
                    }
                    return(optredens);

                case "stages":
                    var stages = Festival.SingleFestival.Stages.Where(stage => stage.ID == id);
                    if (stages == null || stages.Count() < 1)
                    {
                        throw new HttpResponseException(Request.CreateResponse(System.Net.HttpStatusCode.NotFound));
                    }
                    return(stages);

                case "genres":
                    var genres = Festival.SingleFestival.Genres.Where(genre => genre.ID == id);
                    if (genres == null || genres.Count() < 1)
                    {
                        throw new HttpResponseException(Request.CreateResponse(System.Net.HttpStatusCode.NotFound));
                    }
                    return(genres);

                default: throw new HttpResponseException(Request.CreateResponse(System.Net.HttpStatusCode.NotFound));
                }
            }
            catch (Exception ex)
            {
                throw new HttpResponseException(Request.CreateResponse(System.Net.HttpStatusCode.NotFound));
            }
        }
Exemple #6
0
        private void EditFestival()
        {
            Festival editFestival = new Festival();

            editFestival.Name      = Festivals.Name;
            editFestival.StartDate = Festivals.StartDate;
            editFestival.EndDate   = Festivals.EndDate;

            Festival.SaveFestival(editFestival);

            MessageBox.Show("De wijzigingen aan het festival werden opgeslaan");
            _festival = Festival.GetFestival();
            OnPropertyChanged("Festivals");
        }
Exemple #7
0
        //
        // GET: /Stage/Details/5

        public ActionResult Details(string name)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                return(RedirectToAction("Index"));
            }
            Festival.SingleFestival = Festival.GetFestival();
            Festival.SingleFestival.ComputeLineUps();
            var stages = Festival.SingleFestival.Stages.Where(stager => stager.Name == name);

            if (stages == null || stages.Count() < 1)
            {
                return(RedirectToAction("Index"));
            }
            return(View(stages.First()));
        }
Exemple #8
0
 // GET api/<controller>
 public Festival Get()
 {
     //Festival.SingleFestival = Festival.GetFestival();
     //Festival.SingleFestival.ComputeLineUps();
     //return Festival.SingleFestival;
     try
     {
         //Festival.SingleFestival = Festival.GetFestival();
         //Festival.SingleFestival.ComputeLineUps();
         return(Festival.GetFestival());
     }
     catch (Exception)
     {
         throw new HttpResponseException(Request.CreateResponse(System.Net.HttpStatusCode.NotFound));
     }
     //if (Festival.SingleFestival == null) throw new HttpResponseException(Request.CreateResponse(System.Net.HttpStatusCode.NotFound));
 }
 protected override void OnStartup(StartupEventArgs e)
 {
     try
     {
         Database.ConnectionFailed += Database_ConnectionFailed;
         //Database.TestConnection();
         Festival.SingleFestival = Festival.GetFestival();
         if (Festival.SingleFestival == null)
         {
             Festival.SingleFestival = new Festival();
             this.StartupUri         = new Uri("View/OnFirstStartScreen.xaml", UriKind.Relative);
         }
         else
         {
             StartupUri = new Uri("View/MainWindow.xaml", UriKind.Relative);
         }
         base.OnStartup(e);
         Festival.SingleFestival.ComputeLineUps();
     }catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
        //
        // GET: /Genre/

        public ActionResult Index()
        {
            Festival.SingleFestival = Festival.GetFestival();
            return(View(Festival.SingleFestival.Genres.Where(genre => Festival.SingleFestival.Bands.Where(band1 => band1.GenreIDs.Contains(genre.ID)).Count() > 0)));
        }
        //
        // GET: /Bands/

        public ActionResult Index()
        {
            Festival.SingleFestival = Festival.GetFestival();
            return(View(Festival.SingleFestival.Bands));
        }
Exemple #12
0
        //
        // GET: /Stage/Create

        public PartialViewResult StageOptredensPerLineupPartial(Stage stage)
        {
            Festival.SingleFestival = Festival.GetFestival();
            Festival.SingleFestival.ComputeLineUps();
            return(PartialView("_StageOptredensPerLineupPartial", Festival.SingleFestival.Optredens.Where(optreden => optreden.Stage.ID == stage.ID)));
        }
Exemple #13
0
        //
        // GET: /Stage/

        public ActionResult Index()
        {
            Festival.SingleFestival = Festival.GetFestival();
            return(View(Festival.SingleFestival.Stages.OrderBy(stage => stage.StageNumber)));
        }