C2018-006: Disable Check and Cascade buttons when doing an Approve All

C2018-007: Doing Approve All or Some, only prompt once whether to include Summary of Changes
B2018-083: Fix crash when doing a Approve Some
This commit is contained in:
2018-06-07 13:39:37 +00:00
parent 95d181c3a6
commit f9dba790f9

View File

@@ -79,6 +79,9 @@ namespace VEPROMS
//pnlSelect.LocationChanged += new EventHandler(Panel_LocationChanged);
pnlApprove.SendToBack();
this.Width = pnlApprove.Width + this.Width - this.ClientSize.Width;
// C2018-006: Disable Consistency Check and Cascade buttons when doing a Approve All
chkCascade2.Enabled = false;
btnCheck2.Enabled = false;
}
private void FlexGridAddEvents()
@@ -192,7 +195,8 @@ namespace VEPROMS
{
OwnerInfo oi = OwnerInfo.GetByItemID(pi.ItemID, CheckOutType.Procedure);
pi.MyDocVersion.DocVersionConfig.SelectedSlave = _MyDocVersion.DocVersionConfig.SelectedSlave;
if (oi != null && oi.SessionID != MySessionInfo.SessionID)
// B2018-083: check for null MySessionInfo.
if (oi != null && MySessionInfo != null && oi.SessionID != MySessionInfo.SessionID)
{
string prcNumber = pi.DisplayNumber + string.Format(" Checked out to {0}", oi.SessionUserID);
clbMore.Items.Add(prcNumber);
@@ -1035,6 +1039,10 @@ namespace VEPROMS
if (MessageBox.Show(sb.ToString(),string.Format("Revert to {0}",nsi.Name),MessageBoxButtons.YesNo,MessageBoxIcon.Stop) == DialogResult.No)
return false;
}
// C2018-007: When performing more than a single procedure approval (approve all or some), only prompt once whether to include
// Summary of Changes (use the following 2 flags, code using them is below)
bool askedSumChg = false;
bool doSumChg = false;
foreach (ApprovalProcedure ap in MyProcedures)
{
ProcedureInfo pi = ap.ProcInfo;
@@ -1109,9 +1117,14 @@ namespace VEPROMS
}
}
byte[] summaryBuf = null;
// C2018-007: only prompt once for summary of changes
if (!askedSumChg)
{
doSumChg = MessageBox.Show("Do you want to save the Summary of Changes along with the Approved PDF?", "Create Summary of Changes", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes;
askedSumChg = true;
}
//B2017-149 Allow the user to choose if they want the Summary of Changes report created during the approval process
if (MessageBox.Show("Do you want to save the Summary of Changes along with the Approved PDF?", "Create Summary of Changes", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
summaryBuf = CreateSummary(ref pi, summaryPDF, myDTS);
if (doSumChg) summaryBuf = CreateSummary(ref pi, summaryPDF, myDTS);
DateTime currentDTS = DateTime.Now;
Check check = Check.MakeCheck(revision, Stage.GetJustStage(RevStage), RevisionInfo.BuildRevisionChecks(pi), currentDTS, VlnSettings.UserID);
//make pdf with promsprinter and get byte stream