コード例 #1
0
        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);
                }
            }
        }
コード例 #2
0
        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);
 }
コード例 #4
0
 private void DiscardDetailWithoutPublishedTabVersions(int tabId, TabVersionDetail unPublishedDetail)
 {
     if (unPublishedDetail.ModuleVersion != Null.NullInteger)
     {
         DiscardDetail(tabId, unPublishedDetail);
     }
     _moduleController.DeleteTabModule(tabId, unPublishedDetail.ModuleId, true);
 }
コード例 #5
0
        private void UpdateModuleOrder(int tabId, TabVersionDetail detailToRestore)
        {
            var restoredModule = _moduleController.GetModule(detailToRestore.ModuleId, tabId, true);

            if (restoredModule != null)
            {
                UpdateModuleInfoOrder(restoredModule, detailToRestore);
            }
        }
コード例 #6
0
        private static TabVersionDetail JoinVersionDetails(TabVersionDetail tabVersionDetail, TabVersionDetail newVersionDetail)
        {
            // Movement changes have not ModuleVersion
            if (newVersionDetail.ModuleVersion == Null.NullInteger)
            {
                newVersionDetail.ModuleVersion = tabVersionDetail.ModuleVersion;
            }

            return(newVersionDetail);
        }
コード例 #7
0
        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);
            }
        }
コード例 #8
0
        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);
            }
        }
コード例 #9
0
        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);
            }
        }
コード例 #10
0
        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);
 }
コード例 #13
0
 private void UpdateModuleInfoOrder(ModuleInfo module, TabVersionDetail detailToRestore)
 {
     module.PaneName    = detailToRestore.PaneName;
     module.ModuleOrder = detailToRestore.ModuleOrder;
     _moduleController.UpdateModule(module);
 }