private void button1_Click(object sender, EventArgs e) { int?customerID = 0; if (dgrid_Result.Rows[dgrid_Result.SelectedCells[0].RowIndex].Cells["CustomerID"].Value != null) { if (MessageBox.Show("هل نت متأكد من تعديل حساب هذا العميل؟", "تحذير", MessageBoxButtons.YesNo) == DialogResult.Yes) { customerID = Convert.ToInt32(dgrid_Result.Rows[dgrid_Result.SelectedCells[0].RowIndex].Cells["CustomerID"].Value); frmCustomerAccountEdit _frmCustomerAccountEdit = new frmCustomerAccountEdit(customerID.Value, this); _frmCustomerAccountEdit.ShowDialog(); } else { return; } } else { MessageBox.Show("لابد من اختيار عميل"); } }
private void button1_Click(object sender, EventArgs e) { int? customerID = 0; if (dgrid_Result.Rows[dgrid_Result.SelectedCells[0].RowIndex].Cells["CustomerID"].Value != null) { if (MessageBox.Show("هل نت متأكد من تعديل حساب هذا العميل؟", "تحذير", MessageBoxButtons.YesNo) == DialogResult.Yes) { customerID = Convert.ToInt32(dgrid_Result.Rows[dgrid_Result.SelectedCells[0].RowIndex].Cells["CustomerID"].Value); frmCustomerAccountEdit _frmCustomerAccountEdit = new frmCustomerAccountEdit(customerID.Value, this); _frmCustomerAccountEdit.ShowDialog(); } else { return; } } else { MessageBox.Show("لابد من اختيار عميل"); } }