// Load dữ liệu
 public void loadData(Phong obj = null)
 {
     try
     {
         layout.load(gridViewCTThietBi);
         working = false;
         enableEdit(false);
         List<LoaiThietBi> listLoai = LoaiThietBi.getAll();
         _ucTreeLoaiTB.loadData(listLoai);
         List<ViTriHienThi> listVitris = ViTriHienThi.getAllHavePhong();
         _ucTreeViTri.loadData(listVitris);
         if (obj != null)
         {
             objPhong = obj;
             _ucTreeViTri.setPhong(objPhong);
         }
         else
         {
             objPhong = _ucTreeViTri.getPhong();
         }
         gridControlCTThietBi.DataSource = null;
         listCTThietBis = ChiTietTBHienThi.getAllByPhongId(objPhong.id);
         gridControlCTThietBi.DataSource = listCTThietBis;
         editGUI();
     }
     catch (Exception ex)
     {
         Debug.WriteLine(this.Name + "->loadData:" + ex.Message);
     }
 }
 public void setData(Guid _phongid)
 {
     DevExpress.XtraSplashScreen.SplashScreenManager.ShowForm(this.ParentForm, typeof(WaitForm1), true, true, false);
     DevExpress.XtraSplashScreen.SplashScreenManager.Default.SetWaitFormCaption("Đang tải dữ liệu...");
     try
     {
         objPhong = Phong.getById(_phongid);
         gridControlCTThietBi.DataSource = null;
         listCTThietBis = ChiTietTBHienThi.getAllByPhongId(_phongid);
         gridControlCTThietBi.DataSource = listCTThietBis;
         editGUI();
     }
     catch (Exception ex)
     {
         Debug.WriteLine(this.Name + "->setData:" + ex.Message);
     }
     DevExpress.XtraSplashScreen.SplashScreenManager.CloseForm(false);
 }
        private void LoadDataObjPhong()
        {
            if (objPhong != null)
            {
                listThietBiCuaPhong = ChiTietTBHienThi.getAllByPhongId(objPhong.id);
                var bind = listThietBiCuaPhong.Select(a => new
                {
                    id        = a.idTB,
                    ten       = a.ten,
                    tinhtrang = a.tinhtrang,
                    soluong   = a.soluong,
                    url       = Libraries.StringHelper.AddParameter(new Uri(Request.Url.AbsoluteUri), "id", a.idTB.ToString()),
                    urlLog    = Libraries.StringHelper.AddParameter(new Uri("http://" + Request.Url.Authority + "/" + ResolveClientUrl("~/LogThietBi.aspx")), new List <string>(new string[] { "id", "idp" }), new List <string>(new string[] { a.idTB.ToString(), objPhong.id.ToString() }))
                }).OrderBy(item => item.tinhtrang).ToList();
                _ucCollectionPager_DanhSachThietBi.CollectionPager_Object.DataSource    = bind;
                _ucCollectionPager_DanhSachThietBi.CollectionPager_Object.BindToControl = RepeaterDanhSachThietBi;
                RepeaterDanhSachThietBi.DataSource = _ucCollectionPager_DanhSachThietBi.CollectionPager_Object.DataSourcePaged;
                RepeaterDanhSachThietBi.DataBind();

                if (listThietBiCuaPhong != null)
                {
                    if (listThietBiCuaPhong.Count > 0)
                    {
                        Label_DanhSachThietBi.Text = string.Format("Danh sách thiết bị của {0}", objPhong.ten);
                    }
                    else
                    {
                        Label_DanhSachThietBi.Text = string.Format("{0} chưa có thiết bị", objPhong.ten);
                    }
                }
                else
                {
                    Label_DanhSachThietBi.Text = string.Format("{0} chưa có thiết bị", objPhong.ten);
                }
            }
            else
            {
                Response.Redirect(Request.Url.AbsolutePath);
            }
        }
 private void reLoadCTThietBisOnly()
 {
     listCTThietBis = ChiTietTBHienThi.getAllByPhongId(objPhong.id);
     gridControlCTThietBi.DataSource = listCTThietBis;
     editGUI();
 }