//public static DataTable AllCompetitionLTDToDay(int PortalID, int pagesize, int pageindex, out int totalrecord)
        //{
        //    DataTable retVal = null;
        //    SqlConnection dbConn = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
        //    SqlCommand dbCmd = new SqlCommand("VNM_Wap_CompetitionToDay_LTD", dbConn);
        //    dbCmd.Parameters.AddWithValue("@PortalID", PortalID);
        //    dbCmd.Parameters.AddWithValue("@PageNumber", pageindex);
        //    dbCmd.Parameters.AddWithValue("@PageSize", pagesize);
        //    dbCmd.Parameters.Add(new SqlParameter("@totalRows", SqlDbType.Int));
        //    dbCmd.Parameters["@totalRows"].Direction = ParameterDirection.Output;
        //    dbCmd.CommandType = CommandType.StoredProcedure;
        //    try
        //    {
        //        retVal = new DataTable();
        //        SqlDataAdapter da = new SqlDataAdapter(dbCmd);
        //        da.Fill(retVal);
        //        totalrecord = ConvertUtility.ToInt32(dbCmd.Parameters["@totalRows"].Value);
        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //    finally
        //    {
        //        dbConn.Close();
        //    }
        //    return retVal;
        //}

        public static DataTable AllCompetitionKQToDayHasCache(int portalID, int pagesize, int pageindex, out int totalrecord)
        {
            DataCaching data            = new DataCaching();
            string      key             = "BongDa.AllCompetitionKQToDay";
            string      param           = "portalID=" + portalID + "&pagesize=" + pagesize.ToString() + "&pageindex=" + pageindex.ToString();
            string      totalRcKey      = "BongDa.AllCompetitionKQToDay_TotalRecord_" + portalID.ToString();
            Object      dataTotalRecord = data.GetHashCache(totalRcKey, portalID);

            if (dataTotalRecord != null)
            {
                totalrecord = (int)dataTotalRecord;
            }
            else
            {
                totalrecord = 0;
            }
            DataTable dtRetval = (DataTable)data.GetHashCache(key, param);

            if (dtRetval != null && dtRetval.Rows.Count > 0)
            {
                return(dtRetval);
            }
            else
            {
                DataTable dtPortals = AllCompetitionKQToDay(portalID, pagesize, pageindex, out totalrecord);
                data.SetHashCache(key, param, GetExpire(), dtPortals);
                data.SetHashCache(totalRcKey, portalID, GetExpire(), totalrecord);
                return(dtPortals);
            }
        }
        public static DataTable GetLastestNewsFromTheThaoSoHasCache(int pageindex, int pagesize, out int totalrecord)
        {
            DataCaching dataCaching = new DataCaching();
            string      param       = Key + "GetLastestNewsFromTheThaoSoHasCache?pageIndex=" + pageindex;
            string      totalRcKey  = "GetLastestNewsFromTheThaoSoHasCache_TotalRecord_" + pageindex;

            var ds = (DataTable)dataCaching.GetHashCache(Key, param);

            if (ds != null)
            {
                Object dataTotalRecord = dataCaching.GetHashCache(totalRcKey, pageindex);
                if (dataTotalRecord != null)
                {
                    totalrecord = (int)dataTotalRecord;
                }
                else
                {
                    totalrecord = 0;
                }
                return(ds);
            }
            ds = GetLastestNewsFromTheThaoSo(pageindex, pagesize, out totalrecord);

            dataCaching.SetHashCache(Key, param, ConvertUtility.ToInt32(AppEnv.GetSetting("news_expired")), ds);
            dataCaching.SetHashCache(totalRcKey, pageindex, ConvertUtility.ToInt32(AppEnv.GetSetting("news_expired")), totalrecord);

            return(ds);
        }
