B2026-078 Hide Delete and Open Button for Library Documents with any occurrences. #827

Merged
jjenko merged 1 commits from B2026-078 into Development 2026-10-15 14:48:59 -04:00
+10 -10
View File
@@ -29,9 +29,9 @@ namespace Volian.Controls.Library
public DisplayLibDocs() public DisplayLibDocs()
{ {
InitializeComponent(); InitializeComponent();
btnOpenLibDoc.Enabled = false; btnOpenLibDoc.Visible = btnOpenLibDoc.Enabled = false;
btnDelLibDoc.Enabled = false; btnDelLibDoc.Visible = btnDelLibDoc.Enabled = false;
btnPrint.Enabled = listBoxLibDocs.Items.Count > 0; btnPrint.Enabled = listBoxLibDocs.Items.Count > 0;
saveGroupPanelUsages = groupPanelUsages.Style.BackColor; saveGroupPanelUsages = groupPanelUsages.Style.BackColor;
} }
DisplayTabControl _DisplayTabControl; DisplayTabControl _DisplayTabControl;
@@ -107,14 +107,14 @@ namespace Volian.Controls.Library
groupPanelUsages.Style.BackColor = dicnt.LibraryDocumentUsageList == null || dicnt.LibraryDocumentUsageList.Count == 0 ? this.saveGroupPanelUsages : Color.LightGreen; groupPanelUsages.Style.BackColor = dicnt.LibraryDocumentUsageList == null || dicnt.LibraryDocumentUsageList.Count == 0 ? this.saveGroupPanelUsages : Color.LightGreen;
if (iil == null) if (iil == null)
{ {
btnDelLibDoc.Enabled = true; btnOpenLibDoc.Visible = btnOpenLibDoc.Enabled = true;
btnOpenLibDoc.Enabled = true; btnDelLibDoc.Visible = btnDelLibDoc.Enabled = true;
return; return;
} }
// Put the usages in the usage list for the selected library document. // Put the usages in the usage list for the selected library document.
btnDelLibDoc.Enabled = false; btnOpenLibDoc.Visible = btnOpenLibDoc.Enabled = false;
btnOpenLibDoc.Enabled = false; btnDelLibDoc.Visible = btnDelLibDoc.Enabled = false;
foreach (ItemInfo ii in dicnt.LibraryDocumentUsageList) foreach (ItemInfo ii in dicnt.LibraryDocumentUsageList)
{ {
if (ii.MyDocVersion != null) if (ii.MyDocVersion != null)
listBoxUsages.Items.Add($"{ii.MyProcedure} - {ii.DisplayNumber} {ii.DisplayText}"); listBoxUsages.Items.Add($"{ii.MyProcedure} - {ii.DisplayNumber} {ii.DisplayText}");