public WindowDoctorNewCalendar()
        {
            InitializeComponent();

            #region Load calendars to ComboBox
            try
            {
                ComboBoxPickCalendar.ItemsSource = ClassSqlCalendar.AlreadyCreatedCalendarsForDoctor();
                if (ComboBoxPickCalendar.Items.Count == 0)
                {
                    this.Loaded += (a, b) => NavigationService.Navigate(new WindowDoctorNewCalendarEmpty());
                }
                ComboBoxPickCalendar.SelectedIndex = ComboBoxPickCalendar.Items.Count - 1;
                LoadDateToGrid();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            #endregion

            if (CurrentMonthDataGrid.SelectedIndex == -1)
            {
                workingDay.IsEnabled = false;
            }

            PreviousMonthDataGrid.ItemsSource = ClassSqlCalendar.GetListOfWorkingDayInCurrentMonth(ClassLoggedDoctor.Doctor_Id);
        }
Esempio n. 2
0
        public WindowDoctorNewCalendar()
        {
            InitializeComponent();

            #region Load calendars to ComboBox
            try
            {
                ComboBoxPickCalendar.ItemsSource = ClassSqlCalendar.AlreadyCreatedCalendarsForDoctor();
                if (ComboBoxPickCalendar.Items.Count == 0)
                {
                    return;
                }
                ComboBoxPickCalendar.SelectedIndex = ComboBoxPickCalendar.Items.Count - 1;
                LoadDateToGrid();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            #endregion

            if (CurrentMonthDataGrid.SelectedIndex == -1)
            {
                workingDay.IsEnabled = false;
            }
        }