Example #1
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.KovarikEventsWindow1 = ((EventDisplay.KovarikEventsWindow)(target));
                return;

            case 2:
                this.KEWTodaysEventsTB = ((System.Windows.Controls.TextBox)(target));
                return;

            case 3:
                this.KEWDateTB = ((System.Windows.Controls.TextBox)(target));
                return;

            case 4:
                this.KEWCloseWindow = ((System.Windows.Controls.Button)(target));

            #line 41 "..\..\KovarikEventsWindow.xaml"
                this.KEWCloseWindow.Click += new System.Windows.RoutedEventHandler(this.KEWCloseWindow_Click);

            #line default
            #line hidden
                return;

            case 5:
                this.KEWListView = ((System.Windows.Controls.ListView)(target));
                return;
            }
            this._contentLoaded = true;
        }
Example #2
0
        private void KovarikRoomEvents_Click(object sender, RoutedEventArgs e)
        {
            KovarikEventsWindow kew = new KovarikEventsWindow();

            List <EventDetails> AdultPrograms    = new List <EventDetails>();
            List <EventDetails> TeenPrograms     = new List <EventDetails>();
            List <EventDetails> ChildrenPrograms = new List <EventDetails>();

            string todaysDateString = DateTime.Today.ToString("MMMM d, yyyy");

            //string todaysDateString = DateTime.Today.ToString("April 12, 2019");
            kew.KEWDateTB.Text = todaysDateString;

            foreach (EventDetails ev in eventList)
            {
                if (ev.Name.Contains("&#039;"))
                {
                    ev.Name = ev.Name.Replace("&#039;", "'");
                }

                if (ev.Name.Contains("&amp;"))
                {
                    ev.Name = ev.Name.Replace("&amp;", "&");
                }

                if (ev.Name.Contains("&quot;"))
                {
                    ev.Name = ev.Name.Replace("&quot;", "\"");
                }

                if (ev.AgeRange == "Adult" && ev.Date == todaysDateString && ev.Room == "Kovarik Room")
                {
                    AdultPrograms.Add(ev);
                }

                if (ev.AgeRange == "Teen" && ev.Date == todaysDateString && ev.Room == "Kovarik Room")
                {
                    TeenPrograms.Add(ev);
                }

                if (ev.AgeRange == "School Age" || ev.AgeRange == "Infant/Toddler/Preschool" || ev.AgeRange == "Family" || ev.AgeRange == "Infant/Toddler/Preschool, School Age, Family")
                {
                    if (ev.Date == todaysDateString && ev.Room == "Kovarik Room")
                    {
                        ChildrenPrograms.Add(ev);
                    }
                }
            }

            ListViewHeaders childHeader = new ListViewHeaders
            {
                Time = "Time",
                Name = "Children's Programs",
                Room = "Location"
            };

            ListViewHeaders teenHeader = new ListViewHeaders
            {
                Time = "Time",
                Name = "Teen Programs",
                Room = "Location"
            };

            ListViewHeaders adultHeader = new ListViewHeaders
            {
                Time = "Time",
                Name = "Adult Programs",
                Room = "Location"
            };

            ListViewHeaders blankLine = new ListViewHeaders();



            if (ChildrenPrograms.Count != 0)
            {
                kew.KEWListView.Items.Add(childHeader);
                foreach (EventDetails ev in ChildrenPrograms)
                {
                    if (ev.Date == todaysDateString && ev.Room == "Kovarik Room")
                    {
                        kew.KEWListView.Items.Add(ev);
                    }
                }
                kew.KEWListView.Items.Add(blankLine);
            }

            if (TeenPrograms.Count != 0)
            {
                kew.KEWListView.Items.Add(teenHeader);
                foreach (EventDetails ev in TeenPrograms)
                {
                    if (ev.Date == todaysDateString && ev.Room == "Kovarik Room")
                    {
                        kew.KEWListView.Items.Add(ev);
                    }
                }
                kew.KEWListView.Items.Add(blankLine);
            }

            if (AdultPrograms.Count != 0)
            {
                kew.KEWListView.Items.Add(adultHeader);
                foreach (EventDetails ev in AdultPrograms)
                {
                    if (ev.Date == todaysDateString && ev.Room == "Kovarik Room")
                    {
                        kew.KEWListView.Items.Add(ev);
                    }
                }
                kew.KEWListView.Items.Add(blankLine);
            }

            kew.Show();
        }