/// <summary> /// Returns user Cart IDs based on product type /// </summary> /// <returns></returns> public static List <int> GetCartsByUserID(int userID, ProductType type, int?campaignID) { try { return(CartPDFHelper.GetLoggedInUserCartData(Convert.ToInt32(type), userID, campaignID).AsEnumerable().Select(x => x.Field <int>("ShoppingCartID")).Distinct().ToList()); } catch (Exception ex) { EventLogProvider.LogInformation("ShoppingCartHelper", "CreateOrdersDTO", ex.Message); return(null); } }
/// <summary> /// button click event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lnkGeneratePDF_Click(object sender, EventArgs e) { try { DataTable distributorCartData = CartPDFHelper.GetLoggedInUserCartData(InventoryType, CurrentUser.UserID, OpenCampaign?.CampaignID); var pdfBytes = CartPDFHelper.CreateProductPDF(distributorCartData, InventoryType); CartPDFHelper.WriteresponseToPDF(pdfBytes); } catch (Exception ex) { EventLogProvider.LogInformation("GeneratePDFforCart", "lnkGeneratePDF_Click", ex.Message); } }