/// -----------------------------------------------------------------------------
        /// <summary>
        ///   UpdateWorkFlow updates the currently active Workflow
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <param name="WorkFlowType">The type of workflow (Module | Page | Site)</param>
        /// <param name = "WorkflowID">The ID of the Workflow</param>
        /// <param name="ObjectID">The ID of the object to apply the update to (depends on WorkFlowType)</param>
        /// <param name="ReplaceExistingSettings">Should existing settings be overwritten?</param>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        public void UpdateWorkflow(int ObjectID, string WorkFlowType, int WorkflowID, bool ReplaceExistingSettings)
        {
            var tabController = new TabController();
            var moduleController = new ModuleController();

            switch (WorkFlowType)
            {
                case "Module":
                    moduleController.UpdateModuleSetting(ObjectID, "WorkflowID", WorkflowID.ToString());
                    break;
                case "Page":
                    tabController.UpdateTabSetting(ObjectID, "WorkflowID", WorkflowID.ToString());
                    if (ReplaceExistingSettings)
                    {
                        //Get All Modules on the current Tab
                        foreach (var kvp in moduleController.GetTabModules(ObjectID))
                        {
                            ClearModuleSettings(kvp.Value);
                        }
                    }
                    break;
                case "Site":
                    PortalController.UpdatePortalSetting(ObjectID, "WorkflowID", WorkflowID.ToString());
                    if (ReplaceExistingSettings)
                    {
                        //Get All Tabs aon the Site
                        foreach (var kvp in tabController.GetTabsByPortal(ObjectID))
                        {
                            tabController.DeleteTabSetting(kvp.Value.TabID, "WorkFlowID");
                        }
                        //Get All Modules in the current Site
                        foreach (ModuleInfo objModule in moduleController.GetModules(ObjectID))
                        {
                            ClearModuleSettings(objModule);
                        }
                    }
                    break;
            }
        }