コード例 #1
0
        private void bunifuCustomDataGridEquipmentsDataBase_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 3)
            {
                AddForms.RCAddForm.RCAdditionalEquipmentAddForm additionalEquipmentAddForm = new AddForms.RCAddForm.RCAdditionalEquipmentAddForm(
                    bunifuCustomDataGridEquipmentsDataBase.Rows[e.RowIndex].Cells["ColumnEquipment_id"].Value.ToString(),
                    bunifuCustomDataGridEquipmentsDataBase.Rows[e.RowIndex].Cells["ColumnEquipment"].Value.ToString(),
                    bunifuCustomDataGridEquipmentsDataBase.Rows[e.RowIndex].Cells["ColumnPrice"].Value.ToString()
                    );
                additionalEquipmentAddForm.DialogResult = DialogResult.None;
                additionalEquipmentAddForm.ShowDialog();
                if (additionalEquipmentAddForm.DialogResult == DialogResult.OK)
                {
                    load_equipments();
                }
            }
            else if (e.ColumnIndex == 4)
            {
                DialogResult dialog = MessageBox.Show("Ви дійсно бажаєте видалити цей об'єкт?", "?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (dialog == DialogResult.No)
                {
                    return;
                }

                AddForms.RCAddForm.RCAdditionalEquipmentAddForm additionalEquipmentAddForm = new AddForms.RCAddForm.RCAdditionalEquipmentAddForm(
                    bunifuCustomDataGridEquipmentsDataBase.Rows[e.RowIndex].Cells["ColumnEquipment_id"].Value.ToString(),
                    this
                    );
            }
        }
コード例 #2
0
 private void buttonAdd_Click(object sender, EventArgs e)
 {
     AddForms.RCAddForm.RCAdditionalEquipmentAddForm additionalEquipmentAddForm = new AddForms.RCAddForm.RCAdditionalEquipmentAddForm();
     additionalEquipmentAddForm.DialogResult = DialogResult.None;
     additionalEquipmentAddForm.ShowDialog();
     if (additionalEquipmentAddForm.DialogResult == DialogResult.OK)
     {
         load_equipments();
     }
 }