public FileResult DownloadAmount(DateTime?month, int?projectId) { if (month == null || projectId == null) { throw new FileNotFoundException(); } var from = (DateTime)month; var to = from.AddMonths(1).AddDays(-1.0); var list = CsvRecord.ConvertToCsvRecord (_context.ReviewTime .Include(rt => rt.Review) .Include(rt => rt.Review.Project) .Include(rt => rt.Review.Version) .Include(rt => rt.Review.Output) .Include(rt => rt.Review.Author) .Include(rt => rt.Member) .Where(rt => rt.Review.Version.Closed == false) .Where(rt => rt.Review.Project.ProjectId == (int)projectId) .OrderBy(rt => rt.Review.Project) .ThenBy(rt => rt.Review.Version) .ThenBy(rt => rt.Review.Output) .ThenBy(rt => rt.Review.Author) .ThenBy(rt => rt.Member) .ThenBy(rt => rt.Date) .Where(rt => rt.Date >= from) .Where(rt => rt.Date <= to) .ToList() ); return(Download(list)); }
public FileResult DownloadIndex() { var list = CsvRecord.ConvertToCsvRecord (_context.ReviewTime .Include(rt => rt.Review) .Include(rt => rt.Review.Project) .Include(rt => rt.Review.Version) .Include(rt => rt.Review.Output) .Include(rt => rt.Review.Author) .Include(rt => rt.Member) .Where(rt => rt.Review.Version.Closed == false) .OrderBy(rt => rt.Review.Project) .ThenBy(rt => rt.Review.Version) .ThenBy(rt => rt.Review.Output) .ThenBy(rt => rt.Review.Author) .ThenBy(rt => rt.Member) .ThenBy(rt => rt.Date) .ToList() ); return(Download(list)); }