private void btnMarkAsVoid_Click(object sender, EventArgs e) { if (XtraMessageBox.Show("Are you sure you want to request a void?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { MyGeneration.dOOdads.TransactionMgr mgr = MyGeneration.dOOdads.TransactionMgr.ThreadTransactionMgr(); try { mgr.BeginTransaction(); BLL.Issue stv = new BLL.Issue(); stv.LoadByPrimaryKey(_activeSTVID); stv.SendAVoidRequest(CurrentContext.UserId); this.LogActivity("Request-Void", _activeSTVID); mgr.CommitTransaction(); XtraMessageBox.Show("A void request sent!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception exp) { mgr.RollbackTransaction(); XtraMessageBox.Show("System couldn't request a void, Please contact administrator", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); ErrorHandler.Handle(exp); } BindUnconfirmedIssues(); gridUndispatchedIssueDetails.DataSource = null; } }
private void btnMarkAsVoid_Click(object sender, EventArgs e) { if (XtraMessageBox.Show("Are you sure you want to request a void?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { MyGeneration.dOOdads.TransactionMgr mgr = MyGeneration.dOOdads.TransactionMgr.ThreadTransactionMgr(); try { mgr.BeginTransaction(); BLL.Issue stv = new BLL.Issue(); stv.LoadByPrimaryKey(_activeSTVID); stv.SendAVoidRequest(CurrentContext.UserId); this.LogActivity("Request-Void", _activeSTVID); mgr.CommitTransaction(); XtraMessageBox.Show("A void request sent!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception exp) { mgr.RollbackTransaction(); XtraMessageBox.Show("System couldn't request a void, Please contact administrator", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); ErrorHandler.Handle(exp); } BindUnconfirmedIssues(); gridUndispatchedIssueDetails.DataSource = null; } }