public override void btn_Edit_Click(object sender, EventArgs e) { int productID = 0; if (dgrid_Result.Rows[dgrid_Result.SelectedCells[0].RowIndex].Cells["ProductID"].Value != null) { productID = Convert.ToInt32(dgrid_Result.Rows[dgrid_Result.SelectedCells[0].RowIndex].Cells["ProductID"].Value); } else { MessageBox.Show("لابد من اختيار صنف"); } frmBDProductAddEdit frm = new frmBDProductAddEdit(productID, this); frm.ShowDialog(); }
/// <summary> /// Events Override /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public override void btn_Add_Click(object sender, EventArgs e) { frmBDProductAddEdit frm = new frmBDProductAddEdit(this); frm.ShowDialog(); }