Ejemplo n.º 1
0
        public bool IsUnderProgress()
        {
            WeeklyLoginConfig config = GetDataByType(ActivityTypeEnum.WEEKLY_LOGIN_REWARD);

            if (null != config && config.StartTime <= DateTime.Now && config.EndTime > DateTime.Now)
            {
                return(true);
            }
            return(false);
        }
Ejemplo n.º 2
0
 public int GetTodayIndex()
 {
     if (IsUnderProgress())
     {
         WeeklyLoginConfig config = GetDataByType(ActivityTypeEnum.WEEKLY_LOGIN_REWARD);
         if (null != config)
         {
             TimeSpan deltaTime = DateTime.Now - config.StartTime;
             return(deltaTime.Days);
         }
     }
     return(-1);
 }
Ejemplo n.º 3
0
        public void GetRewardByDay(out int itemId, out int itemNum)
        {
            itemId  = 0;
            itemNum = 0;
            WeeklyLoginConfig config = GetDataByType(ActivityTypeEnum.WEEKLY_LOGIN_REWARD);

            if (null != config)
            {
                TimeSpan deltaTime = DateTime.Now - config.StartTime;
                int      day       = deltaTime.Days;
                if (config.RewardItemIdList.Count > day && config.RewardItemNumList.Count > day)
                {
                    itemId  = config.RewardItemIdList[day];
                    itemNum = config.RewardItemNumList[day];
                }
            }
        }