public ActionResult Index(string TotalIds = "", string TotalNumber = "", string companyId = "", string branchId = "") { try { string[] itemIds = new JavaScriptSerializer().Deserialize <string[]>(TotalIds); int[] numbers = new JavaScriptSerializer().Deserialize <int[]>(TotalNumber); var datatable = _barcodeService.GenerateBarcodeList(itemIds, numbers, companyId, branchId); ReportDataSource rpt = new ReportDataSource("BarcodeGenerator", datatable); RdlcBarcodeReportViewer.reportDataSource = rpt; string rPath = "RdlcReport/RptBarcodeListForAmericanTMartFinal.rdlc"; Response.Redirect("~/ReportViewer/RdlcBarcodeReportViewer.aspx?rPath=" + rPath); return(View()); } catch (Exception ex) { return(JavaScript($"ShowResult('{ex.Message}','failure')")); } }
public ActionResult Index(string TotalIds = "", string TotalNumber = "") { try { var identity = (LoginIdentity)Thread.CurrentPrincipal.Identity; string[] itemIds = new JavaScriptSerializer().Deserialize <string[]>(TotalIds); int[] numbers = new JavaScriptSerializer().Deserialize <int[]>(TotalNumber); var datatable = _barcodeService.GenerateBarcodeList(itemIds, numbers, identity.CompanyId, identity.BranchId); ReportDataSource rpt = new ReportDataSource("BarcodeGenerator", datatable); RdlcBarcodeReportViewer.reportDataSource = rpt; string rPath = "RdlcReport/RptBarcodeList.rdlc"; Response.Redirect("~/ReportViewer/RdlcBarcodeReportViewer.aspx?rPath=" + rPath); return(View()); } catch (Exception ex) { return(JavaScript($"ShowResult('{ex.Message}','failure')")); } }