Beispiel #1
0
        protected void Cart_Modified(object sender, CommandEventArgs e)
        {
            string[] lCommandArgs = e.CommandArgument.ToString().Split(new char[] { ',' });

            this.Master.Shopping_Cart_Amount = ShoppingCartClass.Add_To_Shopping_Cart(int.Parse(lCommandArgs[0]),
                                                                                      double.Parse(lCommandArgs[1]),
                                                                                      int.Parse(lCommandArgs[2]),
                                                                                      double.Parse(lCommandArgs[3]));
        }
Beispiel #2
0
        protected void Add_To_Cart_Button_Click(object sender, EventArgs e)
        {
            LinkButton lLinkButton = (LinkButton)sender;
            Repeater   lRepeater   = lLinkButton.Parent.FindControl("Product_Price_List") as Repeater;

            for (int lCounter = 0; lCounter < lRepeater.Items.Count; lCounter++)
            {
                DropDownList lQuantity = lRepeater.Items[lCounter].FindControl("Quantity") as DropDownList;
                if (lQuantity.SelectedValue != "0")
                {
                    HiddenField lProduct_Id       = lRepeater.Items[lCounter].FindControl("Product_Id") as HiddenField;
                    HiddenField lMeasurement_Unit = lRepeater.Items[lCounter].FindControl("Measurement_Unit") as HiddenField;
                    HiddenField lPrice            = lRepeater.Items[lCounter].FindControl("Price") as HiddenField;
                    this.Master.Shopping_Cart_Amount = ShoppingCartClass.Add_To_Shopping_Cart(int.Parse(lProduct_Id.Value),
                                                                                              double.Parse(lMeasurement_Unit.Value),
                                                                                              int.Parse(lQuantity.SelectedValue),
                                                                                              double.Parse(lPrice.Value));
                }
            }
            Populate_Products();
        }