Exemplo n.º 1
0
        public ActionResult CTR080_QuotationForCancelContractMemorandum(int iDocID)
        {
            IContractDocumentHandler contractDocHandler = ServiceContainer.GetService <IContractDocumentHandler>() as IContractDocumentHandler;

            List <RPTCancelContractMemoDo>       rptList       = contractDocHandler.GetRptCancelContractMemoData(iDocID);
            List <RPTCancelContractMemoDetailDo> rptListDetail = contractDocHandler.GetRptCancelContractMemoDetail(iDocID);

            bool isShowDefaultData = false;

            if (rptListDetail == null || rptListDetail.Count == 0)
            {
                rptListDetail     = GetDefaultCancelContractMemoDetailData();
                isShowDefaultData = true;
            }

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

            //string path = ReportUtil.GetReportTemplatePath("CTR080_QuotationForCancelContractMemorandum.rpt");

            rptH.Load(path);
            rptH.SetDataSource(rptList);
            rptH.Subreports["CTR080_1"].SetDataSource(rptListDetail);

            rptH.SetParameterValue("ShowDefaultData", isShowDefaultData, "CTR080_1");

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

            rptH.Close();

            return(File(stream, "application/pdf"));
        }
Exemplo n.º 2
0
        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"));
        }
Exemplo n.º 3
0
        public ActionResult CTR020_ChangeNotice(int iDocID)
        {
            try
            {
                IContractDocumentHandler contractDocHandler = ServiceContainer.GetService <IContractDocumentHandler>() as IContractDocumentHandler;
                List <RPTChangeNoticeDo> rptList            = contractDocHandler.GetRptChangeNoticeData(iDocID);

                IDocumentHandler documentHandler = ServiceContainer.GetService <IDocumentHandler>() as IDocumentHandler;

                //doDocumentDataGenerate doDoc = new doDocumentDataGenerate();
                //if (rptList.Count > 0)
                //{
                //    doDoc.DocumentNo = rptList[0].DocNo;
                //    doDoc.DocumentCode = rptList[0].DocumentCode;
                //    doDoc.DocumentData = rptList;
                //}

                //Stream stream = documentHandler.GenerateDocument(doDoc);

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

                ReportDocument rptH = new ReportDocument();
                rptH.Load(path);
                rptH.SetDataSource(rptList);
                Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
                rptH.Close();

                return(File(stream, "application/pdf"));
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Exemplo n.º 4
0
        public ActionResult CMR010_IssueList()
        {
            try
            {
                ICommonHandler CommonHandler = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;

                List <dtIssueListData> rptList = CommonHandler.GetTmpIssueListData();


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

                rptH.Load(path);


                rptH.SetDataSource(rptList);
                //rptH.Subreports["CTR060_1"].SetDataSource(rptListDetail);

                //rptH.SetParameterValue("AutoBillingTypeNone", AutoTransferBillingType.C_AUTO_TRANSFER_BILLING_TYPE_NONE, "CTR060_1");
                //rptH.SetParameterValue("AutoBillingTypeAll", AutoTransferBillingType.C_AUTO_TRANSFER_BILLING_TYPE_ALL, "CTR060_1");
                //rptH.SetParameterValue("AutoBillingTypePartial", AutoTransferBillingType.C_AUTO_TRANSFER_BILLING_TYPE_PARTIAL, "CTR060_1");
                //rptH.SetParameterValue("BankBillingTypeNone", BankTransferBillingType.C_BANK_TRANSFER_BILLING_TYPE_NONE, "CTR060_1");
                //rptH.SetParameterValue("BankBillingTypeAll", BankTransferBillingType.C_BANK_TRANSFER_BILLING_TYPE_ALL, "CTR060_1");
                //rptH.SetParameterValue("BankBillingTypePartial", BankTransferBillingType.C_BANK_TRANSFER_BILLING_TYPE_PARTIAL, "CTR060_1");
                Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
                rptH.Close();
                return(File(stream, "application/pdf"));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 5
0
        public ActionResult CTR090_CoverLetter(int iDocID)
        {
            try
            {
                IContractDocumentHandler contractDocHandler = ServiceContainer.GetService <IContractDocumentHandler>() as IContractDocumentHandler;

                List <RPTCoverLetterDo>      rptListCover = contractDocHandler.GetRptCoverLetterData(iDocID);
                List <RPTInstrumentDetailDo> rptListInst  = contractDocHandler.GetRptInstrumentDetailData(iDocID);

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

                rptH.Load(path);
                rptH.SetDataSource(rptListCover);
                rptH.Subreports["CTR090_1"].SetDataSource(rptListInst);
                rptH.Subreports["CTR090_2"].SetDataSource(rptListInst);
                rptH.Subreports["CTR090_3"].SetDataSource(rptListInst);

                rptH.SetParameterValue("FlagOn", FlagType.C_FLAG_ON);
                rptH.SetParameterValue("ShowInstrument", (rptListInst != null && rptListInst.Count > 0));
                Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
                rptH.Close();


                //IDocumentHandler documentHandler = ServiceContainer.GetService<IDocumentHandler>() as IDocumentHandler;
                //doDocumentDataGenerate doDoc = new doDocumentDataGenerate();
                //if (rptListCover.Count > 0)
                //{
                //    rptListCover[0].DocumentCode = "CTR090";
                //    doDoc.DocumentNo = rptListCover[0].DocNo;
                //    doDoc.DocumentCode = rptListCover[0].DocumentCode;
                //    doDoc.DocumentData = rptListCover;
                //}

                //List<ReportParameterObject> listSubReportDataSource = new List<ReportParameterObject>();
                //listSubReportDataSource.Add(new ReportParameterObject() { SubReportName = "CTR090_1", Value = rptListInst });
                //listSubReportDataSource.Add(new ReportParameterObject() { SubReportName = "CTR090_2", Value = rptListInst });
                //listSubReportDataSource.Add(new ReportParameterObject() { SubReportName = "CTR090_3", Value = rptListInst });

                //doDoc.SubReportDataSource = listSubReportDataSource;

                //List<ReportParameterObject> listMainReportParam = new List<ReportParameterObject>();
                //listMainReportParam.Add(new ReportParameterObject() { ParameterName = "FlagOn", Value = FlagType.C_FLAG_ON });
                //doDoc.MainReportParam = listMainReportParam;
                //doDoc.SubReportParam = null;

                //Stream stream = documentHandler.GenerateDocument(doDoc);


                return(File(stream, "application/pdf"));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 6
0
        public ActionResult CTR070_ChangeFeeMemorandum(int iDocID)
        {
            IContractDocumentHandler  contractDocHandler = ServiceContainer.GetService <IContractDocumentHandler>() as IContractDocumentHandler;
            List <RPTChangeFeeMemoDo> rptList            = contractDocHandler.GetRptChangeFeeMemoData(iDocID);

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

            //string path = ReportUtil.GetReportTemplatePath("CTR070_ChangeFeeMemorandum.rpt");

            rptH.Load(path);
            rptH.SetDataSource(rptList);

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

            rptH.Close();

            return(File(stream, "application/pdf"));
        }
Exemplo n.º 7
0
        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"));
        }
Exemplo n.º 8
0
        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"));
        }
Exemplo n.º 9
0
        public ActionResult CTR011_ContractThai(int iDocID)
        {
            IContractDocumentHandler   contractDocHandler = ServiceContainer.GetService <IContractDocumentHandler>() as IContractDocumentHandler;
            List <RPTContractReportDo> rptList            = contractDocHandler.GetRptContractReportData(iDocID);

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

            //string path = ReportUtil.GetReportTemplatePath("CTR011_ContractThai.rpt");

            rptH.Load(path);
            rptH.SetDataSource(rptList);

            rptH.Subreports["CTR011_1"].SetDataSource(rptList);
            rptH.SetParameterValue("FlagOn", FlagType.C_FLAG_ON, "CTR011_1");

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

            rptH.Close();

            return(File(stream, "application/pdf"));
        }
Exemplo n.º 10
0
        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"));
        }
Exemplo n.º 11
0
        public ActionResult CTR060_CancelContractMemorandum(int iDocID)
        {
            try
            {
                IContractDocumentHandler contractDocHandler = ServiceContainer.GetService <IContractDocumentHandler>() as IContractDocumentHandler;

                List <RPTCancelContractMemoDo>       rptList       = contractDocHandler.GetRptCancelContractMemoData(iDocID);
                List <RPTCancelContractMemoDetailDo> rptListDetail = contractDocHandler.GetRptCancelContractMemoDetail(iDocID);

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

                rptH.Load(path);


                rptH.SetDataSource(rptList);
                rptH.Subreports["CTR060_1"].SetDataSource(rptListDetail);

                rptH.SetParameterValue("AutoBillingTypeNone", AutoTransferBillingType.C_AUTO_TRANSFER_BILLING_TYPE_NONE, "CTR060_1");
                rptH.SetParameterValue("AutoBillingTypeAll", AutoTransferBillingType.C_AUTO_TRANSFER_BILLING_TYPE_ALL, "CTR060_1");
                rptH.SetParameterValue("AutoBillingTypePartial", AutoTransferBillingType.C_AUTO_TRANSFER_BILLING_TYPE_PARTIAL, "CTR060_1");
                rptH.SetParameterValue("BankBillingTypeNone", BankTransferBillingType.C_BANK_TRANSFER_BILLING_TYPE_NONE, "CTR060_1");
                rptH.SetParameterValue("BankBillingTypeAll", BankTransferBillingType.C_BANK_TRANSFER_BILLING_TYPE_ALL, "CTR060_1");
                rptH.SetParameterValue("BankBillingTypePartial", BankTransferBillingType.C_BANK_TRANSFER_BILLING_TYPE_PARTIAL, "CTR060_1");

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

                //IDocumentHandler documentHandler = ServiceContainer.GetService<IDocumentHandler>() as IDocumentHandler;
                //doDocumentDataGenerate doDoc = new doDocumentDataGenerate();
                //if (rptList.Count > 0)
                //{
                //    doDoc.DocumentNo = rptList[0].DocNo;
                //    doDoc.DocumentCode = rptList[0].DocumentCode;
                //    doDoc.DocumentData = rptList;
                //}

                //List<ReportParameterObject> listSubReportDataSource = new List<ReportParameterObject>();
                //listSubReportDataSource.Add(new ReportParameterObject() { SubReportName = "CTR060_1", Value = rptListDetail });
                //doDoc.SubReportDataSource = listSubReportDataSource;

                //doDoc.MainReportParam = null;

                //List<ReportParameterObject> listSubReportParam = new List<ReportParameterObject>();
                //listSubReportParam.Add(new ReportParameterObject() { ParameterName = "AutoBillingTypeNone", Value = AutoTransferBillingType.C_AUTO_TRANSFER_BILLING_TYPE_NONE, SubReportName = "CTR060_1" });
                //listSubReportParam.Add(new ReportParameterObject() { ParameterName = "AutoBillingTypeAll", Value = AutoTransferBillingType.C_AUTO_TRANSFER_BILLING_TYPE_ALL, SubReportName = "CTR060_1" });
                //listSubReportParam.Add(new ReportParameterObject() { ParameterName = "AutoBillingTypePartial", Value = AutoTransferBillingType.C_AUTO_TRANSFER_BILLING_TYPE_PARTIAL, SubReportName = "CTR060_1" });
                //listSubReportParam.Add(new ReportParameterObject() { ParameterName = "BankBillingTypeNone", Value = BankTransferBillingType.C_BANK_TRANSFER_BILLING_TYPE_NONE, SubReportName = "CTR060_1" });
                //listSubReportParam.Add(new ReportParameterObject() { ParameterName = "BankBillingTypeAll", Value = BankTransferBillingType.C_BANK_TRANSFER_BILLING_TYPE_ALL, SubReportName = "CTR060_1" });
                //listSubReportParam.Add(new ReportParameterObject() { ParameterName = "BankBillingTypePartial", Value = BankTransferBillingType.C_BANK_TRANSFER_BILLING_TYPE_PARTIAL, SubReportName = "CTR060_1" });


                //doDoc.SubReportParam = listSubReportParam;


                //// doDoc2

                //List<RPTCoverLetterDo> rptListCover = contractDocHandler.GetRptCoverLetterData(100); // iDocID = 100 , fixed to 100 for test
                //List<RPTInstrumentDetailDo> rptListInst = contractDocHandler.GetRptInstrumentDetailData(100); // iDocID = 100 , fixed to 100 for test

                //doDocumentDataGenerate doDoc2 = new doDocumentDataGenerate();
                //if (rptListCover.Count > 0)
                //{
                //    rptListCover[0].DocumentCode = "CTR090";
                //    doDoc2.DocumentNo = rptListCover[0].DocNo;
                //    doDoc2.DocumentCode = rptListCover[0].DocumentCode;
                //    doDoc2.DocumentData = rptListCover;
                //}

                //List<ReportParameterObject> listSubReportDataSource2 = new List<ReportParameterObject>();
                //listSubReportDataSource2.Add(new ReportParameterObject() { SubReportName = "CTR090_1", Value = rptListInst });
                //listSubReportDataSource2.Add(new ReportParameterObject() { SubReportName = "CTR090_2", Value = rptListInst });
                //listSubReportDataSource2.Add(new ReportParameterObject() { SubReportName = "CTR090_3", Value = rptListInst });

                //doDoc2.SubReportDataSource = listSubReportDataSource2;

                //List<ReportParameterObject> listMainReportParam2 = new List<ReportParameterObject>();
                //listMainReportParam2.Add(new ReportParameterObject() { ParameterName = "FlagOn", Value = FlagType.C_FLAG_ON });
                //doDoc2.MainReportParam = listMainReportParam2;
                //doDoc2.SubReportParam = null;


                //Stream stream = documentHandler.GenerateDocument(doDoc, doDoc2);

                return(File(stream, "application/pdf"));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }