diff --git a/PROMS/Volian.Controls.Library/DisplayTabControl.cs b/PROMS/Volian.Controls.Library/DisplayTabControl.cs index bb08ae51..470f32b0 100644 --- a/PROMS/Volian.Controls.Library/DisplayTabControl.cs +++ b/PROMS/Volian.Controls.Library/DisplayTabControl.cs @@ -411,7 +411,14 @@ namespace Volian.Controls.Library EntryInfo myEntry = myItemInfo.MyContent.MyEntry; string key = "Doc - " + myEntry.DocID; if (_MyDisplayTabItems.ContainsKey(key)) // If document page open use it + { pg = _MyDisplayTabItems[key]; + if (pg.MyItemInfo.ItemID != myItemInfo.ItemID) + { + string msg = string.Format("{0} is already open", myItemInfo.MyContent.MyEntry.MyDocument.LibTitle); + MessageBox.Show(msg, "Library Document is Already Open", MessageBoxButtons.OK); + } + } else { if (DSOTabPanel.Count > 18) // Limit the number of open document pages to 18 @@ -419,8 +426,10 @@ namespace Volian.Controls.Library MessageBox.Show("Too many Word Documents Open. Please close one of the Documents before attempting to open another"); return null; } + if ((myItemInfo.MyContent.MyEntry.MyDocument.LibTitle ?? "") != "") + MessageBox.Show("WARNING: All edits made to this Library Document will be applied to all uses of the Document"); pg = new DisplayTabItem(this.components, this, myItemInfo, key); // Open a new document page - _MyDisplayTabItems.Add(key, pg); + _MyDisplayTabItems.Add(key, pg); } SelectedDisplayTabItem = pg; pg.MyDSOTabPanel.EnterPanel();