예제 #1
0
        public async Task <IActionResult> ExportDevDtrFgtResultReport(SDevDtrFgtResultReport sDevDtrFgtResultReport)
        {
            _logger.LogInformation(String.Format(@"****** DTRController ExportDevDtrFgtResultReport fired!! ******"));
            if (String.IsNullOrEmpty(sDevDtrFgtResultReport.cwaDateS))
            {
                sDevDtrFgtResultReport.cwaDateS = _config.GetSection("LogicSettings:MinDate").Value;
            }
            if (String.IsNullOrEmpty(sDevDtrFgtResultReport.cwaDateE))
            {
                sDevDtrFgtResultReport.cwaDateE = _config.GetSection("LogicSettings:MaxDate").Value;
            }
            sDevDtrFgtResultReport.cwaDateS = sDevDtrFgtResultReport.cwaDateS.Replace("-", "/");
            sDevDtrFgtResultReport.cwaDateE = sDevDtrFgtResultReport.cwaDateE.Replace("-", "/");
            var data = await _dKSDAO.GetDevDtrFgtResultReportDto(sDevDtrFgtResultReport);

            byte[] result = new byte[] { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 };
            if (sDevDtrFgtResultReport.reportType == "Dev")
            {              //DEV
                result = _excelService.CommonExportReport(data, "TempDevDtrFgtResultReport_Dev.xlsx");
            }
            else if (sDevDtrFgtResultReport.reportType == "Buy Plan")
            {
                result = _excelService.CommonExportReport(data, "TempDevDtrFgtResultReport_BuyPlan.xlsx");
            }

            return(File(result, "application/xlsx"));
        }
예제 #2
0
        public IActionResult ExportPlmPart(SDevPlmPart sDevPlmPart)
        {
            _logger.LogInformation(String.Format(@"****** PlmController ExportPlmPart fired!! ******"));

            var data = _devPlmPartDAO.FindAll();

            if (!String.IsNullOrEmpty(sDevPlmPart.partno))
            {
                data = data.Where(x => x.PARTNO == sDevPlmPart.partno.Trim());
            }
            if (!String.IsNullOrEmpty(sDevPlmPart.location))
            {
                data = data.Where(x => x.LOCATION.Contains(sDevPlmPart.location.Trim()));
            }
            if (!String.IsNullOrEmpty(sDevPlmPart.partnameen))
            {
                data = data.Where(x => x.PARTNAMEEN.Contains(sDevPlmPart.partnameen.Trim()));
            }
            if (!String.IsNullOrEmpty(sDevPlmPart.partnamecn))
            {
                data = data.Where(x => x.PARTNAMECN.Contains(sDevPlmPart.partnamecn.Trim()));
            }
            data = data.OrderBy(x => x.PARTNO);

            byte[] result = _excelService.CommonExportReport(data.ToList(), "TempPlmPart.xlsx");

            return(File(result, "application/xlsx"));
        }
예제 #3
0
        public IActionResult ExportMaterialNoBySampleNoForWarehouse(SF428SampleNoDetail sF428SampleNoDetail)
        {
            _logger.LogInformation(String.Format(@"****** WareHouseController ExportMaterialNoBySampleNoForWarehouse fired!! ******"));

            // query data from database
            var data = _warehouseDao.GetMaterialNoBySampleNoForWarehouse(sF428SampleNoDetail);

            byte[] result = _excelService.CommonExportReport(data, "TempF428.xlsx");

            return(File(result, "application/xlsx"));
        }
예제 #4
0
        public async Task <IActionResult> ExportF340_Process(SF340Schedule sF340Schedule)
        {
            _logger.LogInformation(String.Format(@"****** DKSController ExportF340_Process fired!! ******"));
            if (sF340Schedule.cwaDateS == "" || sF340Schedule.cwaDateS == null)
            {
                sF340Schedule.cwaDateS = _config.GetSection("LogicSettings:MinDate").Value;
            }
            if (sF340Schedule.cwaDateE == "" || sF340Schedule.cwaDateE == null)
            {
                sF340Schedule.cwaDateE = _config.GetSection("LogicSettings:MaxDate").Value;
            }
            sF340Schedule.cwaDateS = sF340Schedule.cwaDateS.Replace("-", "/");
            sF340Schedule.cwaDateE = sF340Schedule.cwaDateE.Replace("-", "/");
            // query data from database
            var data = await _dksDao.GetF340ProcessView(sF340Schedule);

            byte[] result = _excelService.CommonExportReport(data, "TempF340Process.xlsx");

            return(File(result, "application/xlsx"));
        }