diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs index 46b910a4..fb34bd56 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs @@ -36,26 +36,54 @@ namespace VEPROMS.CSLA.Library { StringBuilder sb = new StringBuilder(); string sep = "\r\nUsed In:\r\n "; - foreach (EntryInfo myEntry in DocumentEntries) + if (DocumentEntries == null) + sb.Append("None"); + else { - foreach (ItemInfo myItem in myEntry.MyContent.ContentItems) + foreach (EntryInfo myEntry in DocumentEntries) { - ItemInfo proc = myItem.MyProcedure; - sb.Append(sep + proc.MyContent.Number + " - " + proc.MyContent.Text); - sep = "\r\n "; + foreach (ItemInfo myItem in myEntry.MyContent.ContentItems) + { + ItemInfo proc = myItem.MyProcedure; + sb.Append(sep + proc.MyContent.Number + " - " + proc.MyContent.Text); + sep = "\r\n "; + } } } return sb.ToString(); } } + public ItemInfoList LibraryDocumentUsageList + { + get + { + bool first = true; + ItemInfoList iil = null; + if (DocumentEntries == null) return null; + foreach (EntryInfo myEntry in DocumentEntries) + { + foreach (ItemInfo myitem in myEntry.MyContent.ContentItems) + { + if (first) + { + iil = new ItemInfoList(myitem); + first = false; + } + else + iil.AddItem(myitem); + } + } + return iil; + } + } } public partial class DocumentInfoList { - public static DocumentInfoList GetLibraries() + public static DocumentInfoList GetLibraries(bool forceload) { try { - if (_DocumentInfoList != null) + if (!forceload && _DocumentInfoList != null) return _DocumentInfoList; DocumentInfoList tmp = DataPortal.Fetch(new LibraryCriteria(true)); DocumentInfo.AddList(tmp); @@ -220,6 +248,15 @@ namespace VEPROMS.CSLA.Library Console.WriteLine(ex.Message); } } + public string FullName + { + get { return _MyFile.FullName; } + set + { + if(FullName != value) + _MyFile = new FileInfo(value); + } + } public void SaveFile() { // TODO: Add Try & Catch logic