Exemplo n.º 1
0
        /// <summary>
        /// Handles the Loaded event of the Window control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            // populate email types combobox
            ExportEmailTypes = AcsApi.GetEmailTypes();
            if (ExportEmailTypes.Any())
            {
                foreach (var emailType in ExportEmailTypes)
                {
                    EmailTypesComboBoxItems.Add(new ComboBoxItem {
                        Text = emailType
                    });
                }

                cblEmailTypes.ItemsSource   = EmailTypesComboBoxItems;
                cblEmailTypes.SelectedIndex = 0;
            }
            else
            {
                btnDownloadPackage.IsEnabled = false;
                txtMessages.Text             = "ERROR:  Cannot Export Data without Email Addresses." + Environment.NewLine;
            }

            // populate campus fields combobox
            ExportCampus = AcsApi.LoadPersonFields();

            ExportCampusComboBoxItems.Add(new ComboBoxItem {
                Text = "------"
            });

            if (ExportCampus.Any())
            {
                foreach (var field in ExportCampus)
                {
                    ExportCampusComboBoxItems.Add(new ComboBoxItem {
                        Text = field
                    });
                }

                cblCampus.ItemsSource   = ExportCampusComboBoxItems;
                cblCampus.SelectedIndex = 0;
            }
            else
            {
                btnDownloadPackage.IsEnabled = false;
                txtMessages.Text            += "ERROR:  Cannot Export Data without Campus data." + Environment.NewLine;
            }

            txtImportCutOff.Text = DateTime.Now.ToShortDateString();
        }
        /// <summary>
        /// Handles the Loaded event of the Window control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            // populate email types combobox
            ExportEmailTypes = AcsApi.GetEmailTypes();
            if (ExportEmailTypes.Any())
            {
                foreach (var emailType in ExportEmailTypes)
                {
                    EmailTypesComboBoxItems.Add(new ComboBoxItem {
                        Text = emailType
                    });
                }

                cblEmailTypes.ItemsSource   = EmailTypesComboBoxItems;
                cblEmailTypes.SelectedIndex = 0;
            }

            // populate campus fields combobox
            ExportCampus = AcsApi.LoadPersonFields();

            ExportCampusComboBoxItems.Add(new ComboBoxItem {
                Text = "------"
            });

            if (ExportCampus.Any())
            {
                foreach (var field in ExportCampus)
                {
                    ExportCampusComboBoxItems.Add(new ComboBoxItem {
                        Text = field
                    });
                }

                cblCampus.ItemsSource   = ExportCampusComboBoxItems;
                cblCampus.SelectedIndex = 0;
            }

            txtImportCutOff.Text = DateTime.Now.ToShortDateString();
        }