Exemplo n.º 1
0
 public static string AddToCart(int productID, double webPrice)
 {
     CartBL cartBL = new CartBL();
     cartBL.AddProductToCart(productID, System.Web.HttpContext.Current.Session["cartID"].ToString(), 1, webPrice, webPrice);
     return JsonConvert.SerializeObject((cartBL.GetProductsCount(System.Web.HttpContext.Current.Session["cartID"].ToString()).ToString() + "|" + string.Format("{0:N2}", cartBL.GetTotal(System.Web.HttpContext.Current.Session["cartID"].ToString()))).Split('|'));
 }
Exemplo n.º 2
0
 protected void btnCart_Click(object sender, EventArgs e)
 {
     CartBL cartBL = new CartBL();
     cartBL.AddProductToCart(lblProductID.Value.Contains(',') ? int.Parse(lblProductID.Value.Substring(0, lblProductID.Value.IndexOf(','))) : int.Parse(lblProductID.Value), Session["cartID"].ToString(), 1, double.Parse(lblWebPrice.Text), double.Parse(lblWebPrice.Text));
     //Response.Redirect("/korpa");
 }