public ActionResult ISR080_GetRptIECheckSheetData(string strMaintenanceNo, string strSubcontractorCode)
        {
            strMaintenanceNo     = "5020N20110030";
            strSubcontractorCode = "00002";
            IReportHandler           reportHandler = ServiceContainer.GetService <IReportHandler>() as IReportHandler;
            List <RPTIECheckSheetDo> rptList       = reportHandler.GetRptIECheckSheetData(strMaintenanceNo, strSubcontractorCode);

            IDocumentHandler            dochandler = ServiceContainer.GetService <IDocumentHandler>() as IDocumentHandler;
            List <tbm_DocumentTemplate> dLst       = dochandler.GetDocumentTemplateByDocumentCode(DocumentCode.C_DOCUMENT_CODE_IE_CHECK_SHEET);

            ReportDocument rptH = new ReportDocument();

            string path = ReportUtil.GetReportPath("Reports/ISR080_IECheckSheet.rpt", Server.MapPath("/"));

            rptH.Load(path);

            List <RPTIECheckSheetDo> lst = new List <RPTIECheckSheetDo>();

            lst.Add(rptList[0]);

            if (dLst.Count > 0)
            {
                lst[0].DocumentNameEN  = dLst[0].DocumentNameEN;
                lst[0].DocumentVersion = dLst[0].DocumentVersion;
            }

            rptH.SetDataSource(lst);

            Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

            rptH.Close();

            return(File(stream, "application/pdf"));
        }
        public ActionResult ISR010_GetNewInstallationSlip(string strSlipNo)
        {
            IReportHandler            reportHandler = ServiceContainer.GetService <IReportHandler>() as IReportHandler;
            List <RPTNewRentalSlipDo> rptList       = reportHandler.GetRptNewRentalSlipReport(strSlipNo);

            IDocumentHandler            dochandler = ServiceContainer.GetService <IDocumentHandler>() as IDocumentHandler;
            List <tbm_DocumentTemplate> dLst       = dochandler.GetDocumentTemplateByDocumentCode(DocumentCode.C_DOCUMENT_CODE_NEW_INSTALL_SLIP_RENTAL);

            ReportDocument rptH = new ReportDocument();
            //string path = ReportUtil.GetReportTemplatePath("ISR010_NewInstallationSlip.rpt");
            string path = ReportUtil.GetReportPath("Reports/ISR010_NewInstallationSlip.rpt", Server.MapPath("/"));

            rptH.Load(path);

            List <RPTNewRentalSlipDo> lst = new List <RPTNewRentalSlipDo>();

            if (rptList != null && rptList.Count > 0)
            {
                lst.Add(rptList[0]);

                if (dLst.Count > 0)
                {
                    lst[0].DocumentNameEN  = dLst[0].DocumentNameEN;
                    lst[0].DocumentVersion = dLst[0].DocumentVersion;
                }
            }
            else
            {
                rptList.Add(new RPTNewRentalSlipDo());
            }

            rptH.SetDataSource(lst);
            rptH.Subreports["Page1"].SetDataSource(rptList);
            rptH.Subreports["Page2"].SetDataSource(rptList);
            rptH.Subreports["Page3"].SetDataSource(rptList);

            Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

            rptH.Close();

            return(File(stream, "application/pdf"));
        }
        public ActionResult ISR090_GetRptInstallCompleteConfirmData(string strSlipNo)
        {
            strSlipNo = "401029201112043";

            IReportHandler reportHandler        = ServiceContainer.GetService <IReportHandler>() as IReportHandler;
            List <RPTInstallCompleteDo> rptList = reportHandler.GetRptInstallCompleteConfirmData(strSlipNo);

            IDocumentHandler            dochandler = ServiceContainer.GetService <IDocumentHandler>() as IDocumentHandler;
            List <tbm_DocumentTemplate> dLst       = dochandler.GetDocumentTemplateByDocumentCode(DocumentCode.C_DOCUMENT_CODE_INSTALL_COMPLETE_CONFIRM);

            ReportDocument rptH = new ReportDocument();

            string path = ReportUtil.GetReportPath("Reports/ISR090_InstallCompleteConfirmData.rpt", Server.MapPath("/"));

            rptH.Load(path);

            List <RPTInstallCompleteDo> lst = new List <RPTInstallCompleteDo>();
            int i = 0;

            foreach (RPTInstallCompleteDo rptDataRow in rptList)
            {
                lst.Add(rptDataRow);
                if (dLst.Count > 0)
                {
                    lst[i].DocumentNameEN  = dLst[0].DocumentNameEN;
                    lst[i].DocumentVersion = dLst[0].DocumentVersion;
                }
                i++;
            }

            rptH.SetDataSource(lst);
            rptH.SetParameterValue("C_RENTAL_INSTALL_TYPE_REMOVE_ALL", RentalInstallationType.C_RENTAL_INSTALL_TYPE_REMOVE_ALL);
            rptH.SetParameterValue("C_SALE_INSTALL_TYPE_REMOVE_ALL", SaleInstallationType.C_SALE_INSTALL_TYPE_REMOVE_ALL);


            Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

            rptH.Close();

            return(File(stream, "application/pdf"));
        }
        public ActionResult ISR100_GetRptAcceptanceInspectionNotice(string strMaintenanceNo, string strSubcontractorCode)
        {
            strMaintenanceNo     = "5020N20110030";
            strSubcontractorCode = "00002";
            IReportHandler           reportHandler = ServiceContainer.GetService <IReportHandler>() as IReportHandler;
            List <RPTAcceptInspecDo> rptList       = reportHandler.GetRptAcceptInspecNocticeData(strMaintenanceNo, strSubcontractorCode);

            IDocumentHandler            dochandler = ServiceContainer.GetService <IDocumentHandler>() as IDocumentHandler;
            List <tbm_DocumentTemplate> dLst       = dochandler.GetDocumentTemplateByDocumentCode(DocumentCode.C_DOCUMENT_CODE_ACCEPT_INSPECT_NOTICE);

            ReportDocument rptH = new ReportDocument();

            string path = ReportUtil.GetReportPath("Reports/ISR100_AcceptanceInspectionNotice.rpt", Server.MapPath("/"));

            rptH.Load(path);

            List <RPTAcceptInspecDo> lst = new List <RPTAcceptInspecDo>();
            int i = 0;

            foreach (RPTAcceptInspecDo rptDataRow in rptList)
            {
                lst.Add(rptDataRow);
                if (dLst.Count > 0)
                {
                    lst[i].DocumentNameEN  = dLst[0].DocumentNameEN;
                    lst[i].DocumentVersion = dLst[0].DocumentVersion;
                }
                i++;
            }
            rptH.SetDataSource(lst);

            Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

            rptH.Close();

            return(File(stream, "application/pdf"));
        }