private void LinkbuttonCart_Click(object sender, System.EventArgs e) { ShoppinAction action = new ShoppinAction(Context); action.ShowShoppingCart(); this.CurrentController.NextView = action.NextViewToDisplay; }
private void LinkButtonAddToCart_Click(object sender, CommandEventArgs e) { ShoppinAction action = new ShoppinAction(Context); action.AddItemToCart(e.CommandArgument.ToString()); this.CurrentController.NextView = action.NextViewToDisplay; }
private void LinkbuttonProceedCheckout_Click(object sender, System.EventArgs e) { ShoppinAction action = new ShoppinAction(this.Context); action.ProceedCheckout(); this.CurrentController.NextView = action.NextViewToDisplay; }
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 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); } }
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; } }