private void button2_Click(object sender, EventArgs e) { try { if (this.ItemSelect) { DialogResult dr = MessageBox.Show(this, "Are you sure you want received selected Material Requisition?\n\nClick Yes to Receive", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); if (dr == DialogResult.Yes) { objMR.MRReceivedBy = CurrentUser.UserEmp.EmployeeID; objMR.MRStatus = MR.Status.Recevied; //int x = objMRDL.Update_Receive_toRPDBatch(objMR); int x = objMRDL.Update_Receive_toBatch(objMR); Load_MaterialList(); Load_MRList(); Load_MRItem(); } } else { MessageBox.Show(this, "Please Select a Material Requition", "Selection Empty", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } catch (Exception ex) { MessageBox.Show(this, "Error occured while Receiving", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void button2_Click(object sender, EventArgs e) { try { if (this.ItemSelect) { DialogResult dr = MessageBox.Show(this, "Are you sure you want received selected Material Requisition?\n\nClick Yes to Receive", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); if (dr == DialogResult.Yes) { objMR.MRReceivedBy = CurrentUser.UserEmp.EmployeeID; objMR.MRStatus = MR.Status.Recevied; int x = objMRDL.Update_Receive_toBatch(objMR); Load_MRList(); Load_MRItem(); if (gvMRList.Rows.Count > 0) { DataGridViewCellEventArgs a = new DataGridViewCellEventArgs(1, 0); gvMRList_CellClick(sender, a); } else { bindItemList.DataSource = null; gvItemList.AutoGenerateColumns = false; gvItemList.DataSource = bindItemList; bindItemList.ResetBindings(true); } } } else { MessageBox.Show(this, "Please Select a Material Requition", "Selection Empty", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } catch (Exception ex) { MessageBox.Show(this, "Error occured while Receiving", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }