Example #1
0
        private void NoCityLabel_Click(object sender, EventArgs e)
        {
            AddItemForm AddItemForm = new AddItemForm(ref TopForm, "Введите название нового города")
            {
                StartPosition = FormStartPosition.CenterParent
            };

            AddItemForm.ShowDialog();

            if (AddItemForm.bCanceled)
            {
                return;
            }

            Cover();

            Contractors.AddCity(AddItemForm.sText, Convert.ToInt32(CountryComboBox.SelectedValue));
            Contractors.RefillCities();

            CityDT.Clear();
            CityDT = Contractors.CitiesDataTable.Copy();
            CityComboBox.DataSource      = CityDT.DefaultView;
            CityDT.DefaultView.RowFilter = "CountryID = " + Convert.ToInt32(CountryComboBox.SelectedValue);

            Uncover();
        }
Example #2
0
        private void SubCategoryNoListLabel_Click(object sender, EventArgs e)
        {
            AddItemForm AddItemForm = new AddItemForm(ref TopForm, "Введите название новой подкатегории")
            {
                StartPosition = FormStartPosition.CenterParent
            };

            AddItemForm.ShowDialog();

            if (AddItemForm.bCanceled)
            {
                return;
            }

            Cover();

            Contractors.AddSubCategory(AddItemForm.sText, Convert.ToInt32(CategoriesComboBox.SelectedValue));
            Contractors.RefillSubCategories();
            bNewCategory = true;

            SubCategoriesDT.Clear();
            SubCategoriesDT = Contractors.SubCategoriesDataTable.Copy();
            SubCategoriesComboBox.DataSource      = SubCategoriesDT.DefaultView;
            SubCategoriesDT.DefaultView.RowFilter = "ContractorCategoryID = " + Convert.ToInt32(CategoriesComboBox.SelectedValue);

            Uncover();
        }
Example #3
0
        private void NoCountryLabel_Click(object sender, EventArgs e)
        {
            AddItemForm AddItemForm = new AddItemForm(ref TopForm, "Введите название новой страны")
            {
                StartPosition = FormStartPosition.CenterParent
            };

            AddItemForm.ShowDialog();

            if (AddItemForm.bCanceled)
            {
                return;
            }

            Cover();

            Contractors.AddCountry(AddItemForm.sText);
            Contractors.RefillCountries();

            Uncover();
        }
Example #4
0
        private void CategoryNoListLabel_Click(object sender, EventArgs e)
        {
            AddItemForm AddItemForm = new AddItemForm(ref TopForm, "Введите название новой категории")
            {
                StartPosition = FormStartPosition.CenterParent
            };

            AddItemForm.ShowDialog();

            if (AddItemForm.bCanceled)
            {
                return;
            }

            Cover();

            Contractors.AddCategory(AddItemForm.sText);
            Contractors.RefillCategories();
            bNewCategory = true;

            Uncover();
        }