private void DiscardDetailWithPublishedTabVersions(int tabId, TabVersionDetail unPublishedDetail, TabVersionDetail[] publishedChanges) { if (unPublishedDetail.Action == TabVersionDetailAction.Deleted) { var restoredModuleDetail = publishedChanges.SingleOrDefault(tv => tv.ModuleId == unPublishedDetail.ModuleId); if (restoredModuleDetail != null) { RestoreModuleInfo(tabId, restoredModuleDetail); } return; } if (publishedChanges.All(tv => tv.ModuleId != unPublishedDetail.ModuleId)) { _moduleController.DeleteTabModule(tabId, unPublishedDetail.ModuleId, true); return; } if (unPublishedDetail.Action == TabVersionDetailAction.Modified) { var publishDetail = publishedChanges.SingleOrDefault(tv => tv.ModuleId == unPublishedDetail.ModuleId); if (publishDetail.PaneName != unPublishedDetail.PaneName || publishDetail.ModuleOrder != unPublishedDetail.ModuleOrder) { _moduleController.UpdateModuleOrder(tabId, publishDetail.ModuleId, publishDetail.ModuleOrder, publishDetail.PaneName); } if (unPublishedDetail.ModuleVersion != Null.NullInteger) { DiscardDetail(tabId, unPublishedDetail); } } }
private void RestoreModuleInfo(int tabId, TabVersionDetail detailsToRestore) { var restoredModule = _moduleController.GetModule(detailsToRestore.ModuleId, tabId, true); _moduleController.RestoreModule(restoredModule); UpdateModuleInfoOrder(restoredModule, detailsToRestore); }
public void SaveTabVersionDetail(TabVersionDetail tabVersionDetail, int createdByUserID, int modifiedByUserID) { tabVersionDetail.TabVersionDetailId = Provider.SaveTabVersionDetail(tabVersionDetail.TabVersionDetailId, tabVersionDetail.TabVersionId, tabVersionDetail.ModuleId, tabVersionDetail.ModuleVersion, tabVersionDetail.PaneName, tabVersionDetail.ModuleOrder, (int)tabVersionDetail.Action, createdByUserID, modifiedByUserID); ClearCache(tabVersionDetail.TabVersionId); }
private void DiscardDetailWithoutPublishedTabVersions(int tabId, TabVersionDetail unPublishedDetail) { if (unPublishedDetail.ModuleVersion != Null.NullInteger) { DiscardDetail(tabId, unPublishedDetail); } _moduleController.DeleteTabModule(tabId, unPublishedDetail.ModuleId, true); }
private void UpdateModuleOrder(int tabId, TabVersionDetail detailToRestore) { var restoredModule = _moduleController.GetModule(detailToRestore.ModuleId, tabId, true); if (restoredModule != null) { UpdateModuleInfoOrder(restoredModule, detailToRestore); } }
private static TabVersionDetail JoinVersionDetails(TabVersionDetail tabVersionDetail, TabVersionDetail newVersionDetail) { // Movement changes have not ModuleVersion if (newVersionDetail.ModuleVersion == Null.NullInteger) { newVersionDetail.ModuleVersion = tabVersionDetail.ModuleVersion; } return(newVersionDetail); }
private void RestoreModuleInfo(int tabId, TabVersionDetail detailsToRestore) { var restoredModule = this._moduleController.GetModule(detailsToRestore.ModuleId, tabId, true); if (restoredModule != null) { this._moduleController.RestoreModule(restoredModule); this.UpdateModuleInfoOrder(restoredModule, detailsToRestore); } }
private void DiscardDetail(int tabId, TabVersionDetail unPublishedDetail) { var moduleInfo = _moduleController.GetModule(unPublishedDetail.ModuleId, tabId, true); if (_moduleController.IsSharedModule(moduleInfo)) { return; } var versionableController = GetVersionableController(moduleInfo); if (versionableController != null) { versionableController.DeleteVersion(unPublishedDetail.ModuleId, unPublishedDetail.ModuleVersion); } }
private void PublishDetail(int tabId, TabVersionDetail unPublishedDetail) { var moduleInfo = this._moduleController.GetModule(unPublishedDetail.ModuleId, tabId, true); if (moduleInfo == null || this._moduleController.IsSharedModule(moduleInfo)) { return; } var versionableController = this.GetVersionableController(moduleInfo); if (versionableController != null) { versionableController.PublishVersion(unPublishedDetail.ModuleId, unPublishedDetail.ModuleVersion); } }
private int RollBackDetail(int tabId, TabVersionDetail unPublishedDetail) { var moduleInfo = _moduleController.GetModule(unPublishedDetail.ModuleId, tabId, true); var versionableController = GetVersionableController(moduleInfo); if (versionableController == null) { return(Null.NullInteger); } if (_moduleController.IsSharedModule(moduleInfo)) { return(versionableController.GetPublishedVersion(moduleInfo.ModuleID)); } return(versionableController.RollBackVersion(unPublishedDetail.ModuleId, unPublishedDetail.ModuleVersion)); }
public void SaveTabVersionDetail(TabVersionDetail tabVersionDetail, int createdByUserID) { SaveTabVersionDetail(tabVersionDetail, createdByUserID, createdByUserID); }
public void SaveTabVersionDetail(TabVersionDetail tabVersionDetail) { SaveTabVersionDetail(tabVersionDetail, tabVersionDetail.CreatedByUserID, tabVersionDetail.LastModifiedByUserID); }
private void UpdateModuleInfoOrder(ModuleInfo module, TabVersionDetail detailToRestore) { module.PaneName = detailToRestore.PaneName; module.ModuleOrder = detailToRestore.ModuleOrder; _moduleController.UpdateModule(module); }