protected void gridgiohang_PageIndexChanging(object sender, GridViewPageEventArgs e) { gridgiohang.PageIndex = e.NewPageIndex; GioHangDTO gioHang = new GioHangDTO(); gioHang.CartGuid = CartGUID; GioHangBUS gioHangBUS = new GioHangBUS(); gioHangBUS._gioHang = gioHang; gioHangBUS.Select(); gioHangBUS.Select(); gridgiohang.DataSource = gioHangBUS.KetQua; gridgiohang.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { HienThiDanhMucSanPham(); cardArea.Visible = isVisible; slideShow.Visible = isVisible; imgAdv.Visible = isVisible; //lblOnline.Text = Application["SoNguoiOnLine"].ToString(); anonymous.Visible = isLogIn; authen.Visible = !isLogIn; dem = 0; GioHangDTO gioHang = new GioHangDTO(); gioHang.CartGuid = CartGUID; GioHangBUS gioHangBUS = new GioHangBUS(); gioHangBUS._gioHang = gioHang; gioHangBUS.Select(); GridView gridView = new GridView(); gridView.DataSource = gioHangBUS.KetQua; gridView.DataBind(); foreach (GridViewRow row in gridView.Rows) { dem += int.Parse(row.Cells[3].Text); } productQuantity.Text = dem.ToString(); } }
private void HienThiGioHang() { dem = 0; GioHangDTO gioHang = new GioHangDTO(); gioHang.CartGuid = CartGUID; GioHangBUS gioHangBUS = new GioHangBUS(); gioHangBUS._gioHang = gioHang; gioHangBUS.Select(); gioHangBUS.Select(); gridgiohang.DataSource = gioHangBUS.KetQua; gridgiohang.DataBind(); foreach (GridViewRow row in gridgiohang.Rows) { TextBox quantity = (TextBox)row.FindControl("textQuantity"); dem += int.Parse(quantity.Text); } Label count = (Label)((Home)this.Master).FindControl("productQuantity"); count.Text = dem.ToString(); }
private void HienThiGioHang() { GioHangDTO gioHang = new GioHangDTO(); gioHang.CartGuid = TaoCartGuid.LayCartGUID(); GioHangBUS gioHangBUS = new GioHangBUS(); gioHangBUS._gioHang = gioHang; try { gioHangBUS.Select(); gridgiohang.DataSource = gioHangBUS.KetQua; gridgiohang.DataBind(); } catch { Response.Redirect("Trangloi.aspx"); } }