Exemplo n.º 1
0
        private void endDateDatePicker_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
        {
            int      item      = wasteTrackerStationsComboBox.SelectedIndex;
            DateTime?StartDate = startDateDatePicker.SelectedDate;
            DateTime?EndDate   = endDateDatePicker.SelectedDate;

            if (EndDate < StartDate)
            {
                BIMessageBox.Show("Please Select an End Date That is After the Start Date.");
            }
            else
            {
                FillData(StartDate, EndDate, item);
            }
        }
Exemplo n.º 2
0
        public void FillData(DateTime?start, DateTime?end, int item)
        {
            SandboxDataSet ds = ((SandboxDataSet)(FindResource("sandboxDataSet")));

            SandboxDataSetTableAdapters.WasteTrackerDBTableAdapter da = new SandboxDataSetTableAdapters.WasteTrackerDBTableAdapter();
            string startdate = start.ToString();
            string enddate   = end.ToString();

            if (startdate == null)
            {
                BIMessageBox.Show("Please Select a Date");
                return;
            }
            else
            {
                da.FillByDateRange(ds.WasteTrackerDB, item, startdate, enddate);
            }
        }
Exemplo n.º 3
0
        public PageViewReports()
        {
            InitializeComponent();
            try
            {
                //Load database
                SandboxDataSet ds = ((SandboxDataSet)(FindResource("sandboxDataSet")));

                //Load combobox of stations
                CollectionViewSource stViewSource = ((CollectionViewSource)(FindResource("wasteTrackerStationsViewSource")));
                SandboxDataSetTableAdapters.WasteTrackerStationsTableAdapter sbda = new SandboxDataSetTableAdapters.WasteTrackerStationsTableAdapter();
                sbda.Fill(ds.WasteTrackerStations);
            }
            catch (Exception ex)
            {
                BIMessageBox.Show("Oops there was a problem, please contact Business Intelligence \n" + ex);
            }
        }
Exemplo n.º 4
0
        private void startDateDatePicker_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
        {
            int      item      = wasteTrackerStationsComboBox.SelectedIndex;
            DateTime?StartDate = startDateDatePicker.SelectedDate;
            DateTime?EndDate   = endDateDatePicker.SelectedDate;

            if (StartDate > EndDate)
            {
                BIMessageBox.Show("Please Select a Start Date That is Before the End Date.");
            }
            else
            {
                if (EndDate == null)
                {
                    return;
                }
                else
                {
                    FillData(StartDate, EndDate, item);
                }
            }
        }