public bool PackPrint() { try { CustPackPrintBLL cpBLL = new CustPackPrintBLL(config.TempPath); cpBLL.GetStagedPackList(config.AppUser); return(true); } catch (Exception ex) { Console.WriteLine(ex.Message); return(false); } }
public ActionResult PrintPackData(List <string> lodList) { lodList = lodList.Distinct().ToList(); if (lodList == null || lodList.Count == 0) { return(Json(new RequestResult(false, "No selected Data"))); } try { string appUser = Session[CHubConstValues.SessionUser].ToString(); //List<PackPageData> pageDatas = new List<PackPageData>(); //foreach (var id in idList) //{ // PackPageData page = new PackPageData(); // V_RP_PACK_H_PRINT_BLL hBLL = new V_RP_PACK_H_PRINT_BLL(); // var header = hBLL.GetPackHeader(id); // V_RP_PACK_D_PRINT_BLL dBLL = new V_RP_PACK_D_PRINT_BLL(); // var detail = dBLL.GetPackDetails(id); // page.Header = header; // page.Details = detail; // pageDatas.Add(page); //} //if(pageDatas.Count==0) // return Json(new RequestResult(false,"No Page Data")); string basePath = Server.MapPath(CHubConstValues.ChubTempFolder); CustPackPrintBLL printBLL = new CustPackPrintBLL(basePath); string fileName = printBLL.PrintPackData(lodList, appUser); string webPath = "/temp/" + fileName; return(Json(new RequestResult(webPath))); } catch (Exception ex) { LogHelper.WriteLog("GetPackList", ex); return(Json(new RequestResult(false, ex.Message))); } }