예제 #1
0
        protected void treeList_CustomDataCallback(object sender, DevExpress.Web.ASPxTreeList.TreeListCustomDataCallbackEventArgs e)
        {
            ASPxTreeList        treeList = (ASPxTreeList)sender;
            List <TreeListNode> nodelist = treeList.GetSelectedNodes();
            //数据压缩
            List <ExtendCode> codelist = new List <ExtendCode>();

            foreach (TreeListNode node in nodelist)
            {
                ExtendCode detail = (ExtendCode)node.DataItem;
                codelist.Add(detail);
            }
            e.Result = JsonConvert.SerializeObject(codelist);
        }
예제 #2
0
        protected void TreeListOrganization_CustomDataCallback(object sender, DevExpress.Web.ASPxTreeList.TreeListCustomDataCallbackEventArgs e)
        {
            DM_DVQLYService isyOrganizationService = new DM_DVQLYService();

            Entity.DM_DVQLY sysOrganization = new Entity.DM_DVQLY();

            string       key  = e.Argument.ToString();
            TreeListNode node = TreeListOrganization.FindNodeByKeyValue(key);

            string[] result = new string[4];
            //result[0] = node["MA_DVIQLY"].ToString();
            result[0] = node["TEN_DVIQLY"].ToString();
            result[1] = node["MA_DVIQLY"].ToString();
            result[2] = node["ParentId"].ToString();
            result[3] = node["TenVietTat"].ToString();
            e.Result  = result;
            LoadData();
        }
 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();
         }
     }
 }