示例#1
0
        private void LinkbuttonCart_Click(object sender, System.EventArgs e)
        {
            ShoppinAction action = new ShoppinAction(Context);

            action.ShowShoppingCart();
            this.CurrentController.NextView = action.NextViewToDisplay;
        }
示例#2
0
        private void LinkButtonAddToCart_Click(object sender, CommandEventArgs e)
        {
            ShoppinAction action = new ShoppinAction(Context);

            action.AddItemToCart(e.CommandArgument.ToString());
            this.CurrentController.NextView = action.NextViewToDisplay;
        }
示例#3
0
        private void LinkbuttonProceedCheckout_Click(object sender, System.EventArgs e)
        {
            ShoppinAction action = new ShoppinAction(this.Context);

            action.ProceedCheckout();
            this.CurrentController.NextView = action.NextViewToDisplay;
        }
示例#4
0
 protected void RepeaterItem_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e)
 {
     if (e.CommandName == "ShowItem")
     {
         CatalogAction action = new CatalogAction(Context);
         action.ShowItem(e.CommandArgument.ToString());
         this.CurrentController.NextView = action.NextViewToDisplay;
     }
     else if (e.CommandName == "AddToCart")
     {
         ShoppinAction action = new ShoppinAction(Context);
         action.AddItemToCart(e.CommandArgument.ToString());
         this.CurrentController.NextView = action.NextViewToDisplay;
     }
 }
示例#5
0
        protected void QuantityChanged(object o, System.EventArgs e)
        {
            Page.Validate();
            if (Page.IsValid)
            {
                TextBox    textboxQuantity  = o as System.Web.UI.WebControls.TextBox;
                LinkButton linkButtonRemove = textboxQuantity.Parent.FindControl("LinkButtonRemove") as LinkButton;

                int    quantity = int.Parse(textboxQuantity.Text);
                string itemId   = linkButtonRemove.CommandArgument.ToString();

                ShoppinAction action = new ShoppinAction(this.Context);
                action.UpdateQuantityByItemId(itemId, quantity);
            }
        }
示例#6
0
 protected void RepeaterCart_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e)
 {
     if (e.CommandName == "RemoveItem")
     {
         ShoppinAction action = new ShoppinAction(this.Context);
         action.RemoveItemFromCart(e.CommandArgument.ToString());
         this.CurrentController.NextView = action.NextViewToDisplay;
     }
     else if (e.CommandName == "Update")
     {
         this.CurrentController.NextView = WebViews.CART;
     }
     else if (e.CommandName == "ShowItem")
     {
         CatalogAction action = new CatalogAction(this.Context);
         action.ShowItem(e.CommandArgument.ToString());
         this.CurrentController.NextView = action.NextViewToDisplay;
     }
 }