public static DataTable GetPortalsByLang(string _lang)
        {
            string      param     = "GetPortalsByLang" + _lang;
            DataCaching data      = new DataCaching();
            DataTable   dtPortals = (DataTable)data.GetHashCache(key, param);

            if (dtPortals != null)
            {
                return(dtPortals);
            }
            dtPortals = DataAccessProvider.Instance().GetPortalsByLang(_lang);
            data.SetHashCache(key, param, AppEnv.GetTimeCacheExpire(), dtPortals);
            return(dtPortals);
        }
        public static DataTable GetPortalsByParentId(int userId, int portal_ParentId)
        {
            string      param = "GetPortalsByParentId?userid=" + userId + "&portalId=" + portal_ParentId.ToString() + "&" + AppEnv.GetLanguage();
            DataCaching data  = new DataCaching();
            DataTable   dt    = (DataTable)data.GetHashCache(key, param);

            if (dt != null)
            {
                return(dt);
            }
            dt = DataAccessProvider.Instance().GetPortalsByParentId(userId, portal_ParentId);
            data.SetHashCache(key, param, AppEnv.GetTimeCacheExpire(), dt);
            return(dt);
        }
Exemple #3
0
        public static DataTable GetCommandsForUserNotGroup(int userId, int portalId)
        {
            string      param      = "GetCommandsForUserNotGroup?" + userId.ToString() + "&portalid=" + portalId;
            DataCaching data       = new DataCaching();
            DataTable   dtCommands = (DataTable)data.GetHashCache(key, param);

            if (dtCommands != null)
            {
                return(dtCommands);
            }
            dtCommands = DataAccessProvider.Instance().GetCommandsForUserNotGroup(userId, portalId);
            data.SetHashCache(key, param, AppEnv.GetTimeCacheExpire(), dtCommands);
            return(dtCommands);
        }
Exemple #4
0
        public static PhongBanInfo GetInfoCache(int _id)
        {
            string       param     = "PhongBanInfo_" + _id;
            DataCaching  data      = new DataCaching();
            PhongBanInfo infoPhong = (PhongBanInfo)data.GetHashCache(key, param);

            if (infoPhong != null)
            {
                return(infoPhong);
            }
            infoPhong = DataAccessProvider.Instance().GetInfoPhong(_id);
            data.SetHashCache(key, param, AppEnv.GetTimeCacheExpire(), infoPhong);
            return(infoPhong);
        }
Exemple #5
0
        public static CommandInfo GetCommand(string commandKey)
        {
            string      param        = "GetCommand?key" + commandKey;
            DataCaching data         = new DataCaching();
            CommandInfo _CommandInfo = (CommandInfo)data.GetHashCache(key, param);

            if (_CommandInfo != null)
            {
                return(_CommandInfo);
            }
            _CommandInfo = DataAccessProvider.Instance().GetCommand(commandKey);
            data.SetHashCache(key, param, AppEnv.GetTimeCacheExpire(), _CommandInfo);
            return(_CommandInfo);
        }
Exemple #6
0
        public static DataTable GetModuleControls()
        {
            string      param            = "GetModuleControls";
            DataCaching data             = new DataCaching();
            DataTable   dtModuleControls = (DataTable)data.GetHashCache(key, param);

            if (dtModuleControls != null)
            {
                return(dtModuleControls);
            }
            dtModuleControls = DataAccessProvider.Instance().GetModuleControls();
            data.SetHashCache(key, param, AppEnv.GetTimeCacheExpire(), dtModuleControls);
            return(dtModuleControls);
        }
Exemple #7
0
        public static DataTable GetModuleControls(int tabId, string position)
        {
            string      param            = "GetModuleControls?tabId=" + tabId.ToString() + "&position=" + position;
            DataCaching data             = new DataCaching();
            DataTable   dtModuleControls = (DataTable)data.GetHashCache(key, param);

            if (dtModuleControls != null)
            {
                return(dtModuleControls);
            }
            dtModuleControls = DataAccessProvider.Instance().GetModuleControls(tabId, position);
            data.SetHashCache(key, param, AppEnv.GetTimeCacheExpire(), dtModuleControls);
            return(dtModuleControls);
        }
Exemple #8
0
        public static ModuleSetting GetModuleSettings(int moduleId)
        {
            string        param   = "GetModuleSettings?moduleId=" + moduleId.ToString();
            DataCaching   data    = new DataCaching();
            ModuleSetting setting = (ModuleSetting)data.GetHashCache(key, param);

            if (setting != null)
            {
                return(setting);
            }
            setting = DataAccessProvider.Instance().GetModuleSettings(moduleId);
            data.SetHashCache(key, param, AppEnv.GetTimeCacheExpire(), setting);
            return(setting);
        }
Exemple #9
0
        public static ModuleControlInfo GetModuleControl(string controlKey)
        {
            string            param   = "GetModuleControl?controlKey=" + controlKey.ToString();
            DataCaching       data    = new DataCaching();
            ModuleControlInfo setting = (ModuleControlInfo)data.GetHashCache(key, param);

            if (setting != null)
            {
                return(setting);
            }
            setting = DataAccessProvider.Instance().GetModuleControl(controlKey);
            data.SetHashCache(key, param, AppEnv.GetTimeCacheExpire(), setting);
            return(setting);
        }
Exemple #10
0
        public static ModuleSetting GetModuleSettings(int moduleId)
        {
            const string  key     = "VmgPortal.Portal.ModuleControl.GetModuleSettings";
            string        param   = moduleId.ToString();
            DataCaching   data    = new DataCaching();
            ModuleSetting setting = (ModuleSetting)data.GetHashCache(key, param);

            if (setting != null)
            {
                return(setting);
            }
            setting = DataAccessProvider.Instance().GetModuleSettings(moduleId);
            data.SetHashCache(key, param, AppEnv.GetTimeCacheExpire(), setting);
            return(setting);
        }
Exemple #11
0
        public static DataTable GetCommandByCmdId(int commandid)
        {
            string      param      = "GetCommandByCmdId_" + commandid;
            DataCaching data       = new DataCaching();
            DataTable   dtCommands = (DataTable)data.GetHashCache(key, param);

            if (dtCommands != null)
            {
                return(dtCommands);
            }
            dtCommands = DataAccessProvider.Instance().GetCommandByCmdId(commandid);
            data.SetHashCache(key, param, AppEnv.GetTimeCacheExpire(), dtCommands);
            return(dtCommands);

            //return DataAccessProvider.Instance().GetCommandByCmdId(commandid);
        }