Beispiel #1
0
        public PagedList <EMPLOYEE> QueryEmpList(EmpInfoSearch search, PageView view)
        {
            int        deptId  = search.GroupID;
            List <int> deptIds = new List <int>();

            //获取所有大区、区域、门店
            if (deptId > 0)
            {
                deptIds.Add(deptId);
                var        groups   = _groupRepo.GetRecursiveAllByParentID(deptId);
                List <int> groupIds = groups.Select(m => m.ID).ToList();
                if (groupIds.Count > 0)
                {
                    deptIds.AddRange(groupIds);
                }
            }
            //else
            //{
            //    groupIds.Add(deptId);
            //}
            //var stores = _storeRepo.GetByGroupID(groupIds.ToArray());
            //if (stores.Count > 0)
            //{
            //    var storeIds = stores.Select(m => m.ID).ToList();
            //    deptIds.AddRange(storeIds);
            //}

            return(_empRepo.QueryList(deptIds.ToArray(), search, view));
        }
Beispiel #2
0
        public List <MDSearch> GetAllStore(int groupId)
        {
            var groups = _groupRepo.GetRecursiveAllByParentID(groupId);

            int[] groupIds = groups.Select(m => m.ID).ToArray();
            if (groupIds.Length > 0)
            {
                List <MDSearch> list = _storeRepo.GetByGroupID(groupIds);
                list.ForEach(delegate(MDSearch t)
                {
                    t.ID = t.GROUP_ID.HasValue ? t.GROUP_ID.Value : 0;
                });

                return(list);
            }
            return(null);
        }
Beispiel #3
0
 public PagedList <WXCUST_FANS> QueryTemplateFansListT(string groupid, string name, PageView view)
 {
     //获取所有大区、区域、门店
     if (!string.IsNullOrEmpty(groupid))
     {
         string[] grouplist = groupid.Split(',');
         foreach (var item in grouplist)
         {
             var        groups   = _groupRepo.GetRecursiveAllByParentID(int.Parse(item));
             List <int> groupIds = groups.Select(m => m.ID).ToList();
             foreach (var item1 in groupIds)
             {
                 groupid = groupid + "," + item1.ToString();
             }
         }
     }
     return(_set.QueryTemplateFansListT(groupid, name, view));
 }