Exemplo n.º 1
0
 /// <summary>
 /// 查询所有数据字典
 /// </summary>
 /// <returns></returns>
 public List<DataDictionaryResultForm> QueryAll()
 {
     var datadiclist = TableCacheHelper.GetDataFromCache<DataDictionary>(typeof(DataDictionaryDao));
     var datadicgrouplist = TableCacheHelper.GetDataFromCache<DataDictionaryGroup>(typeof(DataDictionaryGroupDao));
     List<DataDictionaryResultForm> list = new List<DataDictionaryResultForm>();
     foreach (var group in datadicgrouplist)
     {
         var datadic = datadiclist.FindAll(t => t.DataDictionaryGroupID == group.ID);
         DataDictionaryResultForm dicform = new DataDictionaryResultForm
         {
             Group = group,
             Items = datadic,
         };
         list.Add(dicform);
     }
     return list;
 }
Exemplo n.º 2
0
 public List<DataDictionaryResultForm> QueryByGroupName(List<string> nameList)
 {
     List<DataDictionaryResultForm> list = new List<DataDictionaryResultForm>();
     if (nameList == null)
     {
         return list;
     }
     var datadiclist = TableCacheHelper.GetDataFromCache<DataDictionary>(typeof(DataDictionaryDao));
     var datadicgrouplist = TableCacheHelper.GetDataFromCache<DataDictionaryGroup>(typeof(DataDictionaryGroupDao));
     foreach (var name in nameList)
     {
         var group = datadicgrouplist.Find(t => t.Name.Equals(name));
         if (group == null)
         {
             continue;
         }
         var datadic = datadiclist.FindAll(t => t.DataDictionaryGroupID == group.ID);
         DataDictionaryResultForm dicform = new DataDictionaryResultForm
         {
             Group = group,
             Items = datadic,
         };
         list.Add(dicform);
     }
     return list;
 }
Exemplo n.º 3
0
        /// <summary>
        /// 更新数据字典
        /// </summary>
        /// <param name="form"></param>
        /// <returns>如果有新增的项,则会自动加上ID,以便前端绑定ID</returns>
        public List<DataDictionary> Update(DataDictionaryResultForm form)
        {
            if (form == null || form.Group == null)
            {
                return null;
            }

            UserBLL userbll = new UserBLL();
            var user = userbll.GetCurrentUser();
            form.Group.LastUpdator = user.User.ID;
            return bll.Update(form.Group, form.Items);
        }