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; } }
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; } }