Added HasWorkingDraft property - B2010-007

Don't allow a WorkingDraft to be created if one exists - B2010-007
This commit is contained in:
Rich 2011-01-03 20:34:51 +00:00
parent 01c4a1e468
commit 5915380402
2 changed files with 14 additions and 1 deletions

View File

@ -266,6 +266,19 @@ namespace VEPROMS.CSLA.Library
#endregion
public Color BackColor
{ get { return FolderConfig.Default_BkColor; } }
public bool HasWorkingDraft
{
get
{
if (FolderDocVersionCount > 0)
{
foreach (DocVersionInfo dvi in FolderDocVersions)
if (dvi.VersionType == 0)
return true;
}
return false;
}
}
#region Extension
partial class FolderInfoExtension : extensionBase
{

View File

@ -401,7 +401,7 @@ namespace Volian.Controls.Library
cm.MenuItems.Add("Insert Folder After", new EventHandler(mi_Click));
}
if (fi.FolderDocVersionCount == 0) cm.MenuItems.Add("New Folder", new EventHandler(mi_Click));
if (fi.ChildFolderCount == 0) cm.MenuItems.Add("Create Working Draft", new EventHandler(mi_Click));
if (fi.ChildFolderCount == 0 && !fi.HasWorkingDraft) cm.MenuItems.Add("Create Working Draft", new EventHandler(mi_Click));
}
else if (tn.VEObject as DocVersionInfo != null) // DocVersions can only contain procs
cm.MenuItems.Add("New Procedure", new EventHandler(mi_Click));