Beispiel #3
0
        //Lay video theo cau hinh va chuyen muc va sap xep theo thu tu
        public static DataTable GetAllVideoByCategoryAndDisplayTypeHasCache(string telCo, int catID, int exceptID, int displayType, int pagesize, int pageindex, out int totalrecord)
        {
            DataCaching data            = new DataCaching();
            string      key             = "W4A_Wap_Video.GetAllVideoByCategoryAndDisplayType";
            string      param           = "telCo=" + telCo + "&Catid=" + catID + "&display=" + displayType + "&cp=" + pageindex + "&pagesize=" + pagesize + "&exceptID=" + exceptID;
            string      totalRcKey      = "VMS_Video.GetAllVideoByCategoryAndDisplayType_TotalRecord_" + displayType + "_" + catID;
            Object      dataTotalRecord = data.GetHashCache(totalRcKey, catID);

            if (dataTotalRecord != null)
            {
                totalrecord = (int)dataTotalRecord;
            }
            else
            {
                totalrecord = 0;
            }
            DataTable dtRetval = (DataTable)data.GetHashCache(key, param);

            if (dtRetval != null && dtRetval.Rows.Count > 0)
            {
                return(dtRetval);
            }
            else
            {
                DataTable dtPortals = GetAllVideoByCategoryAndDisplayType(telCo, catID, exceptID, displayType, pagesize, pageindex, out totalrecord);
                data.SetHashCache(key, param, GetExpire(), dtPortals);
                data.SetHashCache(totalRcKey, catID, GetExpire(), totalrecord);
                return(dtPortals);
            }
        }
Beispiel #4
0
        //Lay video moi nhat
        public static DataTable GetVideoLastestHasCache(string telCo, int pagesize, int pageindex, out int totalrecord)
        {
            DataCaching data            = new DataCaching();
            string      key             = "W4A_Wap_Video.GetVideoLastest";
            string      param           = "telCo=" + telCo + "&cp=" + pageindex;
            string      totalRcKey      = "W4A_Wap_Video.GetVideoLastest_TotalRecord_" + "_" + telCo;
            Object      dataTotalRecord = data.GetHashCache(totalRcKey, telCo);

            if (dataTotalRecord != null)
            {
                totalrecord = (int)dataTotalRecord;
            }
            else
            {
                totalrecord = 0;
            }
            DataTable dtRetval = (DataTable)data.GetHashCache(key, param);

            if (dtRetval != null && dtRetval.Rows.Count > 0)
            {
                return(dtRetval);
            }
            else
            {
                DataTable dtPortals = GetVideoLastest(telCo, pagesize, pageindex, out totalrecord);
                data.SetHashCache(key, param, GetExpire(), dtPortals);
                data.SetHashCache(totalRcKey, telCo, GetExpire(), totalrecord);
                return(dtPortals);
            }
        }
        public static DataTable GetAllNewsByCategoryHasCacheVnm(int catID, int pagesize, int pageindex, out int totalrecord)
        {
            DataCaching data            = new DataCaching();
            string      key             = "VMS_NEWs.GetAllNewsByCategoryHasCacheVnm";
            string      param           = "Catid=" + catID + "&cp=" + pageindex + "&pageSize=" + pagesize;
            string      totalRcKey      = "VMS_NEWs.GetAllNewsByCategory_TotalRecord_" + catID;
            Object      dataTotalRecord = data.GetHashCache(totalRcKey, catID);

            if (dataTotalRecord != null)
            {
                totalrecord = (int)dataTotalRecord;
            }
            else
            {
                totalrecord = 0;
            }
            DataTable dtRetval = (DataTable)data.GetHashCache(key, param);

            if (dtRetval != null && dtRetval.Rows.Count > 0)
            {
                return(dtRetval);
            }
            else
            {
                DataTable dtPortals = GetAllNewsByCategoryVnm(catID, pagesize, pageindex, out totalrecord);
                data.SetHashCache(key, param, GetExpire(), dtPortals);
                data.SetHashCache(totalRcKey, catID, GetExpire(), totalrecord);
                return(dtPortals);
            }
        }
Beispiel #6
0
        public static DataTable GetItemWithPagingHasCache(string telCo, int PageIndex, int PageSize, out int totalrecord)
        {
            DataCaching data            = new DataCaching();
            string      key             = "W4A_Music_Item.GetItemWithPagingHasCache";
            string      param           = "telCo=" + telCo + "&PageIndex=" + PageIndex + "&PageSize=" + PageSize;
            string      totalRcKey      = "W4A_Music_Item.GetItemWithPagingHasCache_TotalRecord_" + telCo;
            Object      dataTotalRecord = data.GetHashCache(totalRcKey, "itemall");

            if (dataTotalRecord != null)
            {
                totalrecord = (int)dataTotalRecord;
            }
            else
            {
                totalrecord = 0;
            }
            DataTable dtRetval = (DataTable)data.GetHashCache(key, param);

            if (dtRetval != null && dtRetval.Rows.Count > 0)
            {
                return(dtRetval);
            }
            else
            {
                DataTable dtPortals = GetItemWithPaging(telCo, PageIndex, PageSize, out totalrecord);
                data.SetHashCache(key, param, GetExpire(), dtPortals);
                data.SetHashCache(totalRcKey, "itemall", GetExpire(), totalrecord);
                return(dtPortals);
            }
        }
