예제 #1
0
        public Page_Home()
        {
            InitializeComponent();

            TasksTableAdapter tasksTableAdapter = new TasksTableAdapter();

            // OLEDB-Driver 12.0 (Achtung: nur 32 Bit!) https://www.microsoft.com/en-us/download/details.aspx?id=54920
            tasks = tasksTableAdapter.GetData();

            this.DataContext = tasks;

            // Listbox:
            Lst.ItemsSource = tasksTableAdapter.GetData();

            //---------------

            Groups = new ObservableCollection <string>();


            foreach (var item in tasksTableAdapter.GetData())
            {
                Groups.Add(item.Category);
            }

            cboCategoryTypes.ItemsSource   = Groups.Distinct();
            cboCategoryTypes.SelectedValue = 1;
        }
        public HomePage()
        {
            InitializeComponent();

            TasksTableAdapter tasksTableAdapter = new TasksTableAdapter();

            // OLEDB-Driver 12.0 (Achtung: nur 32 Bit!) https://www.microsoft.com/en-us/download/details.aspx?id=54920
            tasks = tasksTableAdapter.GetData();

            this.DataContext = tasks;

            // Listbox:
            Lst.ItemsSource = tasksTableAdapter.GetData();
        }
        private void Button_Click_Reset(object sender, RoutedEventArgs e)
        {
            TasksTableAdapter tasksTableAdapter = new TasksTableAdapter();

            tasks = tasksTableAdapter.GetData();

            // Listbox:
            Lst.ItemsSource = tasks;
        }
        private void FiltToday(object sender, RoutedEventArgs e)
        {
            TasksTableAdapter tasksTableAdapter = new TasksTableAdapter();

            tasks = tasksTableAdapter.GetData();

            // Listbox:
            Lst.ItemsSource = tasks.Where(x => x.StartDate.Date == DateTime.Now.Date);
        }
        private void FiltByName(object sender, RoutedEventArgs e)
        {
            TasksTableAdapter tasksTableAdapter = new TasksTableAdapter();

            tasks = tasksTableAdapter.GetData();

            // Listbox:
            Lst.ItemsSource = tasks.Where(x => x.Eventname.Contains("Inc"));
        }
예제 #6
0
        private void Filter_Week(object sender, RoutedEventArgs e)
        {
            TasksTableAdapter tasksTableAdapter = new TasksTableAdapter();

            tasks = tasksTableAdapter.GetData();

            //-------------------------------------------

            DateTime Firstday = DateTime.Now.AddDays(-(int)DateTime.Now.DayOfWeek + 1);
            DateTime Endaday  = Firstday.AddDays(6);

            // Listbox:
            Lst.ItemsSource = tasks.Where(x => x.StartDate.Date >= Firstday && x.EndDate.Date <= Endaday);

            Title.Content = "week";
        }
예제 #7
0
        private void Filter_Year(object sender, RoutedEventArgs e)
        {
            TasksTableAdapter tasksTableAdapter = new TasksTableAdapter();

            tasks = tasksTableAdapter.GetData();

            //-------------------------------------------

            int      year         = DateTime.Now.Year;
            DateTime firstDayYear = new DateTime(year, 1, 1);
            DateTime lastDayYear  = new DateTime(year, 12, 31);

            // Listbox:
            Lst.ItemsSource = tasks.Where(x => x.StartDate.Date >= firstDayYear && x.EndDate.Date <= lastDayYear);

            Title.Content = "year";
        }
예제 #8
0
        private void Filter_Month(object sender, RoutedEventArgs e)
        {
            TasksTableAdapter tasksTableAdapter = new TasksTableAdapter();

            tasks = tasksTableAdapter.GetData();

            //-------------------------------------------

            int      month         = DateTime.Now.Month;
            int      year          = DateTime.Now.Year;
            DateTime firstDayMonth = new DateTime(year, month, 1);
            DateTime lastDayMonth  = new DateTime(year, month, DateTime.DaysInMonth(year, month));

            // Listbox:
            Lst.ItemsSource = tasks.Where(x => x.StartDate.Date >= firstDayMonth && x.EndDate.Date <= lastDayMonth);

            Title.Content = "month";
        }