public int GetTodaysClosedCases() { DateTime now = DateTime.Now; DateTime start = new DateTime( now.Year, now.Month, now.Day, 0, 0, 0, 0, now.Kind ); DateTime end = new DateTime( now.Year, now.Month, now.Day, 23, 0, 0, 0, now.Kind ); return(caseRepository.GetClosedCountBetweenDates(start, end)); }
public List <int[]> GetDailyClosedCountChartData() { List <int[]> result = new List <int[]>(); DateTime now = DateTime.Now; for (int i = 0; i <= 22; i++) { int[] res = new int[2]; DateTime start = new DateTime( now.Year, now.Month, now.Day, i, 0, 0, 0, now.Kind ); DateTime end = new DateTime( now.Year, now.Month, now.Day, i + 1, 0, 0, 0, now.Kind ); res[0] = (Int32)(start.Subtract(new DateTime(1970, 1, 1))).TotalSeconds; res[1] = caseRepository.GetClosedCountBetweenDates(start, end); result.Add(res); } return(result); }