case "本周内":
DateTime retStartDay = DateTime.Now.Date.AddDays(-(int)(DateTime.Now.DayOfWeek) + 1 );
DateTime retEndDay = DateTime.Now.Date.AddDays(7 - (int)(DateTime.Now.DayOfWeek)).AddDays(1);
sbSqlDate.Append("JoinDate >= '" + retStartDay + "' and JoinDate<= '" + retEndDay + "'");
break;
case "本月内":
DateTime monthStart = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
DateTime monthEnd = new DateTime(DateTime.Now.Year, DateTime.Now.Month+1,1).AddDays(-1);
sbSqlDate.Append("JoinDate >= '" + monthStart + "' and JoinDate<= '" + monthEnd + "'");
break;
case "本年内":
DateTime yearStart = new DateTime(DateTime.Now.Date.Year, 1, 1);
DateTime yearEnd = new DateTime(DateTime.Now.Date.Year+1, 1,1).AddDays(-1);
sbSqlDate.Append("JoinDate >= '" + yearStart + "' and JoinDate<= '" + yearEnd + "'");
break;
List<Radio> radList = radGrop.CheckedItems;
foreach (Radio item in radList)
{
switch (item.BoxLabel)
{
case "不记得":
break;
case "昨天": sbSqlDate.Append("CreateDate >='" + new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day).AddDays(-1) + "' and CreateDate<'" + new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day) + "'");
break;
case "今天": sbSqlDate.Append("CreateDate='" + DateTime.Now.Date + "'");
break;
case "以前7天内": sbSqlDate.Append("CreateDate >= '" + DateTime.Now.AddDays(-7) + "' and CreateDate<= '" + DateTime.Now + "'");
break;
case "以前30天内": sbSqlDate.Append("CreateDate >= '" + DateTime.Now.AddDays(-30) + "' and CreateDate <='" + DateTime.Now + "'");
break;
case "本周内":
DateTime retStartDay = DateTime.Now.Date.AddDays(-(int)(DateTime.Now.DayOfWeek) + 1);
DateTime retEndDay = DateTime.Now.Date.AddDays(7 - (int)(DateTime.Now.DayOfWeek)).AddDays(1);
sbSqlDate.Append("CreateDate >= '" + retStartDay + "' and CreateDate<= '" + retEndDay + "'");
break;
case "本月内":
DateTime monthStart = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
DateTime monthEnd = new DateTime(DateTime.Now.Year, DateTime.Now.Month + 1, 1).AddDays(-1);
sbSqlDate.Append("CreateDate >= '" + monthStart + "' and CreateDate<= '" + monthEnd + "'");
break;
case "本年内":
DateTime yearStart = new DateTime(DateTime.Now.Date.Year, 1, 1);
DateTime yearEnd = new DateTime(DateTime.Now.Date.Year + 1, 1, 1).AddDays(-1);
sbSqlDate.Append("CreateDate >= '" + yearStart + "' and CreateDate<= '" + yearEnd + "'");
break;
case "指定日期": sbSqlDate.Append("CreateDate >= '" + dfStateDate.Text.Trim() + "' and CreateDate <='" + (dfEndDate.Text.Trim() == "0001-1-1 0:00:00" ? DateTime.Now.ToString() : dfEndDate.Text.Trim()) + "'");
break;
}
}