Пример #1
0
        public List <WishItem> UpdateWishItems()
        {
            using (WishlistCartActions usersWishlistCart = new WishlistCartActions())
            {
                String wishId = usersWishlistCart.GetWishId();
                WishlistCartActions.WishlistUpdates[] wishUpdates = new WishlistCartActions.WishlistUpdates[WishList.Rows.Count];
                for (int i = 0; i < WishList.Rows.Count; i++)
                {
                    IOrderedDictionary rowValues = new OrderedDictionary();
                    rowValues = GetValues(WishList.Rows[i]);
                    wishUpdates[i].ProductId = Convert.ToInt32(rowValues["ProductID"]);

                    CheckBox cbRemove = new CheckBox();
                    cbRemove = (CheckBox)WishList.Rows[i].FindControl("Remove");
                    wishUpdates[i].RemoveItem = cbRemove.Checked;

                    TextBox quantityTextBox = new TextBox();
                    quantityTextBox             = (TextBox)WishList.Rows[i].FindControl("WishQuantity");
                    wishUpdates[i].WishQuantity = Convert.ToInt16(quantityTextBox.Text.ToString());
                }
                usersWishlistCart.UpdateWishlistCartDatabase(wishId, wishUpdates);
                WishList.DataBind();
                lblTotal.Text = String.Format("{0:c}", usersWishlistCart.GetTotal());
                return(usersWishlistCart.GetWishItems());
            }
        }
Пример #2
0
        public List <WishItem> GetWishlistItems()
        {
            WishlistCartActions actions = new WishlistCartActions();

            return(actions.GetWishItems());
        }