Ejemplo 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;
        }
Ejemplo n.º 2
0
        private void Initialize()
        {
            Contractors = new Contractors();

            CategoriesMenu.ItemsDataTable = Contractors.CategoriesDataTable;
            CategoriesMenu.InitializeItems();

            if (Contractors.CategoriesDataTable.Rows.Count > 0)
            {
                CategoriesMenu.Selected = 0;
            }

            SubCategoriesMenu.ItemsDataTable = Contractors.SubCategoriesDataTable;
            SubCategoriesMenu.InitializeItems();

            ContractorsList.ItemsDataTable     = Contractors.ContractorsDataTable;
            ContractorsList.CitiesDataTable    = Contractors.CitiesDataTable;
            ContractorsList.CountriesDataTable = Contractors.CountriesDataTable;
            ContractorsList.ContactsDataTable  = Contractors.ContactsDataTable;

            DataTable PermissionsDataTable = RolesAndPermissionsManager.GetPermissions(Security.CurrentUserID, "ContractorsForm");

            if (PermissionsDataTable.Rows.Count > 0)
            {
                ContractorsList.bCanEdit = true;
                EditButtonsPanel.Visible = true;
            }

            if (Contractors.SubCategoriesDataTable.Rows.Count > 0)
            {
                Contractors.FillContractors(SubCategoriesMenu.SelectedContractorSubCategoryID);
                ContractorsList.InitializeItems();
            }
        }
Ejemplo n.º 3
0
        private void SubCategoriesMenu_SelectedChanged(object sender, string Name, int index)
        {
            CoverUpdatePanel();

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

            Uncover();
        }
Ejemplo n.º 4
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();
            }
        }