public void LoadData() { _ucCollectionPager_DanhSachPhong.CollectionPager_Object.QueryStringKey = "PageRoom"; listNhanVienPT = NhanVienPT.getQuery().OrderBy(c => c.hoten).ToList(); if (listNhanVienPT.Count > 0) { SearchFunction(); if (Request.QueryString["id"] != null) { Guid id = Guid.Empty; try { id = GUID.From(Request.QueryString["id"]); } catch { Response.Redirect(Request.Url.AbsolutePath); } objNhanVienPT = NhanVienPT.getById(id); if (objNhanVienPT != null) { PanelThongTinNhanVienPhuTrach.Visible = true; Label_MaNhanVien.Text = objNhanVienPT.subId; _ucNhanVien_BreadCrumb.Label_TenNhanVien.Text = Label_HoTen.Text = objNhanVienPT.hoten; Label_SoDienThoai.Text = objNhanVienPT.sodienthoai; Libraries.ImageHelper.LoadImageWeb(objNhanVienPT.hinhanhs.ToList(), _ucASPxImageSlider_Mobile.ASPxImageSlider_Object); List <PTB.Entities.Phong> ListPhong = objNhanVienPT.phongs.ToList(); var list = ListPhong.Select(a => new { id = a.id, ten = string.Format("{0}{1}", a.ten, !Object.Equals(getVitri(a), "") ? " " + getVitri(a) : ""), url = string.Format("http://{0}/Phong.aspx?Search={1}", HttpContext.Current.Request.Url.Authority, a.id.ToString()) }).ToList(); _ucCollectionPager_DanhSachPhong.CollectionPager_Object.DataSource = list; _ucCollectionPager_DanhSachPhong.CollectionPager_Object.BindToControl = RepeaterDanhSachPhong; RepeaterDanhSachPhong.DataSource = _ucCollectionPager_DanhSachPhong.CollectionPager_Object.DataSourcePaged; RepeaterDanhSachPhong.DataBind(); } else { Response.Redirect(Request.Url.AbsolutePath); } } else { PanelDanhSachNhanVienPhuTrach.Visible = true; BindData(); } } else { ucThongBaoLoi.Panel_ThongBaoLoi.Visible = true; ucThongBaoLoi.Label_ThongBaoLoi.Text = "Chưa có nhân viên"; } }
public void loadData() { try { checkPermission(); editGUI("view"); layout.load(gridViewNhanVien); NhanVienPTs = NhanVienPT.getQuery().OrderBy(c => c.hoten).ToList(); gridControlNhanVien.DataSource = NhanVienPTs; if (NhanVienPTs.Count == 0) { enableButton(false); barBtnThemNhanVien.Enabled = true; } } catch (Exception ex) { Debug.WriteLine(this.Name + "->loadData: " + ex.Message); } }