private void btnSendMR_Click(object sender, EventArgs e) { try { DialogResult theResult = MessageBox.Show(this, "Do You want to Request Items from Stores", "Confirmation", MessageBoxButtons.YesNo); if (theResult == System.Windows.Forms.DialogResult.Yes) { if ((cmbBatchNo.SelectedValue != null) && (cmbPart.Text != "") && (dgvItemList.Rows.Count > 0)) { if (rdbMaterial.Checked == true) { long MRNO = objMRDL.Add_BatchMR(cmbPart.Text, objBatch.BatchID, objStore.StoreID, CurrentUser.EmployeeID, "MR For Batch No " + cmbBatchNo.SelectedValue.ToString(), MR.Status.Initial, MR.Type.Material, Convert.ToInt32(MR.Origin.ToBatch)); if (MRNO > 0) { MessageBox.Show(this, "Successfully Send raised and MR. The MRNO is : " + MRNO, "Successful", MessageBoxButtons.OK); } } if (rdbSemiFinished.Checked == true) { long MRNO = objMRDL.Add_BatchMR_SemiFinished(cmbPart.Text, objBatch.BatchID, objStore.StoreID, CurrentUser.EmployeeID, "MR For Batch No " + cmbBatchNo.SelectedValue.ToString(), MR.Status.Initial, MR.Type.BasicProduct, Convert.ToInt32(MR.Origin.ToBatch)); if (MRNO > 0) { MessageBox.Show(this, "Successfully Send raised and MR. The MRNO is : " + MRNO, "Successful", MessageBoxButtons.OK); } } LoadMaterialList(); } } } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }