Added ErrorLog Message if a disconnected item is processed
Added logic to keep disconnected items from being displayed in the search results If the user selects a disconnected item the code will display a message rather than crashing.
This commit is contained in:
parent
3754f2f00d
commit
f7c265c388
@ -2241,7 +2241,14 @@ namespace VEPROMS.CSLA.Library
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
string str = MyContent.Text;
|
string str = MyContent.Text;
|
||||||
str = Regex.Replace(str, @"\<[uU]\>", MyDocVersion.DocVersionConfig.Unit_Number);
|
if (MyDocVersion != null)
|
||||||
|
{
|
||||||
|
str = Regex.Replace(str, @"\<[uU]\>", MyDocVersion.DocVersionConfig.Unit_Number);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_MyLog.WarnFormat("Disconnected Data - ItemID = {0}", ItemID);
|
||||||
|
}
|
||||||
//if (str.Contains("<u>"))
|
//if (str.Contains("<u>"))
|
||||||
// str = str.Replace("<u>", MyDocVersion.DocVersionConfig.Unit_Number);
|
// str = str.Replace("<u>", MyDocVersion.DocVersionConfig.Unit_Number);
|
||||||
//if (str.Contains("<U>"))
|
//if (str.Contains("<U>"))
|
||||||
@ -2253,9 +2260,18 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
string str = (this.IsProcedure) ? MyDocVersion.UnitSpecific(MyContent.Number, 0) : MyContent.Number;
|
string str = MyContent.Number;
|
||||||
str = Regex.Replace(str, @"\<U-ID\>", MyDocVersion.DocVersionConfig.Unit_ID, RegexOptions.IgnoreCase);
|
if (MyDocVersion != null)
|
||||||
str = Regex.Replace(str, @"\<ID\>", MyDocVersion.DocVersionConfig.Unit_ID, RegexOptions.IgnoreCase);
|
{
|
||||||
|
str = (this.IsProcedure) ? MyDocVersion.UnitSpecific(MyContent.Number, 0) : MyContent.Number;
|
||||||
|
str = Regex.Replace(str, @"\<U-ID\>", MyDocVersion.DocVersionConfig.Unit_ID, RegexOptions.IgnoreCase);
|
||||||
|
str = Regex.Replace(str, @"\<ID\>", MyDocVersion.DocVersionConfig.Unit_ID, RegexOptions.IgnoreCase);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
str = "*" + str;
|
||||||
|
_MyLog.WarnFormat("Disconnected Data - ItemID = {0}", ItemID);
|
||||||
|
}
|
||||||
//if (str.Contains("<U-ID>"))
|
//if (str.Contains("<U-ID>"))
|
||||||
// str = str.Replace("<U-ID>", MyDocVersion.DocVersionConfig.Unit_ID);
|
// str = str.Replace("<U-ID>", MyDocVersion.DocVersionConfig.Unit_ID);
|
||||||
//if (str.Contains(@"<S\u8209?ID>"))
|
//if (str.Contains(@"<S\u8209?ID>"))
|
||||||
|
@ -122,7 +122,8 @@ namespace Volian.Controls.Library
|
|||||||
btnOpenLibDoc.Enabled = false;
|
btnOpenLibDoc.Enabled = false;
|
||||||
foreach (ItemInfo ii in dicnt.LibraryDocumentUsageList)
|
foreach (ItemInfo ii in dicnt.LibraryDocumentUsageList)
|
||||||
{
|
{
|
||||||
listBoxUsages.Items.Add(ii.MyProcedure.ToString() + " - " + ii.MyContent.Number + " " + ii.MyContent.Text);
|
if(ii.MyDocVersion!=null)
|
||||||
|
listBoxUsages.Items.Add(ii.MyProcedure.ToString() + " - " + ii.MyContent.Number + " " + ii.MyContent.Text);
|
||||||
}
|
}
|
||||||
btnPrint.Enabled = listBoxUsages.Items.Count > 0 ? true : false;
|
btnPrint.Enabled = listBoxUsages.Items.Count > 0 ? true : false;
|
||||||
}
|
}
|
||||||
@ -284,8 +285,14 @@ namespace Volian.Controls.Library
|
|||||||
MessageBox.Show("No Content in this document");
|
MessageBox.Show("No Content in this document");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (listBoxUsages.SelectedIndex < di.LibraryDocumentUsageList.Count && listBoxUsages.SelectedIndex >= 0)
|
if (listBoxUsages.SelectedIndex < di.LibraryDocumentUsageList.Count && listBoxUsages.SelectedIndex >= 0)
|
||||||
_DisplayTabControl.OpenItem(di.LibraryDocumentUsageList[listBoxUsages.SelectedIndex]);
|
{
|
||||||
|
ItemInfo ii = di.LibraryDocumentUsageList[listBoxUsages.SelectedIndex];
|
||||||
|
if (ii.MyDocVersion == null)
|
||||||
|
MessageBox.Show("This usage is not connected properly", "Disconnected Data", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||||
|
else
|
||||||
|
_DisplayTabControl.OpenItem(ii);
|
||||||
|
}
|
||||||
_ProcessingSelectedValueChanged = false;
|
_ProcessingSelectedValueChanged = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user