Пример #1
0
        private void bunifuCustomDataGridClientsDataBase_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 2)
            {
                AddForms.VCAddForm.FormAddNewSideControllVC editSideControl = new AddForms.VCAddForm.FormAddNewSideControllVC(
                    bunifuCustomDataGridSideDataBase.Rows[e.RowIndex].Cells["ColumnId"].Value.ToString(),
                    bunifuCustomDataGridSideDataBase.Rows[e.RowIndex].Cells["ColumnName"].Value.ToString()
                    );
                editSideControl.DialogResult = DialogResult.None;
                editSideControl.ShowDialog();
                if (editSideControl.DialogResult == DialogResult.OK)
                {
                    load_sides();
                }
            }
            else if (e.ColumnIndex == 3)
            {
                DialogResult dialog = MessageBox.Show("Ви дійсно бажаєте видалити цей об'єкт?", "?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (dialog == DialogResult.No)
                {
                    return;
                }

                AddForms.VCAddForm.FormAddNewSideControllVC removeSideControl = new AddForms.VCAddForm.FormAddNewSideControllVC(
                    bunifuCustomDataGridSideDataBase.Rows[e.RowIndex].Cells["ColumnId"].Value.ToString(),
                    this
                    );
            }
        }
Пример #2
0
 private void buttonAdd_Click(object sender, EventArgs e)
 {
     AddForms.VCAddForm.FormAddNewSideControllVC newSide = new AddForms.VCAddForm.FormAddNewSideControllVC();
     newSide.DialogResult = DialogResult.None;
     newSide.ShowDialog();
     if (newSide.DialogResult == DialogResult.OK)
     {
         load_sides();
     }
 }