public void LoadData() { listDonVi = TSCD.Entities.DonVi.getAll(); if (listDonVi.Count > 0) { ucTreeViTri.CreateTreeList(); ucTreeViTri.ASPxTreeList_ViTri.DataSource = listDonVi; ucTreeViTri.ASPxTreeList_ViTri.DataBind(); SearchFunction(); treevitri.Visible = true; if (Request.QueryString["key"] != null) { string key = ""; try { key = Request.QueryString["key"].ToString(); } catch { Response.Redirect(Request.Url.AbsolutePath); } DevExpress.Web.ASPxTreeList.TreeListNode node = ucTreeViTri.ASPxTreeList_ViTri.FindNodeByKeyValue(key); if (node != null) { node.Focus(); ucTreeViTri.FocusAndExpandToNode(node); Guid id = GUID.From(node.GetValue("id")); objDonVi = TSCD.Entities.DonVi.getById(id); if (objDonVi != null) { info.Visible = true; Label_ThongTin.Text = string.Format("Thông tin {0}", objDonVi.ten); Label_Ma.Text = objDonVi.subId; ucDonVi_BreadCrumb.Label_TenDonVi.Text = Label_Ten.Text = objDonVi.ten; Label_Loai.Text = objDonVi.loaidonvi.ten; Label_Thuoc.Text = objDonVi.parent == null ? "[Đại học Sài Gòn]" : objDonVi.parent.ten; Label_MoTa.Text = StringHelper.ConvertRNToBR(objDonVi.mota); } else { Response.Redirect(Request.Url.AbsolutePath); } } else { Response.Redirect(Request.Url.AbsolutePath); } } else { DevExpress.Web.ASPxTreeList.TreeListNode node = ucTreeViTri.ASPxTreeList_ViTri.FindNodeByKeyValue(""); node.Focus(); } } else { thongbaoloi.Visible = true; ucDanger.LabelInfo.Text = "Chưa có đơn vị"; } }
private void LoadDataObj(Guid id) { objDonVi = TSCD.Entities.DonVi.getById(id); if (objDonVi != null) { Label_ThongTin.Text = string.Format("Thông tin {0}", objDonVi.ten); Label_Ma.Text = objDonVi.subId; ucDonVi_BreadCrumb.Label_TenDonVi.Text = Label_Ten.Text = objDonVi.ten; Label_Loai.Text = objDonVi.loaidonvi.ten; Label_Thuoc.Text = objDonVi.parent == null ? "[Đại học Sài Gòn]" : objDonVi.parent.ten; Label_MoTa.Text = StringHelper.ConvertRNToBR(objDonVi.mota); } else { Response.Redirect(Request.Url.AbsolutePath); } }