Exemple #1
0
        private void bunifuCustomDataGridColorDataBase_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 4)
            {
                AddForms.FormAddNewSystemColor editColor = new AddForms.FormAddNewSystemColor(
                    bunifuCustomDataGridColorDataBase.Rows[e.RowIndex].Cells["ColumnColor_id"].Value.ToString(),
                    bunifuCustomDataGridColorDataBase.Rows[e.RowIndex].Cells["ColumnColor_name"].Value.ToString(),
                    bunifuCustomDataGridColorDataBase.Rows[e.RowIndex].Cells["ColumnImg_path"].Value.ToString()
                    );
                editColor.DialogResult = DialogResult.None;
                editColor.ShowDialog();
                if (editColor.DialogResult == DialogResult.OK)
                {
                    load_colors();
                }
            }
            else if (e.ColumnIndex == 5)
            {
                DialogResult dialog = MessageBox.Show("Ви дійсно бажаєте видалити цей об'єкт?", "?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (dialog == DialogResult.No)
                {
                    return;
                }

                AddForms.FormAddNewSystemColor removeColor = new AddForms.FormAddNewSystemColor(
                    bunifuCustomDataGridColorDataBase.Rows[e.RowIndex].Cells["Columncolor_id"].Value.ToString(),
                    this
                    );
            }
        }
Exemple #2
0
 private void buttonAdd_Click(object sender, EventArgs e)
 {
     AddForms.FormAddNewSystemColor newSystemColor = new AddForms.FormAddNewSystemColor();
     newSystemColor.DialogResult = DialogResult.None;
     newSystemColor.ShowDialog();
     if (newSystemColor.DialogResult == DialogResult.OK)
     {
         load_colors();
     }
 }