protected void DeleteItemBtn_Click(object sender, EventArgs e) { LinkButton cmdBtn = (LinkButton)sender; int shoppingcartitemid = int.Parse(cmdBtn.CommandArgument); MessageUserControl.TryRun(() => { SalesController sysmgr = new SalesController(); sysmgr.DeleteItem(User.Identity.Name, shoppingcartitemid); ShoppingCartListView.DataBind(); ShoppingCartTotal(); DisplayCurrentCartQty(); if (!CheckForItemsInCart()) { checkoutButton.HRef = "~/Sales/PartsCatalog.aspx"; } }, "Removal Successful", "Item has been removed from your cart."); }
protected void UpdateQty_Click(object sender, EventArgs e) { LinkButton cmdBtn = (LinkButton)sender; string direction = cmdBtn.CommandArgument.ToString(); int partid = int.Parse((cmdBtn.Parent.FindControl("ProductIdLabel") as Label).Text); MessageUserControl.TryRun(() => { SalesController sysmgr = new SalesController(); sysmgr.UpdateItem(User.Identity.Name, partid, direction); ShoppingCartListView.DataBind(); ShoppingCartTotal(); DisplayCurrentCartQty(); if (!CheckForItemsInCart()) { checkoutButton.HRef = "~/Sales/PartsCatalog.aspx"; } }, "Quantity Updated", "Part Quantity has been updated"); }