Пример #1
0
        protected bool CompletePlan(string user_id, string day)
        {
            BLL.UserReadLog          userReadLog = new BLL.UserReadLog();
            List <Model.UserReadLog> list        = userReadLog.List("[user_id]='" + user_id + "' and [read_date]='" + day + "' and [read_count] < [plan_read_count]");

            if (list == null)
            {
                return(true);
            }
            if (list.Count == 0)
            {
                return(true);
            }
            return(false);
        }
Пример #2
0
 /// <summary>
 /// 重写虚方法,此方法将在Init事件前执行
 /// </summary>
 protected override void InitPage()
 {
     day = DTRequest.GetQueryString("day");
     if (string.IsNullOrEmpty(day))
     {
         day = DateTime.Now.ToString("yyyyMMdd");
     }
     pre1_year_month = TypeConverter.ObjectToDateTime(day.Substring(0, 4) + "/" + day.Substring(4, 2) + "/" + day.Substring(6, 2)).AddMonths(-1).ToString("yyyyMM");
     pre2_year_month = TypeConverter.ObjectToDateTime(day.Substring(0, 4) + "/" + day.Substring(4, 2) + "/" + day.Substring(6, 2)).AddMonths(-2).ToString("yyyyMM");
     aft1_year_month = TypeConverter.ObjectToDateTime(day.Substring(0, 4) + "/" + day.Substring(4, 2) + "/" + day.Substring(6, 2)).AddMonths(1).ToString("yyyyMM");
     aft2_year_month = TypeConverter.ObjectToDateTime(day.Substring(0, 4) + "/" + day.Substring(4, 2) + "/" + day.Substring(6, 2)).AddMonths(2).ToString("yyyyMM");
     BLL.UserReadLog userReadLog = new BLL.UserReadLog();
     list = new List <Model.UserReadLog>();
     list.AddRange(userReadLog.List("[user_id]='" + GetUserInfo().id + "' and [read_date] ='" + day + "'"));
     year  = int.Parse(day.ToString().Substring(0, 4));
     month = day.ToString().Substring(4, 2);
     date  = day.ToString().Substring(6, 2);
     for (int d = 1; d <= DateTime.DaysInMonth(year, int.Parse(month)); d++)
     {
         daysInMonth.Add(d < 10 ? ("0" + d.ToString()) : d.ToString());
     }
 }