public FileResult Download() { var timeSheet = GetTimeSheetOrThrowException(576); var timeSheetModel = ModelConstructor.TimeSheetForDepartment(timeSheet, int.MaxValue, 0, 0, int.MaxValue, 0, 0, false); //var r = new TimeSheetToDbf(timeSheetModel); var r = new TimeSheetToDbf(); //var fileBytes = r.GenerateDbf(timeSheetModel); var fileBytes = r.GenerateDbf(timeSheet); const string fileName = "myfile.dbf"; return(File(fileBytes, System.Net.Mime.MediaTypeNames.Application.Octet, fileName)); }
//===================================================================================================== private TimeSheetModel[] TimeSheetModelConstructor(int id, bool isForPrint) { const int firstPaperEmployeeCount = 7; const int lastPaperEmployeeCount = 6; const int paperEmployeeCount = 9; const int firstNightPaperEmployeeCount = 4; const int lastNightPaperEmployeeCount = 3; const int NightpaperEmployeeCount = 7; var timeSheet = GetTimeSheetOrThrowException(id); var timeSheetModel = ModelConstructor.TimeSheetForDepartment( timeSheet , firstPaperEmployeeCount , lastPaperEmployeeCount , paperEmployeeCount , firstNightPaperEmployeeCount , lastNightPaperEmployeeCount , NightpaperEmployeeCount , isForPrint); return(timeSheetModel); }