Example #1
0
        private void LoadDuLieu()
        {
            string           id      = Request.QueryString["id"];
            TruyVanLayDuLieu truyvan = new TruyVanLayDuLieu();
            GridView         gr      = new GridView();

            gr.DataSource = truyvan.LaydulieubyID(id, "DanhMucByID_Select", "MaDanhMuc");
            gr.DataBind();
            if (gr.Rows.Count > 0)
            {
                txtMaDanhMuc.Text  = HttpUtility.HtmlDecode((string)(gr.Rows[0].Cells[0].Text.ToString()));
                txtTenDanhMuc.Text = HttpUtility.HtmlDecode((string)(gr.Rows[0].Cells[1].Text.ToString()));
            }
            else
            {
                Response.Redirect("qlchuyenmuc.aspx");
            }
        }
        private void LoadDuLieu()
        {
            string           id      = Request.QueryString["id"];
            TruyVanLayDuLieu truyvan = new TruyVanLayDuLieu();
            GridView         gr      = new GridView();

            gr.DataSource = truyvan.LaydulieubyID(id, "SanPhamByID_Select", "MaSanPham");
            gr.DataBind();
            if (gr.Rows.Count > 0)
            {
                txtMaSP.Text    = HttpUtility.HtmlDecode((string)(gr.Rows[0].Cells[0].Text.ToString()));
                txtTenSP.Text   = HttpUtility.HtmlDecode((string)(gr.Rows[0].Cells[1].Text.ToString()));
                txtMoTa.Text    = HttpUtility.HtmlDecode((string)(gr.Rows[0].Cells[2].Text.ToString()));
                fileName        = HttpUtility.HtmlDecode((string)(gr.Rows[0].Cells[3].Text.ToString()));
                Image1.ImageUrl = "~/images/" + fileName;
                txtGiaBan.Text  = HttpUtility.HtmlDecode((string)(gr.Rows[0].Cells[4].Text.ToString()));
                txtSLBan.Text   = HttpUtility.HtmlDecode((string)(gr.Rows[0].Cells[5].Text.ToString()));
            }
            else
            {
                Response.Redirect("qlchuyenmuc.aspx");
            }
        }