Beispiel #7
0
        //
        //Music Item
        public static DataTable GetItemByAlbumWithPagingHasCache(int albumID, string telCo, int PageIndex, int PageSize, out int totalrecord)
        {
            DataCaching data            = new DataCaching();
            string      key             = "W4A_Music_AlbumItem.GetItemByAlbumWithPagingHasCache";
            string      param           = "telCo=" + telCo + "&albumID=" + albumID + "&PageIndex=" + PageIndex + "&PageSize=" + PageSize;
            string      totalRcKey      = "W4A_Wap_Game.GetItemByCategoryAndDisplayType_TotalRecord_" + telCo + "_" + albumID;
            Object      dataTotalRecord = data.GetHashCache(totalRcKey, albumID);

            if (dataTotalRecord != null)
            {
                totalrecord = (int)dataTotalRecord;
            }
            else
            {
                totalrecord = 0;
            }
            DataTable dtRetval = (DataTable)data.GetHashCache(key, param);

            if (dtRetval != null && dtRetval.Rows.Count > 0)
            {
                return(dtRetval);
            }
            else
            {
                DataTable dtPortals = GetItemByAlbumWithPaging(albumID, telCo, PageIndex, PageSize, out totalrecord);
                data.SetHashCache(key, param, GetExpire(), dtPortals);
                data.SetHashCache(totalRcKey, albumID, GetExpire(), totalrecord);
                return(dtPortals);
            }
        }
Beispiel #8
0
        public static DataTable GetStyleHasCache(int pageindex, int pagesize, out int totalrecord)
        {
            DataCaching data            = new DataCaching();
            string      key             = "W4A_Music_Style.GetStyle";
            string      param           = "pageindex=" + pageindex + "pagesize=" + pagesize;
            string      totalRcKey      = "W4A_Music_Style.GetStyle_TotalRecord_";
            Object      dataTotalRecord = data.GetHashCache(totalRcKey, "all");

            if (dataTotalRecord != null)
            {
                totalrecord = (int)dataTotalRecord;
            }
            else
            {
                totalrecord = 0;
            }
            DataTable dtRetval = (DataTable)data.GetHashCache(key, param);

            if (dtRetval != null && dtRetval.Rows.Count > 0)
            {
                return(dtRetval);
            }
            else
            {
                DataTable dtPortals = GetStyle(pageindex, pagesize, out totalrecord);
                data.SetHashCache(key, param, GetExpire(), dtPortals);
                data.SetHashCache(totalRcKey, "all", GetExpire(), totalrecord);
                return(dtPortals);
            }
        }
        //Lay ringtone theo cau hinh va chuyen muc va sap xep theo thu tu
        public static DataTable VNM_GetAllRingToneByCategoryAndDisplayTypeHasCache(int catID, int displayType, int pagesize, int pageindex, out int totalrecord)
        {
            DataCaching data            = new DataCaching();
            string      key             = "VNM_RingTone.GetAllRingToneByCategoryAndDisplayType";
            string      param           = "Catid=" + catID + "&display=" + displayType + "&cp=" + pageindex;
            string      totalRcKey      = "VNM_RingTone.GetAllRingToneByCategoryAndDisplayType_TotalRecord_" + displayType + "_" + catID;
            Object      dataTotalRecord = data.GetHashCache(totalRcKey, catID);

            if (dataTotalRecord != null)
            {
                totalrecord = (int)dataTotalRecord;
            }
            else
            {
                totalrecord = 0;
            }
            DataTable dtRetval = (DataTable)data.GetHashCache(key, param);

            if (dtRetval != null && dtRetval.Rows.Count > 0)
            {
                return(dtRetval);
            }
            else
            {
                DataTable dtPortals = VNM_GetAllRingToneByCategoryAndDisplayType(catID, displayType, pagesize, pageindex, out totalrecord);
                data.SetHashCache(key, param, GetExpire(), dtPortals);
                data.SetHashCache(totalRcKey, catID, GetExpire(), totalrecord);
                return(dtPortals);
            }
        }
