예제 #1
0
 /// <summary>
 /// 取得下拉列表值
 /// </summary>
 /// <returns></returns>
 public static List <EasyComboValues> GetComboValues()
 {
     using (var proxy = new RedisProxy(RedisProxy.DbComboCache))
     {
         var result = proxy.Client.Get <List <EasyComboValues> >(comboKey);
         if (result == null)
         {
             var access = new PositionPersonnelDataAccess();
             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.Personnel)));
             proxy.Client.Set(comboKey, result);
         }
         return(result);
     }
 }
예제 #2
0
 /// <summary>
 /// 取得下拉树值
 /// </summary>
 /// <returns></returns>
 public static List <EasyUiTreeNode> GetTreeValues()
 {
     using (var proxy = new RedisProxy(RedisProxy.DbComboCache))
     {
         var result = proxy.Client.Get <List <EasyUiTreeNode> >(treeKey);
         if (result == null)
         {
             var access = new PositionPersonnelDataAccess();
             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.Personnel,
                 Title  = p.Personnel,
                 IsOpen = true
             }));
             proxy.Client.Set(treeKey, result);
         }
         return(result);
     }
 }