private void ButtonCreateClose_Click(object sender, RoutedEventArgs e)
        {
            //Code that creates a new project
            Project project = new Project(Convert.ToInt32(TextBoxCaseId.Text), TextBoxCaseName.Text, new Builder((Builder)ComboBoxBuilder.SelectedItem), new ProjectStatus((ProjectStatus)Bizz.GetEntity("ProjectStatus", "1")), new TenderForm((TenderForm)ComboBoxTenderForm.SelectedItem), new EnterpriseForm((EnterpriseForm)ComboBoxEnterpriseForm.SelectedItem), new User((User)ComboBoxExecutive.SelectedItem));
            bool    result  = Bizz.CreateInDbReturnBool(project);

            if (result)
            {
                //Show Confirmation
                MessageBox.Show("Projektet blev oprettet", "Opret Projekt", MessageBoxButton.OK, MessageBoxImage.Information);

                //Update list of projects
                Bizz.RefreshList("Projects");
                Bizz.RefreshIndexedList("IndexedActiveProjects");
                Bizz.RefreshIndexedList("IndexedProjects");

                //Close right UserControl
                Bizz.UcRightActive = false;
                UcRight.Content    = new UserControl();
            }
            else
            {
                //Show error
                MessageBox.Show("Databasen returnerede en fejl. Projektet blev ikke oprettet. Prøv igen.", "Opret Projekt", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
示例#2
0
        private void ButtonCreateClose_Click(object sender, RoutedEventArgs e)
        {
            //Code that creates a new project
            if (Bizz.TempProject.EnterpriseList == false)
            {
                Bizz.TempProject.ToggleEnterpriseList();
                Bizz.UpdateInDb(Bizz.TempProject);
                Bizz.RefreshList("Projects");
                Bizz.RefreshIndexedList("IndexedActiveProjects");
                Bizz.RefreshIndexedList("IndexableProjects");
            }
            bool result = Bizz.CreateInDbReturnBool(Bizz.TempEnterprise);

            if (result)
            {
                //Show Confirmation
                MessageBox.Show("Entrepriselisten blev oprettet", "Opret Entrepriseliste", MessageBoxButton.OK, MessageBoxImage.Information);

                //Update EnterpriseList
                Bizz.RefreshList("EnterpriseList");
                Bizz.TempEnterprise = new Enterprise();

                //Close right UserControl
                Bizz.UcRightActive = false;
                UcRight.Content    = new UserControl();
            }
            else
            {
                //Show error
                MessageBox.Show("Databasen returnerede en fejl. Entrepriselisten blev ikke oprettet. Prøv igen.", "Opret Projekt", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
示例#3
0
        private void ButtonEdit_Click(object sender, RoutedEventArgs e)
        {
            //Code that edits a project
            bool result = Bizz.CreateInDbReturnBool(Bizz.TempEnterprise);

            if (result)
            {
                //Show Confirmation
                MessageBox.Show("Entrepriselisten blev redigeret", "Rediger Entrepriseliste", MessageBoxButton.OK, MessageBoxImage.Information);

                //Reset Boxes
                TextBoxName.Text                  = "";
                TextBoxElaboration.Text           = "";
                TextBoxOfferList.Text             = "";
                ComboBoxCraftGroup1.SelectedIndex = -1;
                ComboBoxCraftGroup2.SelectedIndex = -1;
                ComboBoxCraftGroup3.SelectedIndex = -1;
                ComboBoxCraftGroup4.SelectedIndex = -1;

                //Update Enterprise List
                Bizz.RefreshList("EnterpriseList");
                IndexableEnterpriseList.Clear();
                IndexableEnterpriseList           = GetIndexableEnterpriseList();
                ListBoxEnterpriseList.ItemsSource = IndexableEnterpriseList;
            }
            else
            {
                //Show error
                MessageBox.Show("Databasen returnerede en fejl. Entrepriselisten blev ikke redigeret. Prøv igen.", "Rediger Projekt", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
        private void ButtonCopy_Click(object sender, RoutedEventArgs e)
        {
            // Code that copies the current project into a new project
            Project project = new Project(Bizz.TempProject.CaseId, Bizz.TempProject.Name, Bizz.TempProject.Builder, new ProjectStatus((ProjectStatus)Bizz.GetEntity("ProjectStatus", "1")), Bizz.TempProject.TenderForm, Bizz.TempProject.EnterpriseForm, Bizz.TempProject.Executive);
            bool    result  = Bizz.CreateInDbReturnBool(Bizz.TempProject);

            if (result)
            {
                //Show Confirmation
                MessageBox.Show("Projektet blev kopieret", "Kopier projekt", MessageBoxButton.OK, MessageBoxImage.Information);

                //Update list of projects
                Bizz.RefreshList("Projects");
                Bizz.RefreshIndexedList("IndexedActiveProjects");
                Bizz.RefreshIndexedList("IndexableProjects");

                //Close right UserControl
                Bizz.UcRightActive = false;
                UcRight.Content    = new UserControl();
            }
            else
            {
                //Show error
                MessageBox.Show("Databasen returnerede en fejl. Projektet blev ikke kopieret. Prøv igen.", "Kopier Projekt", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
示例#5
0
        private void ButtonChoose_Click(object sender, RoutedEventArgs e)
        {
            bool result = false;

            if (ListBoxLegalEntities.SelectedItems.Count == 0)
            {
                //Show Confirmation
                MessageBox.Show("Du har ikke valgt nogen underentrepenører.", "Vælg Underentrepenør", MessageBoxButton.OK, MessageBoxImage.Information);
            }
            else if (ListBoxLegalEntities.SelectedItems.Count == 1)
            {
                //Code that adds IttLetter, Offer and Request to Bizz.TempSubEntrepeneur
                CreateIttLetter();
                CreateOffer();
                CreateRequest();
                Contact tempContact = GetContact();
                Bizz.TempSubEntrepeneur.Contact = tempContact;

                //Code that adds a SubEntrepeneur to Enterprise List
                result = Bizz.CreateInDbReturnBool(Bizz.TempSubEntrepeneur);
            }
            else
            {
                result = AddMultipleSubentrepeneurs();
            }
            if (result)
            {
                //Show Confirmation
                MessageBox.Show("Underentrepenøre(r)n(e) blev føjet til Entrepriselisten. Ved flere underentrepenører, er der ikke valgt kontaktperson. Ret dette under 'Rediger Underentrepenør'", "Vælg Underentrepenør", MessageBoxButton.OK, MessageBoxImage.Information);

                //Reset Boxes
                TextBoxName.Text = "";

                //Update Enterprise List
                Bizz.RefreshList("SubEntrepeneurs");
                IndexableLegalEntities.Clear();
                IndexableLegalEntities           = GetIndexableLegalEntities();
                ListBoxLegalEntities.ItemsSource = IndexableLegalEntities;
            }
            else
            {
                //Show error
                MessageBox.Show("Databasen returnerede en fejl. Underentrepenøren blev ikke føjet til Entrepriselisten. Prøv igen.", "Rediger Projekt", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
示例#6
0
        private void ButtonCreate_Click(object sender, RoutedEventArgs e)
        {
            //Code that creates a new project
            bool result = Bizz.CreateInDbReturnBool(Bizz.TempZipTown);

            if (result)
            {
                //Show Confirmation
                MessageBox.Show("Postnummeret blev oprettet", "Opret Postnummer", MessageBoxButton.OK, MessageBoxImage.Information);

                //Update lists and fields
                Bizz.TempZipTown = new ZipTown();
                Bizz.RefreshList("ZipTownList");

                //Close right UserControl
                Bizz.UcRightActive = false;
                UcRight.Content    = new UserControl();
            }
            else
            {
                //Show error
                MessageBox.Show("Databasen returnerede en fejl. Postnummeret blev ikke oprettet. Prøv igen.", "Opret Postnummer", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }