Esempio n. 1
0
        private void CreateButton_Click(object sender, EventArgs e)
        {
            PhantomForm PhantomForm = new PhantomForm();

            PhantomForm.Show();

            AddContractorForm AddContractorForm = new AddContractorForm(ref TopForm, ref Contractors);

            TopForm = AddContractorForm;

            AddContractorForm.ShowDialog();

            if (AddContractorForm.bNewCategory)
            {
                CategoriesMenu.InitializeItems();
                SubCategoriesMenu.InitializeItems();
            }

            if (AddContractorForm.bCanceled == false)
            {
                CoverUpdatePanel();

                Contractors.FillContractors(SubCategoriesMenu.SelectedContractorSubCategoryID);
                ContractorsList.ItemColor = SubCategoriesMenu.ItemsColor;
                ContractorsList.InitializeItems();

                Uncover();
            }

            PhantomForm.Close();
            PhantomForm.Dispose();

            TopForm = null;
        }
Esempio n. 2
0
        private void ContractorsList_EditClicked(object sender, int iContractorID)
        {
            PhantomForm PhantomForm = new PhantomForm();

            PhantomForm.Show();

            AddContractorForm AddContractorForm = new AddContractorForm(ref TopForm, ref Contractors, iContractorID);

            TopForm = AddContractorForm;

            AddContractorForm.ShowDialog();

            PhantomForm.Close();
            PhantomForm.Dispose();

            TopForm = null;

            if (AddContractorForm.bNewCategory)
            {
                // CoverForm();

                CategoriesMenu.InitializeItems();
                SubCategoriesMenu.InitializeItems();

                // Uncover();
            }

            if (AddContractorForm.bCanceled == false)
            {
                CoverUpdatePanel();

                Contractors.FillContractors(SubCategoriesMenu.SelectedContractorSubCategoryID);
                ContractorsList.ItemColor = SubCategoriesMenu.ItemsColor;
                ContractorsList.InitializeItems();

                Uncover();
            }
        }