Example #1
0
 /// <summary>
 /// 取得下拉列表值
 /// </summary>
 /// <returns></returns>
 public static List <EasyComboValues> GetComboValues()
 {
     using (var proxy = new RedisProxy(RedisProxy.DbComboCache))
     {
         var result = proxy.Get <List <EasyComboValues> >(comboKey);
         if (result == null)
         {
             var access = new PersonnelDataAccess();
             var datas  = access.All(p => p.DataState == DataStateType.Enable);
             result = new List <EasyComboValues> {
                 EasyComboValues.Empty
             };
             result.AddRange(datas.Select(p => new EasyComboValues(p.Id, p.FullName)));
             proxy.Set(comboKey, result);
         }
         return(result);
     }
 }
Example #2
0
 /// <summary>
 /// 取得下拉树值
 /// </summary>
 /// <returns></returns>
 public static List <EasyUiTreeNode> GetTreeValues()
 {
     using (var proxy = new RedisProxy(RedisProxy.DbComboCache))
     {
         var result = proxy.Get <List <EasyUiTreeNode> >(treeKey);
         if (result == null)
         {
             var access = new PersonnelDataAccess();
             var datas  = access.All(p => p.DataState == DataStateType.Enable);
             result = new List <EasyUiTreeNode> {
                 EasyUiTreeNode.EmptyNode
             };
             result.AddRange(datas.Select(p => new EasyUiTreeNode
             {
                 ID     = p.Id,
                 Text   = p.FullName,
                 Title  = p.FullName,
                 IsOpen = true
             }));
             proxy.Set(treeKey, result);
         }
         return(result);
     }
 }