diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs index 05244db9..54d87f2b 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs @@ -221,6 +221,30 @@ namespace VEPROMS.CSLA.Library return sb.ToString(); } } + // C2019-033 - Used when saving a Word Attachment that is a Library Document (will get all usages) + public string LibraryDocumentUsageAll + { + get + { + StringBuilder sb = new StringBuilder(); + string sep = "\r\nUsed In:\r\n "; + if (DocumentEntries == null) + sb.Append("None"); + else + { + foreach (EntryInfo myEntry in DocumentEntries) + { + foreach (ItemInfo myItem in myEntry.MyContent.ContentItems) + { + ItemInfo proc = myItem.MyProcedure; + sb.Append(sep + proc.DisplayNumber + " - " + proc.DisplayText); + sep = "\r\n "; + } + } + } + return sb.ToString(); + } + } public ItemInfoList LibraryDocumentUsageList { get diff --git a/PROMS/Volian.Controls.Library/DSOTabPanel.cs b/PROMS/Volian.Controls.Library/DSOTabPanel.cs index 27680463..0f479c47 100644 --- a/PROMS/Volian.Controls.Library/DSOTabPanel.cs +++ b/PROMS/Volian.Controls.Library/DSOTabPanel.cs @@ -9,6 +9,7 @@ using VEPROMS.CSLA.Library; using Volian.Controls.Library; using System.Reflection; using LBWordLibrary; +using JR.Utils.GUI.Forms; namespace Volian.Controls.Library { @@ -478,7 +479,12 @@ namespace Volian.Controls.Library EntryInfo myei = MyDisplayTabItem.MyItemInfo.MyContent.MyEntry; if (myei != null && myei.MyDocument != null && myei.MyDocument.LibTitle != null && myei.MyDocument.LibTitle != "") { - DialogResult ans = MessageBox.Show("Save as Library Document for all usages?", "Document Save", MessageBoxButtons.YesNo); + // C2019-033 - make save options more clear with respect to library documents + string msgstr = "Save to Library Document?" + + "\n\n YES - Save for all usages of this Library Document." + + "\n\n NO - Unlink this Section from the Library Document and Save in this Word Section.\n\n" + + _MyDocumentInfo.LibraryDocumentUsageAll; + DialogResult ans = FlexibleMessageBox.Show(msgstr, "Document Save", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (ans == DialogResult.No) cvtLibDoc = true; } } @@ -571,8 +577,9 @@ namespace Volian.Controls.Library } //if (MessageBox.Show("Save changes to " + _MyDisplayTabItem.MyItemInfo.TabTitle + "\r\n" + _MyDisplayTabItem.MyItemInfo.TabToolTip, "Document has Changed", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) // B2017-249 Recover Temporary File And AutoSave support for MSWord - if (MessageBox.Show("Save changes to " + (MyDSOFile.MyDocument.ContentIsDirty ? "Recovered Version of " : "") + _MyDisplayTabItem.Text + "\r\n" + _MyDisplayTabItem.Tooltip, - (IsDirty ? "Document has Changed" : "Previous Changes were not saved."), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) + // C2019-033 - make save options more clear with respect to library documents second dialog will appear if Yes is selected and it's a library document + string msgstr = "Save changes to " + (MyDSOFile.MyDocument.ContentIsDirty ? "Recovered Version of " : "") + _MyDisplayTabItem.Text; + if (FlexibleMessageBox.Show(msgstr, (IsDirty ? "Document has Changed" : "Previous Changes were not Saved"), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) return SaveDSO(); //Console.WriteLine("Delete {0}", MyDSOFile.MyFile.Name); DeleteOnClose = true;