Exemplo n.º 1
0
        public bool InActivityTime()
        {
            JieriActivityConfig config = HuodongCachingMgr.GetJieriActivityConfig();
            bool result;

            if (null == config)
            {
                result = false;
            }
            else if (!config.InList(41))
            {
                result = false;
            }
            else
            {
                JieRiMultAwardActivity activity = HuodongCachingMgr.GetJieRiMultAwardActivity();
                if (null == activity)
                {
                    result = false;
                }
                else if (!activity.InActivityTime())
                {
                    result = false;
                }
                else
                {
                    DateTime startTime = DateTime.Parse(this.StartDate);
                    DateTime endTime   = DateTime.Parse(this.EndDate);
                    result = (TimeUtil.NowDateTime() >= startTime && TimeUtil.NowDateTime() <= endTime);
                }
            }
            return(result);
        }
Exemplo n.º 2
0
        public virtual bool InActivityTime()
        {
            if (this.IsHeFuActivity(this.ActivityType))
            {
                HeFuActivityConfig config = HuodongCachingMgr.GetHeFuActivityConfing();
                if (null == config)
                {
                    return(false);
                }
                if (!config.InList(this.ActivityType))
                {
                    return(false);
                }
            }
            if (this.IsJieRiActivity(this.ActivityType))
            {
                JieriActivityConfig config2 = HuodongCachingMgr.GetJieriActivityConfig();
                if (null == config2)
                {
                    return(false);
                }
                if (!config2.InList(this.ActivityType))
                {
                    return(false);
                }
            }
            if (this.IsThemeActivity(this.ActivityType))
            {
                ThemeActivityConfig config3 = HuodongCachingMgr.GetThemeActivityConfig();
                if (config3 == null || config3.ActivityOpenVavle <= 0)
                {
                    return(false);
                }
                if (!config3.InList(this.ActivityType))
                {
                    return(false);
                }
                int endData = config3.GetEndData(this.ActivityType);
                if (endData > 0 && TimeUtil.NowDateTime() > Global.GetKaiFuTime().AddDays((double)endData))
                {
                    return(false);
                }
            }
            bool result;

            if (string.IsNullOrEmpty(this.FromDate) || string.IsNullOrEmpty(this.ToDate))
            {
                result = false;
            }
            else
            {
                DateTime startTime = DateTime.Parse(this.FromDate);
                DateTime endTime   = DateTime.Parse(this.ToDate);
                result = (TimeUtil.NowDateTime() >= startTime && TimeUtil.NowDateTime() <= endTime);
            }
            return(result);
        }