Beispiel #1
0
        private void ComboBoxCaseId_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (ComboBoxCaseId.SelectedIndex >= 0)
            {
                CBZ.TempProject  = new Project((Project)ComboBoxCaseId.SelectedItem);
                TextBoxName.Text = CBZ.TempProject.Details.Name;
                CBZ.TempShipping = new Shipping();
                CBZ.RefreshProjectList("All", CBZ.TempProject.Id);
                ListBoxEntrepeneurs.ItemsSource   = "";
                ListBoxEntrepeneurs.ItemsSource   = CBZ.ProjectLists.Shippings;
                ListBoxEntrepeneurs.SelectedIndex = -1;
            }
            else
            {
                TextBoxName.Text = "";
                CBZ.TempProject  = new Project();
                CBZ.TempShipping = new Shipping();
                ProjectRequestData.Clear();
                ListBoxEntrepeneurs.ItemsSource   = "";
                ListBoxEntrepeneurs.SelectedIndex = -1;

                //Set CBZ.UcMainEdited
                if (CBZ.UcMainEdited)
                {
                    CBZ.UcMainEdited = false;
                }
            }
        }
        /// <summary>
        /// Method that creates a list of Indexed SubEntrepeneurs
        /// </summary>
        private void RefreshIndexedSubEntrepeneurs()
        {
            CBZ.RefreshProjectList("SubEntrepeneurs", CBZ.TempProject.Id);
            CBZ.IndexedSubEntrepeneurs.Clear();

            int i = 0;

            foreach (SubEntrepeneur subEntrepeneur in ProjectSubEntrepeneurs)
            {
                bool requestSent = false;

                if (CheckBoxShowSent.IsChecked == false)
                {
                    requestSent = CheckRequestSent(subEntrepeneur);
                }

                if (!requestSent)
                {
                    CBZ.IndexedSubEntrepeneurs.Add(new IndexedSubEntrepeneur(i, subEntrepeneur));
                    i++;
                }
            }

            ListBoxSubEntrepeneurs.ItemsSource = "";
            ListBoxSubEntrepeneurs.ItemsSource = CBZ.IndexedSubEntrepeneurs;
        }
Beispiel #3
0
        /// <summary>
        /// Method, that creates an indexable Enterprises
        /// </summary>
        private void RefreshIndexedEnterprises()
        {
            CBZ.RefreshProjectList("All", CBZ.TempProject.Id);
            CBZ.IndexedEnterprises.Clear();

            int i = 0;

            foreach (Enterprise enterprise in CBZ.ProjectLists.Enterprises)
            {
                CBZ.IndexedEnterprises.Add(new IndexedEnterprise(i, enterprise));
                i++;
            }
        }
        private void ButtonSend_Click(object sender, RoutedEventArgs e)
        {
            if (CheckBoxDetails.IsChecked == true)
            {
                result = false;

                CreateReceiverList();

                if (result)
                {
                    //Show Confirmation
                    MessageBox.Show("Modtager(e)n(ne) blev føjet til modtagerlisten.", "Udbudsbreve", MessageBoxButton.OK, MessageBoxImage.Information);

                    PrepareCommonIttLetter();
                    PreparePersonalIttLetters();
                    SendIttLetters();

                    //Reset Boxes
                    ComboBoxCaseId.SelectedIndex = -1;
                    CheckBoxDetails.IsChecked    = false;
                    CheckBoxShowSent.IsChecked   = false;

                    //Update lists and fields
                    CBZ.RefreshProjectList("All", CBZ.TempProject.Id);
                }
                else
                {
                    //Show error
                    MessageBox.Show("Databasen returnerede en fejl. Modtager(e)n(ne) blev ikke føjet til modtagerlisten. Prøv igen.", "Udbudsbreve", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
            else
            {
                //Show error
                MessageBox.Show("Projektet mangler uddybende oplysninger. Ret dette under 'Projekter' => 'Uddybning' og prøv igen.", "Udbudsbreve", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Beispiel #5
0
        /// <summary>
        /// Method, that refreshes Indexed Enterprises with content from Project Enterprises list
        /// </summary>
        private void RefreshIndexedEnterprises()
        {
            CBZ.RefreshProjectList("All", CBZ.TempProject.Id);

            if (CBZ.IndexedEnterprises != null)
            {
                CBZ.IndexedEnterprises.Clear();
            }

            int i = 0;

            foreach (Enterprise enterprise in CBZ.Enterprises)
            {
                if (enterprise.Project.Id == CBZ.TempProject.Id)
                {
                    CBZ.IndexedEnterprises.Add(new IndexedEnterprise(i, enterprise));
                }
                i++;
            }
        }
 /// <summary>
 /// Method, that refreshes content of a list in CBZ
 /// </summary>
 /// <param name="list">string</param>
 private void RefreshProjectList(string list, int projectId) => CBZ.RefreshProjectList(list, projectId);