C2020-038: When deleting a procedure, add a prompt so that user has to enter a reason that is saved to database

This commit is contained in:
2020-10-22 10:21:53 +00:00
parent 1f559a0d12
commit b172dc3080
8 changed files with 370 additions and 20 deletions

View File

@@ -504,7 +504,27 @@ namespace Volian.Controls.Library
#region new style
if (deletedItems == null)
deletedItems = tvAudits.Nodes.Add("Deleted Items");
TreeNode tnn = deletedItems.Nodes.Add(iai.ToString());
string strR = null;
// see if a deleted procedure, from itemaudit, get contentaudit
ContentAuditInfoList lDelC = ContentAuditInfoList.GetByDeleteStatus(iai.DeleteStatus);
foreach (ContentAuditInfo delC in lDelC)
{
if (delC.Type >= 0 && delC.Type < 1000)
{
int indx = delC.Config.IndexOf("DelProcReason");
if (indx >= 0 && delC.Config.Length > indx+15) // 15 accounts for 'DelProcReason = "'
{
string reason = delC.Config.Substring(indx + 15);
if (reason != null && reason.Length > 0)
{
indx = reason.IndexOf("\"");
if (indx > 0) strR = reason.Substring(0, reason.IndexOf("\""));
}
break;
}
}
}
TreeNode tnn = deletedItems.Nodes.Add(iai.ToString()+"; Reason: " + strR);
tnn.Tag = iai;
#endregion
}