示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string IDHH = Request.QueryString["IDHH"];
            string IDNH = Request.QueryString["IDNH"];

            string strNhomHang = "Tất cả nhóm hàng";
            string strHangHoa  = "Tất cả hàng hóa";

            dataNhomHang dt3 = new dataNhomHang();

            if (Int32.Parse(IDNH) != -1)
            {
                strNhomHang = dt3.LayTenNhomHang_ID(IDNH);
            }

            dataHangHoa dt4 = new dataHangHoa();

            if (Int32.Parse(IDHH) != -1)
            {
                strHangHoa = dt4.LayTenHangHoa(IDHH);
            }

            rpBaoCaoTonKho rp = new rpBaoCaoTonKho();

            rp.Parameters["IDHH"].Value   = IDHH;
            rp.Parameters["IDHH"].Visible = false;
            rp.Parameters["IDNH"].Value   = IDNH;
            rp.Parameters["IDNH"].Visible = false;

            rp.Parameters["strNhomHang"].Value   = strNhomHang;
            rp.Parameters["strNhomHang"].Visible = false;
            rp.Parameters["strHangHoa"].Value    = strHangHoa;
            rp.Parameters["strHangHoa"].Visible  = false;
            viewerReport.Report = rp;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                dataNhomHang dtNhomH = new dataNhomHang();
                DataTable    daNhomH = dtNhomH.getDanhSachNhomHang2();
                daNhomH.Rows.Add(-1, "Tất cả nhóm hàng");

                cmbNhomHang.DataSource = daNhomH;
                cmbNhomHang.TextField  = "TenNhomHang";
                cmbNhomHang.ValueField = "ID";
                cmbNhomHang.DataBind();
                cmbNhomHang.SelectedIndex = daNhomH.Rows.Count;

                dataHangHoa dtHH = new dataHangHoa();
                DataTable   daHH = dtHH.LayDanhSachHangHoa_Ten();
                daHH.Rows.Add(-1, "Tất cả hàng hóa");

                cmbHangHoa.DataSource = daHH;
                cmbHangHoa.TextField  = "TenHangHoa";
                cmbHangHoa.ValueField = "ID";
                cmbHangHoa.DataBind();
                cmbHangHoa.SelectedIndex = daHH.Rows.Count;
            }
        }