Пример #1
0
        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));
        }
Пример #2
0
        //=====================================================================================================
        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);
        }