public DataTable GetSource(int level) { DataTable dt = new DataTable(); SqlHelper her = new SqlHelper(); string sql = string.Empty; switch (level) { case 3: sql = @"select a.*,b.levelName from ML_Member a left join ML_MemberLevel b on a.fxslevel=b.nID where datediff(day,a.fxsTimeBegin,getdate()-1)>=0 and a.fxslevel=3 or datediff(day,a.fxsTimeEnd,getdate())=0 and a.fxslevel=4 or datediff(day,a.level3Time,getdate())=0 and a.fxslevel=5 order by a.fxsTimeBegin desc"; break; case 4: sql = @"select a.*,b.levelName from ML_Member a left join ML_MemberLevel b on a.fxslevel=b.nID where datediff(day,a.fxsTimeEnd,getdate()-1)>=0 and a.fxslevel=4 or datediff(day,a.level3Time,getdate())=0 and a.fxslevel=5 order by a.fxsTimeBegin desc"; break; case 5: sql = @" select a.*,b.levelName from ML_Member a left join ML_MemberLevel b on a.fxslevel=b.nID where datediff(day,a.level3Time,getdate()-1)>=0 and a.fxslevel=5 order by a.level3Time desc"; break; default: break; } if (!string.IsNullOrEmpty(sql)) { dt = her.ExecuteDataTable(sql); userCount = dt.Rows.Count.ToString(); yingyee = StringDelHTML.PriceToStringLow(tj.AllMoneyToday()); } return(dt); }