Esempio n. 1
0
        private void bunifuCustomDataGridCategoriesDataBase_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 5)
            {
                AddForms.FabricCurtainAddForm.FCFabricCategoryAddForm editCategory = new AddForms.FabricCurtainAddForm.FCFabricCategoryAddForm(
                    bunifuCustomDataGridCategoriesDataBase.Rows[e.RowIndex].Cells["ColumnCategory_id"].Value.ToString(),
                    bunifuCustomDataGridCategoriesDataBase.Rows[e.RowIndex].Cells["ColumnType_id"].Value.ToString(),
                    bunifuCustomDataGridCategoriesDataBase.Rows[e.RowIndex].Cells["ColumnSubtype_id"].Value.ToString(),
                    bunifuCustomDataGridCategoriesDataBase.Rows[e.RowIndex].Cells["ColumnCategory"].Value.ToString(),
                    Convert.ToDecimal(bunifuCustomDataGridCategoriesDataBase.Rows[e.RowIndex].Cells["ColumnPrice"].Value)
                    );
                editCategory.DialogResult = DialogResult.None;
                editCategory.ShowDialog();
                if (editCategory.DialogResult == DialogResult.OK)
                {
                    load_categories();
                }
            }
            else if (e.ColumnIndex == 6)
            {
                DialogResult dialog = MessageBox.Show("Ви дійсно бажаєте видалити цей об'єкт?", "?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (dialog == DialogResult.No)
                {
                    return;
                }

                AddForms.FabricCurtainAddForm.FCFabricCategoryAddForm editCategory = new AddForms.FabricCurtainAddForm.FCFabricCategoryAddForm(
                    bunifuCustomDataGridCategoriesDataBase.Rows[e.RowIndex].Cells["ColumnCategory_id"].Value.ToString(),
                    this
                    );
            }
        }
Esempio n. 2
0
 private void buttonAdd_Click(object sender, EventArgs e)
 {
     AddForms.FabricCurtainAddForm.FCFabricCategoryAddForm categoryAddForm = new AddForms.FabricCurtainAddForm.FCFabricCategoryAddForm();
     categoryAddForm.DialogResult = DialogResult.None;
     categoryAddForm.ShowDialog();
     if (categoryAddForm.DialogResult == DialogResult.OK)
     {
         load_categories();
     }
 }