public ProceedOrderBAL() { this.cartBal = new CartBAL(); this.accountBal = new AccountBAL(); this.orderBal = new OrderBAL(); this.bookBal = new BookBAL(); }
protected void btnCart_Click(object sender, EventArgs e) { InsertProductDetails(); CartBAL balCart = new CartBAL(); CartENT entCart = new CartENT(); if (Session["UserID"] != null) { entCart.UserID = Convert.ToInt32(Session["UserID"]); } if (tempProductDetailsID != 0) { entCart.ProductDetailsID = tempProductDetailsID; } if (balCart.Insert(entCart)) { lblMessage.Text = "Add to Cart SuccessFullly"; divMessage.Visible = true; hlMessage.Text = "View Cart"; hlMessage.NavigateUrl = ("~/User/Cart.aspx"); hlMessage.Visible = true; } else { lblMessage.Text = balCart.Message; divMessage.Visible = true; } }
public void FillProductDetailsGridView() { DataTable dtCartDetails = new DataTable(); CartBAL balCartDetails = new CartBAL(); dtCartDetails = balCartDetails.SelectALL(Convert.ToInt32(Session["UserID"])); if (dtCartDetails != null && dtCartDetails.Rows.Count > 0) { gvCartDetails.DataSource = dtCartDetails; gvCartDetails.DataBind(); } GrandTotal(); }
private void FillRepeatorCart() { DataTable dtCartDetails = new DataTable(); CartBAL balCartDetails = new CartBAL(); dtCartDetails = balCartDetails.SelectALL(Convert.ToInt32(Session["UserID"])); if (dtCartDetails != null && dtCartDetails.Rows.Count > 0) { rptCheckout.DataSource = dtCartDetails; rptCheckout.DataBind(); } GrandTotal(); }
protected void gvProductDetails_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Remove") { if (e.CommandArgument != null) { ProductDetailsBAL balProductDetails = new ProductDetailsBAL(); if (balProductDetails.Delete(Convert.ToInt32(e.CommandArgument.ToString().Trim()), Convert.ToInt32(Session["UserID"]))) { FillProductDetailsGridView(); } else { lblMessage.Text = balProductDetails.Message; divMessage.Visible = true; } } } else if (e.CommandName == "AddtoCart") { if (e.CommandArgument != null) { CartBAL balCart = new CartBAL(); CartENT entCart = new CartENT(); if (Session["UserID"] != null) { entCart.UserID = Convert.ToInt32(Session["UserID"]); } if (e.CommandArgument != null) { entCart.ProductDetailsID = Convert.ToInt32(e.CommandArgument.ToString().Trim()); } if (balCart.Insert(entCart)) { lblMessage.Text = "Add to Cart Successfully"; divMessage.Visible = true; hlMessage.Text = "View Cart"; hlMessage.Visible = true; } else { lblMessage.Text = balCart.Message; divMessage.Visible = true; } } } }
protected void gvCartDetails_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Remove") { if (e.CommandArgument != null) { CartBAL balCart = new CartBAL(); if (balCart.Delete(Convert.ToInt32(e.CommandArgument.ToString().Trim()), Convert.ToInt32(Session["UserID"]))) { FillProductDetailsGridView(); } else { lblMessage.Text = balCart.Message; divMessage.Visible = true; } } } }
protected void btnUpdateCart_Click(object sender, EventArgs e) { CartBAL balCart = new CartBAL(); CartENT entCart = new CartENT(); foreach (GridViewRow row in gvCartDetails.Rows) { int intCartID = int.Parse((row.FindControl("lblCartID") as Label).Text); entCart.ProductDetailsID = int.Parse((row.FindControl("lblProductDetailsID") as Label).Text); entCart.Quantity = int.Parse((row.FindControl("txtQuantity") as TextBox).Text); if (balCart.Update(entCart, intCartID, Convert.ToInt32(Session["UserID"]))) { FillProductDetailsGridView(); } else { lblMessage.Text = balCart.Message; divMessage.Visible = true; } } }
public BookInfoBAL() { this.bookBal = new BookBAL(); this.cartBal = new CartBAL(); this.categoryBal = new CategoryBAL(); }
public LoginBAL() { this.accountBal = new AccountBAL(); this.userBal = new UserBAL(); this.cartBal = new CartBAL(); }
public UserCartBAL() { this.cartBal = new CartBAL(); this.accountBal = new AccountBAL(); this.categoryBal = new CategoryBAL(); }