Esempio n. 1
0
        private void bunifuCustomDataGridInstallationDataBase_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 3)
            {
                AddForms.FormAddNewInstallation installation = new AddForms.FormAddNewInstallation(
                    bunifuCustomDataGridInstallationDataBase.Rows[e.RowIndex].Cells["ColumnId"].Value.ToString(),
                    bunifuCustomDataGridInstallationDataBase.Rows[e.RowIndex].Cells["ColumnName"].Value.ToString(),
                    bunifuCustomDataGridInstallationDataBase.Rows[e.RowIndex].Cells["ColumnPrice"].Value.ToString()
                    );
                installation.DialogResult = DialogResult.None;
                installation.ShowDialog();
                if (installation.DialogResult == DialogResult.OK)
                {
                    load_installations();
                }
            }
            else if (e.ColumnIndex == 4)
            {
                DialogResult dialog = MessageBox.Show("Ви дійсно бажаєте видалити цей об'єкт?", "?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (dialog == DialogResult.No)
                {
                    return;
                }

                AddForms.FormAddNewInstallation removeInstallation = new AddForms.FormAddNewInstallation(
                    bunifuCustomDataGridInstallationDataBase.Rows[e.RowIndex].Cells["ColumnId"].Value.ToString(),
                    this
                    );
            }
        }
Esempio n. 2
0
 private void buttonAdd_Click(object sender, EventArgs e)
 {
     AddForms.FormAddNewInstallation newInstallation = new AddForms.FormAddNewInstallation();
     newInstallation.DialogResult = DialogResult.None;
     newInstallation.ShowDialog();
     if (newInstallation.DialogResult == DialogResult.OK)
     {
         load_installations();
     }
 }