Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            LogViewModel.FindShift();
            loaded      = true;
            currentDate = DateTime.Today;

            var datepicker = FindVisualChildren <DatePicker>(this);

            foreach (DatePicker control in datepicker)
            {
                if (control.Name.Equals("navDate"))
                {
                    mainDate = control;
                }
            }
            mainDate.SelectedDate = currentDate;

            EnabledNavButtons();
            LogViewModel.InitalLoad(currentDate, LogViewModel.FindShift());
            EnabledTextBoxes(!LogViewModel.CurrentLog.Submitted);
        }
Beispiel #2
0
        private void NavDate_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
        {
            var comboboxes = FindVisualChildren <ComboBox>(this);

            foreach (ComboBox box in comboboxes)
            {
                if (box.Name.Equals("shiftBox"))
                {
                    ComboBox shiftBox = box;
                }
            }
            if (loaded)
            {
                string   shift = shiftBox.Text;
                DateTime date  = (DateTime)((DatePicker)sender).SelectedDate;
                LogViewModel.Load(date, shift);
                currentDate = date;
            }
            EnabledNavButtons();
            EnabledTextBoxes(!LogViewModel.CurrentLog.Submitted);
        }