Exemple #1
0
 /// <summary>
 /// 搜索模板树
 /// by cyq 2012-09-25
 /// </summary>
 /// <param name="refresh">是否从数据库刷新数据</param>
 /// <param name="catalog">模板‘病历类别’</param>
 /// <param name="keyword">搜索关键字</param>
 private void SearchPersonTree(bool refresh, string catalog, string keyword)
 {
     try
     {
         if ((null == m_MyTreeFolders) || (refresh))
         {
             m_MyTreeFolders = DS_SqlService.GetPersonTempleteFloder(DS_Common.currentUser.CurrentDeptId, DS_Common.currentUser.Id);
             m_MyLeafs = DS_SqlService.GetPersonTemplete(DS_Common.currentUser.CurrentDeptId, DS_Common.currentUser.Id);
         }
         //所有符合搜索条件的模板集合
         var serchedLeafs = m_MyLeafs.AsEnumerable().Where(p => p["Name"].ToString().Contains(keyword));
         IEnumerable<DataRow> allFolders = m_MyTreeFolders.AsEnumerable();
         //所有符合搜索条件的分类ID集合
         List<string> list = new List<string>();
         foreach (DataRow leaf in serchedLeafs)
         {
             list = GetSearchParentIDs(list, allFolders, leaf, 0);
         }
         var allSearchedFolders = m_MyTreeFolders.AsEnumerable().Where(p => list.Contains(p["ID"].ToString()));
         var allSearchedFirstFolders = allSearchedFolders.Where(p => (null == p["Previd"] || p["Previd"].ToString() == "") && (p["container"].ToString() == "99" || p["container"].ToString() == catalog));
         treeListPersonTemplate.BeginUnboundLoad();
         treeListPersonTemplate.Nodes.Clear();
         foreach (DataRow dr in allSearchedFirstFolders)
         {
             SearchLoadTree(dr, null, catalog, allSearchedFolders, serchedLeafs, keyword);
         }
         treeListPersonTemplate.CollapseAll();
         treeListPersonTemplate.EndUnboundLoad();
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Exemple #2
0
 /// <summary>
 /// xll 初始化界面
 /// </summary>
 /// <param name="refresh"></param>
 /// <param name="catalog"></param>
 private void InitPersonTreeInner(bool refresh, string catalog)//(bool refresh, string catalog)
 {
     try
     {
         if ((null == m_MyTreeFolders) || (refresh))
         {
             m_MyTreeFolders = DS_SqlService.GetPersonTempleteFloder(DS_Common.currentUser.CurrentDeptId, DS_Common.currentUser.Id);
             m_MyLeafs = DS_SqlService.GetPersonTemplete(DS_Common.currentUser.CurrentDeptId, DS_Common.currentUser.Id);
         }
         InitPersonTreeInvoke(catalog);
     }
     catch (Exception)
     {
     }
 }