Upped revision number to 1.8

C2020-033: 2021 UPGRADE Handling of incoming transitions on delete or review
This commit is contained in:
2021-01-06 15:07:57 +00:00
parent ba2e72baeb
commit fdd59a5d6b
18 changed files with 1564 additions and 1005 deletions

View File

@@ -149,6 +149,29 @@ namespace VEPROMS.CSLA.Library
get { return (_Folder != null ? _Folder.ShortName : _FolderInfo.ShortName); }
set { if (_Folder != null)_Folder.ShortName = value; }
}
// C2020-033: Handling of external transitions - let admin decide who can convert transitions to text
[Category("General")]
[DisplayName("Non-Admin Convert Incoming Transitions To Text")]
[RefreshProperties(RefreshProperties.All)]
[Description("Non-Admin Convert Incoming Transitions To Text")]
public bool General_IncTranCvtPerm
{
get
{
string s = _Xp["General", "IncTranCvtPemr"];// get the saved value
//Dont't bother getting parent value, this is stored on 'top' node
if (s == string.Empty)
return false;
if (s.ToUpper() == "TRUE") return true;
return false;
}
set
{
_Xp["General", "IncTranCvtPemr"] = value ? "TRUE" : "FALSE";
OnPropertyChanged("General_IncTranCvtPerm");
}
}
[Category("Format Settings")]
[DisplayName("Format")]
[Description("Format")]

View File

@@ -5431,7 +5431,7 @@ namespace VEPROMS.CSLA.Library
}
}
#endregion
// C2020-018 used for a more descriptive warning message when deleting Procedures, Sections, Steps that have external transitions pointing to them
// C2020-018 used for a more descriptive warning message when deleting Procedures, Sections, Steps that have incoming transitions pointing to them
public string GetTypeDescription()
{
if (this != null)
@@ -5535,7 +5535,7 @@ namespace VEPROMS.CSLA.Library
// itemInfo.ToXml(xn);
// }
//}
internal ItemInfoList(ItemInfo itemInfo)
public ItemInfoList(ItemInfo itemInfo)
{
AddItem(itemInfo);
}
@@ -5928,7 +5928,7 @@ namespace VEPROMS.CSLA.Library
}
this.RaiseListChangedEvents = true;
}
internal void AddItem(ItemInfo itemInfo)
public void AddItem(ItemInfo itemInfo)
{
IsReadOnly = false;
this.Add(itemInfo);

View File

@@ -36,6 +36,9 @@ namespace VEPROMS.CSLA.Library
{
public ItemInfo HandleSqlExceptionOnDelete(Exception ex)
{
// C2020-033: The dialog message has been changed to reference the Tools/Search/Incoming Transitions tab and
// the return value was changed to return null (this was returning first in list, but now user gets all
// listed in the search dialog). This comment is for each of the dialogs below.
string itemDesc = this.GetTypeDescription(); // C2020-018 made the message more accurate when deleting a Procedure, Section, or Step
if (ex.Message.Contains("has External Transitions and has no next step"))
{
@@ -44,14 +47,8 @@ namespace VEPROMS.CSLA.Library
//C2020-018 build the message based on the type description
string msg1 = string.Format("Transitions exist to this {0} and cannot be adjusted automatically.", itemDesc);
DialogResult ans = FlexibleMessageBox.Show(msg1 +
"\r\n\r\nDo you want to be placed at the " + (exTrans.Count > 1 ? "first " : "") + "location with the problem Transition?" +
"\r\n\r\nLocations with Problem Transitions" +
exTrans.Summarize(),
"Cannot Delete This " + itemDesc, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (ans == DialogResult.Yes)
{
return exTrans[0].MyContent.ContentItems[0];
}
"\r\n\r\nThe list of all locations are shown in the Tools/Search/Incoming Transitions tab.",
"Cannot Delete This " + itemDesc, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
else if (ex.Message.Contains("has External Transitions to Procedure"))
@@ -59,14 +56,8 @@ namespace VEPROMS.CSLA.Library
using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(ItemID))
{
DialogResult ans = FlexibleMessageBox.Show("Transitions exist to this procedure and cannot be adjusted automatically." +
"\r\n\r\nDo you want to be placed at the " + (exTrans.Count > 1 ? "first " : "") + "location with the problem Transition?" +
"\r\n\r\nLocations with Problem Transitions" +
exTrans.Summarize(),
"Cannot Delete This Procedure", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (ans == DialogResult.Yes)
{
return exTrans[0].MyContent.ContentItems[0];
}
"\r\n\r\nThe list of all locations are shown in the Tools/Search/Incoming Transitions tab.",
"Cannot Delete This Procedure", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
// B2020-091: If deleting a section that has transitions pointing to it, show list:
@@ -75,14 +66,8 @@ namespace VEPROMS.CSLA.Library
using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(ItemID))
{
DialogResult ans = FlexibleMessageBox.Show("Transitions exist to this section and cannot be adjusted automatically." +
"\r\n\r\nDo you want to be placed at the " + (exTrans.Count > 1 ? "first " : "") + "location with the problem Transition?" +
"\r\n\r\nLocations with Problem Transitions" +
exTrans.Summarize(),
"Cannot Delete This Section", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (ans == DialogResult.Yes)
{
return exTrans[0].MyContent.ContentItems[0];
}
"\r\n\r\nThe list of all locations are shown in the Tools/Search/Incoming Transitions tab.",
"Cannot Delete This Section", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
else if (ex.Message.Contains("has External Transitions to it's children"))
@@ -92,15 +77,8 @@ namespace VEPROMS.CSLA.Library
//C2020-018 build the message based on the type description
string msg1 = string.Format("Transitions exist to {0} this {1} and cannot be adjusted automatically.", (this.IsSection) ? "steps in" : "children of", itemDesc);
DialogResult ans = FlexibleMessageBox.Show(msg1 +
"\r\n\r\nDo you want to be placed at the " + (exTrans.Count > 1 ? "first " : "") + "location with the problem Transition?" +
"\r\n\r\nLocations with Problem Transitions:" +
exTrans.Summarize(),
"Cannot Delete This "+itemDesc, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (ans == DialogResult.No) return this;// If answer "NO" then return self
if (ans == DialogResult.Yes)
{
return exTrans[0].MyContent.ContentItems[0];
}
"\r\n\r\nThe list of all locations are shown in the Tools/Search/Incoming Transitions tab.",
"Cannot Delete This " + itemDesc, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
else