C2020-026 – consistent messaging when deleting sections and steps

This commit is contained in:
John Jenko 2020-07-16 14:11:09 +00:00
parent b8d46d3768
commit 91958accaa
2 changed files with 25 additions and 8 deletions

View File

@ -3355,7 +3355,8 @@ namespace Volian.Controls.Library
SectionInfo si = MyEditItem.MyItemInfo as SectionInfo;
if (si != null)
{
string msg = si.HasChildren ? "Are you sure you want to delete this section and its steps?" : "Are you sure you want to delete this section?";
//C2020-026 specific description of what user is trying to delete
string msg = "Are you sure you want to delete this Section" + (si.HasChildren ? " and its steps?" : "?");
DialogResult result = FlexibleMessageBox.Show(msg, "Verify Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.Yes)
{
@ -3386,13 +3387,13 @@ namespace Volian.Controls.Library
string msgs = "";
if (MyFlexGrid != null) MyEditItem.IdentifyMe(true);
MyEditItem.IdentifyChildren(true);
//C2020-026 specific description of what user is trying to delete
if (stpi.HasChildren)
msgs = string.Format("Are you sure you want to delete this {0} and its substeps?", typeDescription);
msgs = string.Format("Are you sure you want to delete this \"{0}\" and its substeps?", typeDescription);
else
msgs = string.Format("Are you sure you want to delete this {0}?", typeDescription);
msgs = string.Format("Are you sure you want to delete this \"{0}\"?", typeDescription);
if (stpi.HasEnhancedLinkedStep)
msgs = msgs + " The linked Enhanced step will also be deleted!";
//string msgs = stpi.HasChildren ? "Are you sure you want to delete this step and its substeps?" : "Are you sure you want to delete this step?";
msgs = msgs + "\n\n The linked Enhanced step will also be deleted!";
DialogResult results = FlexibleMessageBox.Show(msgs, "Verify Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (MyFlexGrid != null)
{

View File

@ -2964,24 +2964,38 @@ namespace Volian.Controls.Library
{
SetLastValues((VETreeNode)SelectedNode);
string message = string.Empty;
if(_LastStepInfo != null)
string typeDescription = "item";
if (_LastStepInfo != null)
{
if (!MySessionInfo.CanCheckOutItem(_LastStepInfo.MyProcedure.ItemID, CheckOutType.Procedure, ref message))
{
FlexibleMessageBox.Show(this, message, "Item Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return false;
}
//C2020-026 specific description of what user is trying to delete
typeDescription = "\"" + _LastStepInfo.FormatStepData.StepEditData.TypeMenu.MenuItem + "\"";
if (_LastStepInfo.HasChildren) typeDescription += " and its substeps";
}
if (_LastSectionInfo != null)
{
if (!MySessionInfo.CanCheckOutItem(_LastSectionInfo.MyProcedure.ItemID, CheckOutType.Procedure, ref message))
{
FlexibleMessageBox.Show(this, message, "Item Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return false;
}
//C2020-026 specific description of what user is trying to delete
typeDescription = "Section";
if (_LastSectionInfo.HasChildren) typeDescription += " and its steps";
}
if (_LastProcedureInfo != null)
{
if (!MySessionInfo.CanCheckOutItem(_LastProcedureInfo.ItemID, CheckOutType.Procedure, ref message))
{
FlexibleMessageBox.Show(this, message, "Item Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return false;
}
typeDescription = "Procedure"; //C2020-026 specific description of what user is trying to delete
}
if (_LastDocVersionInfo != null)
{
StringBuilder sb = new StringBuilder();
@ -2996,6 +3010,7 @@ namespace Volian.Controls.Library
FlexibleMessageBox.Show(this, sb.ToString(), "Items Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return false;
}
typeDescription = "Procedure Set"; //C2020-026 specific description of what user is trying to delete
}
if (_LastFolderInfo != null)
{
@ -3017,9 +3032,10 @@ namespace Volian.Controls.Library
FlexibleMessageBox.Show(this, sb.ToString(), "Items Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return false;
}
typeDescription = "Folder"; //C2020-026 specific description of what user is trying to delete
}
DialogResult result = FlexibleMessageBox.Show("Are you sure you want to delete " + SelectedNode.Text, "Verify Delete",
//C2020-026 added standardized wording when attempting to delete
DialogResult result = FlexibleMessageBox.Show("Are you sure you want to delete this " + typeDescription + "?", "Verify Delete",
MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.Yes)
{