Made the “No item found” message more descriptive when junk text is entered in the debug box used to enter ItemIDs

Added a check for a null document version for when a disconnected itemID is entered in the debug box used enter ItemIDs
This commit is contained in:
John Jenko 2016-05-02 19:10:51 +00:00
parent 9bd54c9c3f
commit 99b7a5de3d
2 changed files with 6 additions and 1 deletions

View File

@ -1761,7 +1761,7 @@ namespace VEPROMS
tv.AdjustTree(ii);
}
else
MessageBox.Show("No item found");
MessageBox.Show(string.Format("Looking for: {0}",str),"No item found");
}
private static ItemInfo GetItemInfoFromString(string str) // RHM20150506 Multiline ItemID TextBox

View File

@ -449,6 +449,11 @@ namespace Volian.Controls.Library
public DisplayTabItem OpenItem(ItemInfo myItemInfo2, bool setFocus)
{
ItemInfo myItemInfo = myItemInfo2;
if (myItemInfo.MyDocVersion == null) // bug fix: B2016-108 disconnected data will not have a MyDocVersion
{
MessageBox.Show(this, "Possible disconnected item", "Item Not Found");
return null;
}
if(VersionID!=myItemInfo.MyDocVersion.VersionID)
{
if(_AllDTCs.ContainsKey(myItemInfo.MyDocVersion.VersionID))