コード例 #1
0
        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();
        }
コード例 #2
0
        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();
            }
        }
コード例 #3
0
        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();
        }
コード例 #4
0
        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");
            }
        }