public ActionResult BLR010_Invoice(string invoiceNo)
        {
            try
            {
                IBillingDocumentHandler handlerBillingDocument = ServiceContainer.GetService <IBillingDocumentHandler>() as IBillingDocumentHandler;

                //// Mothed #1: Directly generate
                //List<dtRptInvoice> rptList = handlerBillingDocument.GetRptInvoice("201205A00121", MiscType.C_SHOW_DUEDATE, ShowDueDate.C_SHOW_DUEDATE_7, ShowDueDate.C_SHOW_DUEDATE_30);

                //// Update value
                //foreach (var item in rptList)
                //{
                //    item.RPT_InvoicePaper = InvoiceDocument.C_INVOICE_DOC_ORIGINAL_CUST_EN + "\n" + InvoiceDocument.C_INVOICE_DOC_ORIGINAL_CUST_TH;
                //}


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

                //rptH.Load(path);


                //rptH.SetDataSource(rptList);
                //rptH.SetParameterValue("C_PAYMENT_METHOD_BANK_TRANSFER", PaymentMethodType.C_PAYMENT_METHOD_BANK_TRANSFER);

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

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



                // Mothed #2: Official generate
                Stream stream2 = handlerBillingDocument.GenerateBLR010(invoiceNo, CommonUtil.dsTransData.dtUserData.EmpNo, DateTime.Now);

                return(File(stream2, "application/pdf"));


                ////Test by Jutarat A.
                //for (int i = 0; i < 300; i++)
                //{
                //    handlerBillingDocument.GenerateBLR010FilePath("201210A00001", "490430", DateTime.Now);

                //    handlerBillingDocument.GenerateBLR020FilePath("201210B00001", "490430", DateTime.Now);
                //}

                //return null;
                ////End Test
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }