Пример #1
0
    private void BindData()
    {
        TimeOfDay _th = new TimeOfDay(this.ConnectionString);
        gv_Themes.DataSource = _th.GetTimeOfDays(Enums.enumStatuses.Active);
        gv_Themes.DataBind();

        TimeOfDayCollection<TimeOfDay> _coll = new TimeOfDayCollection<TimeOfDay>(this.ConnectionString);

        _coll.AddRange(_th.GetTimeOfDays(Enums.enumStatuses.Inactive));
        _coll.AddRange(_th.GetTimeOfDays(Enums.enumStatuses.Pending));

        gv_ThemesNotActive.DataSource = _coll;
        gv_ThemesNotActive.DataBind();

        PortalCacheFactory.RefreshTimeOfDay();
    }
Пример #2
0
    /// <summary>
    /// Refresh TimeOfDay
    /// </summary>
    public static void RefreshTimeOfDay()
    {
        CacheManager _cf = CacheFactory.GetCacheManager();
        TimeOfDay _time = new TimeOfDay(ConnectionString);
        TimeOfDayCollection<TimeOfDay> _coll = _time.GetTimeOfDays(Enums.enumStatuses.Active);

        _cf.Add(TIMEOFDAY_CATEGORY_KEY, _coll, CacheItemPriority.Normal, null,
            new SlidingTime(TimeSpan.FromHours(Convert.ToInt32(ConfigurationManager.AppSettings["DefaultCacheingHours"]))));
    }