Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["KTDangNhap"] != "GPM")
            {
                Response.Redirect("DangNhap.aspx");
            }
            else
            {
                if (!IsPostBack)
                {
                    string IDNhanVien = "1";     // Session["IDThuNgan"].ToString();
                    if (Session["IDThuNgan"] != null)
                    {
                        IDNhanVien = Session["IDThuNgan"].ToString();
                    }
                    if (Session["IDNhanVien"] != null)
                    {
                        IDNhanVien = Session["IDNhanVien"].ToString();
                    }

                    dtKho     dt = new dtKho();
                    DataTable da = dt.LayDanhSachKho();
                    //da.Rows.Add(-1, "", "Tất cả cửa hàng", null, null, null, null, null, null, null, null, null);

                    cmbKho.DataSource = da;
                    cmbKho.TextField  = "TenCuaHang";
                    cmbKho.ValueField = "ID";
                    cmbKho.DataBind();
                    cmbKho.SelectedIndex = 0;
                }
            }
        }
Ejemplo n.º 2
0
        private void LoadGrid()
        {
            dtKho data = new dtKho();

            gridThongTinCuaHangKho.DataSource = data.LayDanhSachKho();
            gridThongTinCuaHangKho.DataBind();
        }