private List <OrderItem> getItems() { CartBL cartBL = new CartBL(); DataTable cartItems = cartBL.GetProducts(Session["cartID"].ToString()); List <OrderItem> items = new List <OrderItem>(); for (int i = 0; i < cartItems.Rows.Count; i++) { items.Add(new OrderItem(-1, -1, new ProductBL().GetProduct(int.Parse(cartItems.Rows[i]["productID"].ToString()), string.Empty, false, string.Empty), double.Parse(cartItems.Rows[i]["productPrice"].ToString()), double.Parse(cartItems.Rows[i]["userPrice"].ToString()), double.Parse(cartItems.Rows[i]["quantity"].ToString()))); } return(items); }
public void LoadCart() { CartBL cartBL = new CartBL(); dgvCart.DataSource = cartBL.GetProducts(Session["cartID"].ToString()); dgvCart.DataBind(); ViewState.Add("discount", cartBL.GetCartDiscount(Session["cartID"].ToString())); calculateCart(); if (dgvCart.Rows.Count == 0) { lblStatus.Text = "Nemate proizvoda u korpi"; lblStatus.Visible = true; } }
private void loadCheckout() { CartBL cartBL = new CartBL(); checkoutInfo1.CartItems = cartBL.GetProducts(Session["cartID"].ToString()); }