Fix bug in vesp_ListUnlinkedItems (getting item when only 1 proc in working draft) & added vesp_PurgeEnhancedDocVersionsAndChildren

Allow insert of HLS before/after
Enhanced: User interface for removing links of an enhanced document
Enhanced: CSLA interface to unlinking docversion & contents (returns contentlist of affected items)
Enhanced: Unlink DocVersion
This commit is contained in:
2016-05-11 12:25:58 +00:00
parent 6822406b9e
commit 0596efdd04
7 changed files with 615 additions and 410 deletions

View File

@@ -246,7 +246,46 @@ namespace VEPROMS.CSLA.Library
}
public string SearchPath { get { return ""; } }
#endregion
#region UnlinkEnhancedDocVersion
// Unlink (clear) enhanced from source for this docversion. Refresh all related cache items.
public void DoUnlinkEnhancedDocVersion()
{
try
{
// get source docversion id for refresh - used later (check for null, just in case):
int sdvid = DocVersionConfig != null && DocVersionConfig.MyEnhancedDocuments.Count > 0 ? DocVersionConfig.MyEnhancedDocuments[0].VersionID : -1;
using (ContentInfoList cil = ContentInfoList.DoEnhancedDocVersionUnlink(this.VersionID))
{
foreach (ContentInfo ci in cil)
{
using (Content c = ci.Get())
{
// first refresh configs because the ContentInfo.Refresh causes events to occur that refresh screen
// and if configs aren't done first, the screen refresh, if based on config data, will not be correct.
foreach (ItemInfo ii in ci.ContentItems) ii.RefreshConfig();
ContentInfo.Refresh(c);
}
}
}
// Refresh for this docversion
Refresh(DocVersion.Get(this.VersionID));
DocVersionConfigRefresh();
// Refresh the source document's cache
if (sdvid > -1)
{
using (DocVersion dv = DocVersion.Get(sdvid))
{
Refresh(dv);
dv.MyDocVersionInfo.DocVersionConfigRefresh();
}
}
}
catch (Exception ex)
{
throw new DbCslaException("Error on DocVersionInfo:DoUnlinkEnhancedDocVersion", ex);
}
}
#endregion UnlinkEnhanced
#region DocVersion Config
[NonSerialized]
private DocVersionConfig _DocVersionConfig;