Beispiel #10
0
        //
        public static DataTable GetItemByStyleHasCache(string telCo, string styleID, int pageindex, int pagesize, out int totalrecord)
        {
            DataCaching data            = new DataCaching();
            string      key             = "W4A_Music_Style.GetItemByStyle";
            string      param           = "pageindex=" + pageindex + "&pagesize=" + pagesize + "&telCo=" + telCo + "&styleID=" + styleID;
            string      totalRcKey      = "W4A_Music_Artist.GetItemByArtist_TotalRecord_";
            Object      dataTotalRecord = data.GetHashCache(totalRcKey, telCo + styleID);

            if (dataTotalRecord != null)
            {
                totalrecord = (int)dataTotalRecord;
            }
            else
            {
                totalrecord = 0;
            }
            DataTable dtRetval = (DataTable)data.GetHashCache(key, param);

            if (dtRetval != null && dtRetval.Rows.Count > 0)
            {
                return(dtRetval);
            }
            else
            {
                DataTable dtPortals = GetItemByStyle(telCo, styleID, pageindex, pagesize, out totalrecord);
                data.SetHashCache(key, param, GetExpire(), dtPortals);
                data.SetHashCache(totalRcKey, telCo + styleID, GetExpire(), totalrecord);
                return(dtPortals);
            }
        }
Beispiel #11
0
        //Album
        public static DataTable GetAlbumHasCache(string telCo, int pageindex, int pagesize, out int totalrecord)
        {
            DataCaching data            = new DataCaching();
            string      key             = "W4A_Music_Album.GetAlbum";
            string      param           = "pageindex=" + pageindex + "pagesize=" + pagesize + "telCo=" + telCo;
            string      totalRcKey      = "W4A_Music_Album.GetAlbum_TotalRecord_";
            Object      dataTotalRecord = data.GetHashCache(totalRcKey, telCo);

            if (dataTotalRecord != null)
            {
                totalrecord = (int)dataTotalRecord;
            }
            else
            {
                totalrecord = 0;
            }
            DataTable dtRetval = (DataTable)data.GetHashCache(key, param);

            if (dtRetval != null && dtRetval.Rows.Count > 0)
            {
                return(dtRetval);
            }
            else
            {
                DataTable dtPortals = GetAlbum(telCo, pageindex, pagesize, out totalrecord);
                data.SetHashCache(key, param, GetExpire(), dtPortals);
                data.SetHashCache(totalRcKey, telCo, GetExpire(), totalrecord);
                return(dtPortals);
            }
        }
        //Kiểm tra sự tồn tại của Partner
        public static Boolean Partner_CheckExist(int partnerID)
        {
            DataCaching data     = new DataCaching();
            string      key      = "Partner_GetInfo";
            string      param    = "partnerID=" + partnerID;
            DataTable   dtRetval = (DataTable)data.GetHashCache(key, param);

            if (dtRetval != null)
            {
                if (dtRetval.Rows.Count > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                dtRetval = Partner_GetInfo(partnerID);
                data.SetHashCache(key, param, GetExpire(), dtRetval);
                if (dtRetval.Rows.Count > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
        }
 public static DataTable GetModuleControls(int moduleId)
 {
     string param = "GetModuleControls?moduleId=" + moduleId;
     DataCaching data = new DataCaching();
     DataTable dtModuleControls = (DataTable)data.GetHashCache(key, param);
     if (dtModuleControls != null) return dtModuleControls;
     dtModuleControls = DataAccessProvider.Instance().GetModuleControls(moduleId);
     data.SetHashCache(key, param, AppEnv.GetTimeCacheExpire(), dtModuleControls);
     return dtModuleControls;
 }
 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;
 }
 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;
 }
 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;
 }
        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);
        }
