日期:2014-05-17 浏览次数:20763 次
public static double AvgFromDB(int id, DateTime time, int userID)
{
DateTime startTime = DateTime.Parse( time.Year.ToString() + "-" + time.Month.ToString() + "-01 00:00:00");
string sqlString = "select average from HourAssessmentMonthScore where ownerId ='" + id + "'and workgroup = '" + userID + "' and date = '" + startTime + "'";
string returnValue = runSQL(sqlString);
if (returnValue == null || returnValue.Length==0)
//throw new Exception("error no data!");
return Convert.ToDouble(0);
else
return Convert.ToDouble(returnValue);
}