protected void ASPxTreeList_LoaiThietBi_CustomDataCallback(object sender, DevExpress.Web.ASPxTreeList.TreeListCustomDataCallbackEventArgs e) { string key = e.Argument.ToString(); DevExpress.Web.ASPxTreeList.TreeListNode node = _ucTreeViTri.ASPxTreeList_ViTri.FindNodeByKeyValue(key); if (node != null) { e.Result = Request.Url.AbsolutePath + "?key=" + key; } else { e.Result = Request.Url.AbsolutePath; } }
private void ASPxTreeList_ViTri_CustomDataCallback(object sender, DevExpress.Web.ASPxTreeList.TreeListCustomDataCallbackEventArgs e) { string key = e.Argument.ToString(); DevExpress.Web.ASPxTreeList.TreeListNode node = _ucTreeViTri.ASPxTreeList_ViTri.FindNodeByKeyValue(key); if (node != null) { if (Object.Equals(node.GetValue("loai"), typeof(PTB.Entities.Phong).Name)) { e.Result = Request.Url.AbsolutePath + "?key=" + key; } else { e.Result = ""; } } else { e.Result = Request.Url.AbsolutePath; } }
protected void ASPxTreeList1_CustomDataCallback(object sender, DevExpress.Web.ASPxTreeList.TreeListCustomDataCallbackEventArgs e) { using (IDocumentSession session = Global.Store.OpenSession()) { string processedId = e.Argument; if (e.Argument.StartsWith("!-!")) { processedId = "{" + e.Argument.Substring(3, e.Argument.Length - 3); } if (e.Argument.EndsWith("!-!")) { processedId = processedId.Substring(0, processedId.Length - 3) + "}"; } using (var transaction = new TransactionScope()) { if (session.Query <TreeCheckResult>().Where(x => x.AppID == processedId).Any()) { TreeMember member = session.Load <TreeMember>(session.Query <TreeMember>().Where(x => x.AppID == processedId).First().Id); List <TreeCheckResult> allResults = session.Query <TreeCheckResult>().Where(r => r.AppID == processedId).ToList(); List <TreeCheckResult> processedResults = session.Query <TreeCheckResult>().Where(r => r.AppID == processedId).ToList(); foreach (var result in allResults) { if (processedResults.Where(x => x.Title == result.Title).Count() > 1) { TreeCheckResult uniqueResult = result; processedResults.RemoveAll(x => x.Title == result.Title); processedResults.Add(result); } } e.Result = TreeListMemberLogic.HtmlizeResults(processedResults); } else { e.Result = "Results not found"; } transaction.Complete(); } } }
protected void TreeListOrganization_CustomDataCallback(object sender, DevExpress.Web.ASPxTreeList.TreeListCustomDataCallbackEventArgs e) { }