Example #1
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);
            }
        }
Example #2
0
        /// <summary>
        /// Method, that updates a Contact in Db
        /// </summary>
        /// <returns>bool</returns>
        private bool UpdateContactInDb()
        {
            //Code that creates a new Builder
            bool result = false;

            //Create ContactInfo in Db
            bool contactInfoUpdated = UpdateContactInfo();

            //Create Address in Db
            bool personUpdated = false;

            if (contactInfoUpdated)
            {
                personUpdated = UpdatePersonInDb();
            }


            //Create Builder in Db
            if (personUpdated)
            {
                result = CBZ.UpdateInDb(CBZ.TempContact);
            }

            return(result);
        }
Example #3
0
        private void ButtonExecute_Click(object sender, RoutedEventArgs e)
        {
            // Code that changes project status
            bool result = Bizz.UpdateInDb(Bizz.TempProject);

            if (result)
            {
                //Show Confirmation
                MessageBox.Show("Projekstatus blev ændret", "Ændr Projektstatus", 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. Projektstatus blev ikke ændret. Prøv igen.", "Ændr Projektstatus", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
Example #4
0
        private void ButtonSave_Click(object sender, RoutedEventArgs e)
        {
            //Code that edits a project
            bool result = CBZ.UpdateInDb(CBZ.TempEnterprise);

            if (result)
            {
                //Show Confirmation
                MessageBox.Show("Entrepriselisten blev redigeret", "Entrepriser", 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
                RefreshIndexedEnterprises();
                ListBoxEnterprises.ItemsSource = "";
                ListBoxEnterprises.ItemsSource = IndexedEnterprises;
            }
            else
            {
                //Show error
                MessageBox.Show("Databasen returnerede en fejl. Entrepriselisten blev ikke redigeret. Prøv igen.", "Entrepriser", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
        private void ButtonEdit_Click(object sender, RoutedEventArgs e)
        {
            // Code that save changed CaseId to the project
            bool result = Bizz.UpdateInDb(Bizz.TempProject);

            if (result)
            {
                //Show Confirmation
                MessageBox.Show("Sagsnummer blev ændret", "Skift Sagsnummer", 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. Sagsnummer blev ikke ændret. Prøv igen.", "Skift Sagsnummer", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
        /// <summary>
        /// Method, that creates a Shipping
        /// </summary>
        /// <param name="project">Project</param>
        /// <param name="receiver">Receiver</param>
        /// <param name="subEntrepeneur">SubEntrepeneur</param>
        /// <param name="letterData">PdfData</param>
        private void CreateShipping(Project project, Receiver receiver, IndexedSubEntrepeneur subEntrepeneur)
        {
            // CBZ.TempShipping = new Shipping(subEntrepeneur, receiver, new LetterData(), @"PDF_Documents\", macAddress);

            try
            {
                int id = CBZ.CreateInDb(CBZ.TempShipping);
                CBZ.TempShipping.SetId(id);
                CBZ.TempShipping.PersonalIttLetterPdfPath = @"PDF_Documents\";
                CBZ.UpdateInDb(CBZ.TempShipping);
                CBZ.ProjectLists.Shippings.Add(CBZ.TempShipping);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Databasen returnerede en fejl. Forsendelsen blev ikke opdateret.\n" + ex, "Udbudsbreve", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
        private void ButtonUpdateCvr_Click(object sender, RoutedEventArgs e)
        {
            UpdateData updatedData = new UpdateData();

            if (CBZ.TempBuilder != new Builder())
            {
                updatedData            = CBZ.CvrApi.UpdateCvrData(CBZ.TempBuilder.Entity);
                CBZ.TempBuilder.Entity = updatedData.Entity;
                bool updated = CBZ.UpdateInDb(updatedData.Entity);

                if (updated)
                {
                    int index = ListBoxBuilders.SelectedIndex;
                    ListBoxBuilders.SelectedIndex = -1;
                    GetFilteredBuilders();
                    ListBoxBuilders.SelectedIndex = index;
                }
            }
        }
Example #8
0
        private void ButtonCreate_Click(object sender, RoutedEventArgs e)
        {
            //Code that creates a new project
            if (CBZ.TempProject.EnterpriseList == false)
            {
                CBZ.TempProject.ToggleEnterpriseList();
                CBZ.UpdateInDb(CBZ.TempProject);
                CBZ.RefreshIndexedList("Projects");
            }

            bool result = false;
            int  id     = CBZ.CreateInDb(CBZ.TempEnterprise);

            if (id >= 1)
            {
                result = true;
            }

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

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

                //Update Enterprise list
                CBZ.RefreshList("Enterprises");
                CBZ.TempEnterprise.Name        = "";
                CBZ.TempEnterprise.Elaboration = "";
                CBZ.TempEnterprise.OfferList   = "";
                CBZ.TempEnterprise.CraftGroup1 = new CraftGroup((CraftGroup)CBZ.GetCraftGroup(0));
                CBZ.TempEnterprise.CraftGroup2 = new CraftGroup((CraftGroup)CBZ.GetCraftGroup(0));
                CBZ.TempEnterprise.CraftGroup3 = new CraftGroup((CraftGroup)CBZ.GetCraftGroup(0));
                CBZ.TempEnterprise.CraftGroup4 = new CraftGroup((CraftGroup)CBZ.GetCraftGroup(0));
            }
            else
            {
                //Show error
                MessageBox.Show("Databasen returnerede en fejl. Entrepriselisten blev ikke oprettet. Prøv igen.", "Entrepriser", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
 /// <summary>
 /// Method, that creates a IttLetterShipping
 /// </summary>
 /// <returns></returns>
 private void GetIttLetterShipping()
 {
     Shipping = new IttLetterShipping(Bizz.TempProject, @"PDF_Documents\", Bizz.MacAdresss);
     try
     {
         int id = Bizz.CreateInDbReturnInt(Shipping);
         Shipping.SetId(id);
         Shipping.PdfPath = "";
         Bizz.UpdateInDb(Shipping);
     }
     catch (Exception ex)
     {
         MessageBox.Show("Databasen returnerede en fejl. Forsendelsen blev ikke opdateret.\n" + ex, "Opdater forsendelse", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
        private void ButtonUpdateCvr_Click(object sender, RoutedEventArgs e)
        {
            UpdateData updatedData = new UpdateData();

            CBZ.TempEntrepeneur.Entity = updatedData.Entity;
            bool updated = CBZ.UpdateInDb(updatedData.Entity);

            if (updated)
            {
                int index = ListBoxEntrepeneurs.SelectedIndex;
                ListBoxEntrepeneurs.SelectedIndex = -1;
                GetFilteredEntrepeneurs();
                ListBoxEntrepeneurs.SelectedIndex = index;
            }
        }
Example #11
0
        /// <summary>
        /// Method, that creates an Builder in Db
        /// </summary>
        /// <returns>bool</returns>
        private bool UpdateUserInDb()
        {
            bool result = false;

            //Update ContactInfo in Db
            bool contactInfoUpdated = UpdateContactInfo;

            //Update LegalEntity in Db
            bool personUpdated = UpdatePerson;

            //Create Entrepeneur in Db
            if (contactInfoUpdated && personUpdated)
            {
                result = CBZ.UpdateInDb(CBZ.TempUser);
            }

            return(result);
        }
Example #12
0
        private void ButtonSave_Click(object sender, RoutedEventArgs e)
        {
            // Code that changes project status
            bool result = CBZ.UpdateInDb(CBZ.TempProject);

            if (result)
            {
                //Show Confirmation
                MessageBox.Show("Projekstatus blev ændret", "Ændr Projektstatus", MessageBoxButton.OK, MessageBoxImage.Information);

                //Update list of projects
                CBZ.RefreshIndexedList("Projects");

                CBZ.CloseUcMain(UcMain);
            }
            else
            {
                //Show error
                MessageBox.Show("Databasen returnerede en fejl. Projektstatus blev ikke ændret. Prøv igen.", "Ændr Projektstatus", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
Example #13
0
        private void ButtonSave_Click(object sender, RoutedEventArgs e)
        {
            // Code that save changes to the project
            bool result = CBZ.UpdateInDb(CBZ.TempProject);

            if (result)
            {
                //Show Confirmation
                MessageBox.Show("Projektet blev rettet", "Projekter", MessageBoxButton.OK, MessageBoxImage.Information);

                //Update Projects lists
                CBZ.RefreshIndexedList("Projects"); //Refreshes Indexed Projects list and all dependent lists

                //Reset form
                ComboBoxCaseId.SelectedIndex = -1;
            }
            else
            {
                //Show error
                MessageBox.Show("Databasen returnerede en fejl. Projektet blev ikke rettet. Prøv igen.", "Projekter", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
        private void ButtonSave_Click(object sender, RoutedEventArgs e)
        {
            // Code that save changed CaseId to the project
            bool result = CBZ.UpdateInDb(CBZ.TempProject);

            if (result)
            {
                //Show Confirmation
                MessageBox.Show("Sagsnummer blev ændret", "Projekter", MessageBoxButton.OK, MessageBoxImage.Information);

                //Update list of projects
                CBZ.RefreshIndexedList("Projects");

                //ResetForm
                ComboBoxCaseId.SelectedItem = -1;
                CBZ.UcMainEdited            = false;
            }
            else
            {
                //Show error
                MessageBox.Show("Databasen returnerede en fejl. Sagsnummer blev ikke ændret. Prøv igen.", "Projekter", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
Example #15
0
 private bool UpdateJobDescriptioninDb() => CBZ.UpdateInDb(CBZ.TempJobDescription);
 /// <summary>
 /// Method, that creates an Builder in Db
 /// </summary>
 /// <returns>bool</returns>
 private bool UpdateBuilderInDb()
 {
     return(CBZ.UpdateInDb(CBZ.TempBuilder));
 }