Example #1
0
        public static ModuleControlInfo GetModuleControl(int moduleControlID)
        {
            ModuleControlInfo moduleControl = null;
            Dictionary <int, ModuleControlInfo> moduleControls = GetModuleControls();

            if (!moduleControls.TryGetValue(moduleControlID, out moduleControl))
            {
                moduleControl = CBO.FillObject <ModuleControlInfo>(dataProvider.GetModuleControl(moduleControlID));
            }
            return(moduleControl);
        }
Example #2
0
        public static ModuleControlInfo GetModuleControlByControlKey(string controlKey, int moduleDefId)
        {
            ModuleControlInfo moduleControl = null;

            foreach (KeyValuePair <int, ModuleControlInfo> kvp in GetModuleControls())
            {
                if (kvp.Value.ModuleDefID == moduleDefId && kvp.Value.ControlKey.ToLowerInvariant() == controlKey.ToLowerInvariant())
                {
                    moduleControl = kvp.Value;
                    break;
                }
            }
            if (moduleControl == null)
            {
                moduleControl = CBO.FillObject <ModuleControlInfo>(dataProvider.GetModuleControlsByKey(controlKey, moduleDefId));
            }
            return(moduleControl);
        }
Example #3
0
        public static int SaveModuleControl(ModuleControlInfo moduleControl, bool clearCache)
        {
            int moduleControlID = moduleControl.ModuleControlID;

            if (moduleControlID == Null.NullInteger)
            {
                moduleControlID = dataProvider.AddModuleControl(moduleControl.ModuleDefID, moduleControl.ControlKey, moduleControl.ControlTitle, moduleControl.ControlSrc, moduleControl.IconFile, Convert.ToInt32(moduleControl.ControlType), moduleControl.ViewOrder, moduleControl.HelpURL, moduleControl.SupportsPartialRendering, UserController.GetCurrentUserInfo().UserID);
            }
            else
            {
                dataProvider.UpdateModuleControl(moduleControl.ModuleControlID, moduleControl.ModuleDefID, moduleControl.ControlKey, moduleControl.ControlTitle, moduleControl.ControlSrc, moduleControl.IconFile, Convert.ToInt32(moduleControl.ControlType), moduleControl.ViewOrder, moduleControl.HelpURL, moduleControl.SupportsPartialRendering,
                                                 UserController.GetCurrentUserInfo().UserID);
            }
            if (clearCache)
            {
                DataCache.ClearHostCache(true);
            }
            return(moduleControlID);
        }
Example #4
0
 public static void AddModuleControl(ModuleControlInfo objModuleControl)
 {
     SaveModuleControl(objModuleControl, true);
 }