Beispiel #18
0
        public static PositionInfo GetInfoByPosition(string position, string channel)
        {
            var          dataCaching = new DataCaching();
            const string cacheKey    = "WapAdvertisePositions.GetInfoByPosition";
            var          retVal      = (PositionInfo)dataCaching.GetHashCache(cacheKey, position + "_" + channel);

            if (retVal == null)
            {
                retVal = PositionDB.GetInfoByPosition(position, channel);
                dataCaching.SetHashCache(cacheKey, position + "_" + channel, GetExpire(), retVal);
            }
            return(retVal);
        }
Beispiel #19
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);
        }
        public static DataSet GetNewsDetailHasCache(int id)
        {
            DataCaching dataCaching = new DataCaching();
            string      param       = Key + "GetNewsDetailHasCache?id=" + id;
            var         ds          = (DataSet)dataCaching.GetHashCache(Key, param);

            if (ds != null)
            {
                return(ds);
            }
            ds = GetNewsDetail(id);
            dataCaching.SetHashCache(Key, param, ConvertUtility.ToInt32(AppEnv.GetSetting("news_expired")), ds);
            return(ds);
        }
        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);
        }
Beispiel #22
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);
        }
Beispiel #23
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);
        }
Beispiel #24
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);
        }
Beispiel #25
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);
        }
Beispiel #26
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);
        }
Beispiel #27
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);
        }
        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 GetHomeNewsHasCache()
        {
            DataCaching dataCaching = new DataCaching();
            string      param       = Key + "GetHomeNews_TheThao";
            var         ds          = (DataTable)dataCaching.GetHashCache(Key, param);

            if (ds != null)
            {
                return(ds);
            }
            ds = GetHomeNews();
            dataCaching.SetHashCache(Key, param, ConvertUtility.ToInt32(AppEnv.GetSetting("news_expired")), ds);
            return(ds);
        }
Beispiel #30
0
        public static DataTable GetByParentID(int _parentID)
        {
            DataCaching dataCaching = new DataCaching();
            string      _cacheKey   = "Main.Cmds_GetByParentID";

            DataTable _retVal = (DataTable)dataCaching.GetHashCache(_cacheKey, _parentID);

            if (_retVal == null)
            {
                _retVal = CmdDB.GetByParentID(_parentID);
                dataCaching.SetHashCache(_cacheKey, _parentID, 0, _retVal);
            }
            return(_retVal);
        }
Beispiel #31
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);
        }
Beispiel #32
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);
        }
Beispiel #33
0
        //Lay thong tin Video
        public static DataTable KhoClipGetTopCache()
        {
            DataCaching data     = new DataCaching();
            string      key      = "W4A_Wap_Video.KhoClipGetTopCache";
            string      param    = "KhoClipGetTopCache";
            DataTable   dtRetval = (DataTable)data.GetHashCache(key, param);

            if (dtRetval != null && dtRetval.Rows.Count > 0)
            {
                return(dtRetval);
            }
            DataTable dtPortals = KhoClipGetTop();

            data.SetHashCache(key, param, GetExpire(), dtPortals);
            return(dtPortals);
        }
Beispiel #34
0
        public static DataSet KhoClipGetListCache(int pageSize, int currPage)
        {
            var    data     = new DataCaching();
            string key      = "W4A_Wap_Video.KhoClipGetListCache";
            string param    = "KhoClipGetListCache&cuPage=" + currPage;
            var    dtRetval = (DataSet)data.GetHashCache(key, param);

            if (dtRetval != null && dtRetval.Tables.Count > 0)
            {
                return(dtRetval);
            }

            DataSet dtPortals = KhoClipGetList(pageSize, currPage);

            data.SetHashCache(key, param, GetExpire(), dtPortals);
            return(dtPortals);
        }
        public static DataSet WebGetNewsInfoCache(int id)
        {
            var    data     = new DataCaching();
            string key      = "VMS_NEWs.WebGetNewsInfoCache";
            string param    = "WebGetNewsInfoCache&id=" + id;
            var    dtRetval = (DataSet)data.GetHashCache(key, param);

            if (dtRetval != null && dtRetval.Tables.Count > 0)
            {
                return(dtRetval);
            }

            DataSet dtPortals = WebGetNewsInfo(id);

            data.SetHashCache(key, param, GetExpire(), 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;
 }
 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;
 }
 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;
 }
 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 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;
 }