Esempio n. 1
0
        /// <summary>
        /// 得到相似客户
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public List <CustomerResultDTO> GetSimilarCustomerList(CustomerSearchDTO dto)
        {
            List <CustomerResultDTO> result = null;
            var tcdmse = SingleQueryObject.GetObj();

            var all = tcdmse.master_CustomerInfo.AsNoTracking().Where(p => p.CustomerID != null);

            if (!string.IsNullOrEmpty(dto.SearchText))
            {
                List <string> dict  = new List <string>();
                int           count = (int)Math.Ceiling(dto.SearchText.Length / 2.0);
                for (int i = 1; i <= count; i++)
                {
                    if (i == count)
                    {
                        dict.Add(dto.SearchText.Substring((i - 1) * 2));
                    }
                    else
                    {
                        dict.Add(dto.SearchText.Substring((i - 1) * 2, 2));
                    }
                }
                var filted = tcdmse.master_CustomerInfo.AsNoTracking().Where(p => p.CustomerID == null);
                foreach (var di in dict)
                {
                    filted = filted.Union(all.Where(p => p.CustomerName.Contains(di)));
                }
                dto.Count = filted.Count();
                filted    = filted.OrderBy(m => m.CustomerName).ThenBy(m => m.CustomerID).Skip((dto.page - 1) * dto.rows).Take(dto.rows);
                result    = Mapper.Map <List <master_CustomerInfo>, List <CustomerResultDTO> >(filted.ToList());
            }

            return(result);
        }
Esempio n. 2
0
        public short CheckPhoneNumber(string PhoneNumber)
        {
            short result = 0;

            var pp = SingleQueryObject.GetObj().master_UserInfo.AsNoTracking().Where(p => p.PhoneNumber == PhoneNumber).FirstOrDefault();

            if (pp == null) // 无手机号
            {
                result = 1;
            }
            else if (pp.master_RoleInfo.Count() == 0 && pp.master_UserCustomerAuthority.Count() == 0) // 无权限
            {
                result = 2;
            }
            else if (!(pp.IsActive ?? false)) // 停用
            {
                result = 3;
            }
            else if (pp.StopTime < DateTime.Now) //用户到期时间
            {
                result = 4;
            }

            return(result);
        }
Esempio n. 3
0
        /// <summary>
        /// 得到反馈信息(查询)
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public List <FeedbackResultDTO> GetFeedbackList(FeedbackSearchDTO dto)
        {
            List <FeedbackResultDTO> result = null;
            var tcdmse = SingleQueryObject.GetObj();

            var pp = tcdmse.master_FeedbackStat.AsNoTracking().Where(p => p.FeedbackStatID != null);

            {
                if (!string.IsNullOrEmpty(dto.FeedbackSystem))
                {
                    pp = pp.Where(p => p.FeedbackSystem == dto.FeedbackSystem);
                }
                if (!string.IsNullOrEmpty(dto.SearchText))
                {
                    pp = pp.Where(p => p.master_UserInfo.master_DistributorInfo.Any(m => m.DistributorName.Contains(dto.SearchText)) ||
                                  p.master_UserInfo.FullName.Contains(dto.SearchText));
                }
            }
            dto.Count = pp.Count();
            pp        = pp.OrderBy(m => m.FeedbackStaus).ThenByDescending(m => m.FeedbackDate).ThenBy(m => m.FeedbackStatID).Skip((dto.page - 1) * dto.rows).Take(dto.rows);

            result = Mapper.Map <List <master_FeedbackStat>, List <FeedbackResultDTO> >(pp.ToList());

            return(result);
        }
Esempio n. 4
0
        /// <summary>
        /// 得到经销商信息
        /// </summary>
        /// <returns></returns>
        public List <DistributorResultDTO> GetDistributorList(DistributorSearchDTO dto)
        {
            List <DistributorResultDTO> result = null;
            var tcdmse = SingleQueryObject.GetObj();

            var pp = tcdmse.master_DistributorInfo.AsNoTracking().Where(p => p.DistributorID != null);

            if (dto.DistributorID != null)
            {
                pp = pp.Where(p => p.DistributorID == dto.DistributorID);
            }
            if (dto.DistributorTypeID != null)
            {
                pp = pp.Where(p => p.DistributorTypeID == dto.DistributorTypeID);
            }
            if (dto.DistributorServiceTypeID != null)
            {
                pp = pp.Where(p => p.DistributorServiceTypeID == dto.DistributorServiceTypeID);
            }
            if (!string.IsNullOrEmpty(dto.SearchText))
            {
                pp = pp.Where(p => p.DistributorCode.Contains(dto.SearchText) || p.DistributorName.Contains(dto.SearchText) || p.master_DistributorType.DistributorTypeName.Contains(dto.SearchText));
            }
            if (dto.IsActive != null)
            {
                pp = pp.Where(p => p.IsActive == dto.IsActive);
            }

            dto.Count = pp.Count();
            pp        = pp.OrderByDescending(m => m.IsActive).ThenBy(m => m.DistributorID).Skip((dto.page - 1) * dto.rows).Take(dto.rows);

            result = Mapper.Map <List <master_DistributorInfo>, List <DistributorResultDTO> >(pp.ToList());

            return(result);
        }
Esempio n. 5
0
        /// <summary>
        /// 查询日志管理
        /// </summary>
        /// <returns></returns>
        public List <LogDTO> GetLog(LogSearchDTO dto)
        {
            List <LogDTO> result = null;
            var           tcdmse = SingleQueryObject.GetObj();

            var pp = tcdmse.common_LogInfo.AsNoTracking().Where(p => p.LogIndex != null);

            if (dto.Year != null)
            {
                pp = pp.Where(p => p.LogDate.Value.Year == dto.Year);
            }
            if (dto.Month != null)
            {
                pp = pp.Where(p => p.LogDate.Value.Month == dto.Month);
            }
            if (!string.IsNullOrEmpty(dto.BelongModel))
            {
                pp = pp.Where(p => p.BelongModel == dto.BelongModel);
            }
            if (!string.IsNullOrEmpty(dto.SearchText))
            {
                pp = pp.Where(p => p.OpratorName.Contains(dto.SearchText));
            }
            dto.Count = pp.Count();
            pp        = pp.OrderBy(m => m.LogIndex).Skip((dto.page - 1) * dto.rows).Take(dto.rows);

            result = Mapper.Map <List <common_LogInfo>, List <LogDTO> >(pp.ToList());

            return(result);
        }
Esempio n. 6
0
        /// <summary>
        /// 已授权用户模块
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public List <UsersByAuthoritedResultDTO> GetUsersByAuthorited(UsersByAuthoritedSearchDTO dto)
        {
            List <UsersByAuthoritedResultDTO> lstresult = null;
            var ww = dto.ApplyUserAuthority.Select(s => s.StructureID).ToList();
            var gg = from g in SingleQueryObject.GetObj().master_UserCustomerAuthority
                     where ww.Contains(g.StructureID) &&
                     (dto.DistributorID == null || g.master_UserInfo.master_DistributorInfo.Where(w => dto.DistributorID == w.DistributorID.ToString()).Count() > 0) &&
                     g.StructureID.Length == 3
                     select new UsersByAuthoritedResultDTO
            {
                UserID        = g.master_UserInfo.UserID,
                FullName      = g.master_UserInfo.FullName,
                StructureID   = g.StructureID,
                StructureName = g.dict_Structure.StructureName
            };

            if (dto.RoleIDlist.Count() != 0)
            {
                var modelid = ModelRoleDTO.ModelRolelist.Where(p => dto.RoleIDlist.Contains(p.RoleID)).Select(s => s.ModelID).ToList();
                gg = gg.Where(p => modelid.Contains(p.StructureID));
            }
            dto.Count = gg.Select(t => t).Count();
            lstresult = gg.Select(t => t).OrderBy(o => o.UserID).ThenBy(t => t.StructureID).Skip((dto.page - 1) * dto.rows).Take(dto.rows).ToList();

            return(lstresult);
        }
Esempio n. 7
0
        /// <summary>
        /// 得到附件信息(查询)
        /// </summary>
        /// <param name="dtolist"></param>
        /// <returns></returns>
        public List <AttachFileResultDTO> GetAttachFileList(AttachFileSearchDTO dto)
        {
            List <AttachFileResultDTO> result = null;
            var tcdmse = SingleQueryObject.GetObj();

            var pp = tcdmse.common_AttachFileInfo.AsNoTracking().Where(p => p.AttachFileID != null);

            if (dto.AttachFileID != null)
            {
                pp = pp.Where(p => p.AttachFileID == dto.AttachFileID);
            }
            else
            {
                if (dto.BelongModule != null)
                {
                    pp = pp.Where(p => p.BelongModule == dto.BelongModule);
                    if (!string.IsNullOrEmpty(dto.BelongModulePrimaryKey))
                    {
                        pp = pp.Where(p => p.BelongModulePrimaryKey == dto.BelongModulePrimaryKey);
                    }
                }
            }
            result = Mapper.Map <List <common_AttachFileInfo>, List <AttachFileResultDTO> >(pp.ToList());

            return(result);
        }
Esempio n. 8
0
        /// <summary>
        /// 得到所有模块管理员信息
        /// </summary>
        /// <returns></returns>
        public List <ModularResultDTO> GetModularList(ModularSearchDTO dto)
        {
            List <ModularResultDTO> result = new List <ModularResultDTO>();
            var tcdmse = SingleQueryObject.GetObj();

            //dict_Structure和master_UserInfo关联查询所有的模块管理员信息

            return(result);
        }
Esempio n. 9
0
        /// <summary>
        /// 取得所有按钮
        /// </summary>
        /// <returns></returns>
        public List <ButtonDTO> GetAllButton()
        {
            List <ButtonDTO> result = null;

            var pp = SingleQueryObject.GetObj().dict_ButtonInfo.AsNoTracking().OrderBy(g => g.IndexCode).ToList();

            result = Mapper.Map <List <ButtonDTO> >(pp);

            return(result);
        }
Esempio n. 10
0
        /// <summary>
        /// 取得模块日志
        /// </summary>
        /// <returns></returns>
        public List <LogDTO> GetAllLogByBelongModel(string BelongModel)
        {
            List <LogDTO> result = null;

            var pp = SingleQueryObject.GetObj().common_LogInfo.AsNoTracking().Where(p => p.BelongModel == BelongModel).OrderBy(g => g.LogIndex).ToList();

            result = Mapper.Map <List <LogDTO> >(pp);

            return(result);
        }
Esempio n. 11
0
        /// <summary>
        /// 取得所有模块
        /// </summary>
        /// <returns></returns>
        public List <StructureDTO> GetAllStructure()
        {
            List <StructureDTO> result = null;

            var pp = SingleQueryObject.GetObj().dict_Structure.AsNoTracking().OrderBy(g => new { g.StructureID, g.IndexCode }).ToList();

            result = Mapper.Map <List <StructureDTO> >(pp);

            return(result);
        }
Esempio n. 12
0
        /// <summary>
        /// 大小区显示
        /// </summary>
        /// <param name="lngdto"></param>
        /// <returns></returns>
        public List <AreaResultDTO> GetAreaTree(AreaSearchDTO dto)
        {
            List <AreaResultDTO> result = new List <AreaResultDTO>();
            var tcdmse = SingleQueryObject.GetObj();

            int i  = 0;
            var pp = tcdmse.master_AreaInfo.AsNoTracking().Where(p => p.AreaID != null);

            if (dto.DepartID != null)
            {
                pp = pp.Where(p => p.DepartID == dto.DepartID);
            }
            var qq = pp.ToList();
            var mm = qq.Where(p => p.AreaPID == null);

            foreach (var m in mm)
            {
                i++;
                AreaResultDTO One = new AreaResultDTO();
                One = Mapper.Map <master_AreaInfo, AreaResultDTO>(m);
                One.FictitiousID = i;
                One.children     = new List <AreaResultDTO>();
                var nn = qq.Where(p => p.AreaPID == m.AreaID);
                foreach (var n in nn)
                {
                    i++;
                    AreaResultDTO Two = new AreaResultDTO();
                    Two = Mapper.Map <master_AreaInfo, AreaResultDTO>(n);
                    Two.FictitiousID = i;
                    One.children.Add(Two);
                    var ww = tcdmse.master_AreaRegionInfo.AsNoTracking().Where(w => w.AreaID == n.AreaID);
                    List <AreaResultDTO> region = null;
                    region = Mapper.Map <List <master_AreaRegionInfo>, List <AreaResultDTO> >(ww.ToList());
                    foreach (var r in region)
                    {
                        i++;
                        r.FictitiousID = i;
                        r.AreaPID      = n.AreaID;
                    }
                    Two.children = region;
                }
                result.Add(One);
            }

            //if (dto.DepartID != null)
            //{
            //    List<int> Depat = new List<int>();
            //    UserAuthorityServices.GetDepare(tcdmse, Depat, dto.DepartID);
            //    Depat = Depat.Distinct().ToList();
            //    result = result.Where(p => Depat.Contains(p.DepartID.Value)).ToList();
            //}


            return(result);
        }
Esempio n. 13
0
        /// <summary>
        /// 所有行政区划
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public List <RegionResultDTO> GetRegionList()
        {
            var result = new List <RegionResultDTO>();
            var tcdmse = SingleQueryObject.GetObj();

            var list = tcdmse.dict_RegionInfo.AsNoTracking().ToList();

            result = Mapper.Map <List <dict_RegionInfo>, List <RegionResultDTO> >(list);

            return(result);
        }
Esempio n. 14
0
        /// <summary>
        /// 得到所有关账日信息
        /// </summary>
        /// <returns></returns>
        public List <AccountDateResultDTO> GetAccountDateList()
        {
            List <AccountDateResultDTO> result = null;
            var tcdmse = SingleQueryObject.GetObj();

            var pp = tcdmse.master_AccountDateInfo.AsNoTracking();

            result = Mapper.Map <List <master_AccountDateInfo>, List <AccountDateResultDTO> >(pp.OrderBy(o => o.AccountDateYear).ThenBy(o => o.CreateTime).ThenBy(o => o.AccountDateID).ToList());

            return(result);
        }
Esempio n. 15
0
        /// <summary>
        /// 得到所有汇率信息
        /// </summary>
        /// <returns></returns>
        public List <RateResultDTO> GetRateList()
        {
            List <RateResultDTO> result = null;
            var tcdmse = SingleQueryObject.GetObj();

            var pp = tcdmse.master_RateInfo.AsNoTracking();

            result = Mapper.Map <List <master_RateInfo>, List <RateResultDTO> >(pp.ToList());

            return(result);
        }
Esempio n. 16
0
        /// <summary>
        /// 大区
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public List <AreaResultDTO> GetArea()
        {
            List <AreaResultDTO> result = new List <AreaResultDTO>();
            var tcdmse = SingleQueryObject.GetObj();

            var pp = tcdmse.master_AreaInfo.AsNoTracking().Where(p => p.AreaPID == null).ToList();

            result = Mapper.Map <List <master_AreaInfo>, List <AreaResultDTO> >(pp);

            return(result);
        }
Esempio n. 17
0
        public List <DepartmentResultDTO> GetDepartment()
        {
            List <DepartmentResultDTO> result = new List <DepartmentResultDTO>();
            var tcdmse = SingleQueryObject.GetObj();

            var roots = tcdmse.master_DepartmentInfo.AsNoTracking().ToList();

            result = AutoMapper.Mapper.Map <List <master_DepartmentInfo>, List <DepartmentResultDTO> >(roots);

            return(result);
        }
Esempio n. 18
0
        /// <summary>
        /// 得到一条运输方式信息
        /// </summary>
        /// <returns></returns>
        public TransportResultDTO GetOneTransport(int id)
        {
            TransportResultDTO result = null;
            var tcdmse = SingleQueryObject.GetObj();

            var pp = tcdmse.master_TransportInfo.AsNoTracking().Where(p => p.TransportID == id).FirstOrDefault();

            if (pp != null)
            {
                result = Mapper.Map <master_TransportInfo, TransportResultDTO>(pp);
            }

            return(result);
        }
Esempio n. 19
0
        /// <summary>
        /// 得到一条角色信息
        /// </summary>
        /// <returns></returns>
        public RoleResultDTO GetRole(int id)
        {
            RoleResultDTO result = new RoleResultDTO();
            var           tcdmse = SingleQueryObject.GetObj();

            var pp = tcdmse.master_RoleInfo.AsNoTracking().Where(p => p.RoleID == id).FirstOrDefault();

            if (pp == null)
            {
                throw new Exception("此条信息不存在!");
            }
            result = AutoMapper.Mapper.Map <master_RoleInfo, RoleResultDTO>(pp);

            return(result);
        }
Esempio n. 20
0
        /// <summary>
        /// 得到所有经销商服务类型
        /// </summary>
        /// <returns></returns>
        public List <DistributorServiceTypeResultDTO> GetDistributorServiceType(DistributorServiceTypeSearchDTO dto)
        {
            List <DistributorServiceTypeResultDTO> result = null;
            var tcdmse = SingleQueryObject.GetObj();

            var pp = tcdmse.master_DistributorServiceType.AsNoTracking().Where(p => p.DistributorServiceTypeID != null);

            if (dto.DistributorServiceTypeID != null)
            {
                pp = pp.Where(p => p.DistributorServiceTypeID == dto.DistributorServiceTypeID);
            }
            result = Mapper.Map <List <master_DistributorServiceType>, List <DistributorServiceTypeResultDTO> >(pp.ToList());

            return(result);
        }
Esempio n. 21
0
        /// <summary>
        /// 得到经销商授权产品线区域信息
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public List <DistributorRegionResultDTO> GetDistributorAuthorityRegion(DistributorAuthoritySearchDTO dto)
        {
            List <DistributorRegionResultDTO> result = null;
            var tcdmse = SingleQueryObject.GetObj();

            var pp = tcdmse.master_DistributorRegionInfo.AsNoTracking().Where(p => (dto.DistributorProductID == null ||
                                                                                    p.master_DistributorProductLineInfo.DistributorProductLineID == dto.DistributorProductID));

            dto.Count = pp.Count();
            pp        = pp.OrderByDescending(m => m.CreateTime).Skip((dto.page - 1) * dto.rows).Take(dto.rows);

            result = Mapper.Map <List <master_DistributorRegionInfo>, List <DistributorRegionResultDTO> >(pp.ToList());

            return(result);
        }
Esempio n. 22
0
        /// <summary>
        /// 得到一条部门信息
        /// </summary>
        /// <returns></returns>
        public DepartmentResultDTO GetDepartment(int id)
        {
            DepartmentResultDTO result = new DepartmentResultDTO();
            var tcdmse = SingleQueryObject.GetObj();

            var pp = tcdmse.master_DepartmentInfo.AsNoTracking().Where(p => p.DepartID == id).FirstOrDefault();

            if (pp == null)
            {
                throw new Exception("此条信息不存在!");
            }
            result = AutoMapper.Mapper.Map <master_DepartmentInfo, DepartmentResultDTO>(pp);

            return(result);
        }
Esempio n. 23
0
        /// <summary>
        /// 得到一条付款条款信息
        /// </summary>
        /// <returns></returns>
        public PaymentResultDTO GetPayment(int id)
        {
            PaymentResultDTO result = null;
            var tcdmse = SingleQueryObject.GetObj();

            var pp = tcdmse.master_PaymentInfo.AsNoTracking().Where(p => p.PayID == id).FirstOrDefault();

            if (pp == null)
            {
                throw new Exception("此条信息不存在!");
            }
            result = Mapper.Map <master_PaymentInfo, PaymentResultDTO>(pp);

            return(result);
        }
Esempio n. 24
0
        /// <summary>
        /// 得到所有运输方式信息
        /// </summary>
        /// <returns></returns>
        public List <TransportResultDTO> GetTransport(TransportSearchDTO dto)
        {
            List <TransportResultDTO> result = null;
            var tcdmse = SingleQueryObject.GetObj();

            var pp = tcdmse.master_TransportInfo.AsNoTracking().Where(p => p.TransportID != null);

            if (dto.DistributorID != null)
            {
                pp = pp.Where(p => p.master_DistributorTransport.Any(m => m.DistributorID == dto.DistributorID));
            }
            result = Mapper.Map <List <master_TransportInfo>, List <TransportResultDTO> >(pp.ToList());

            return(result);
        }
Esempio n. 25
0
        /// <summary>
        /// 得到一条关账日信息
        /// </summary>
        /// <returns></returns>
        public AccountDateResultDTO GetAccountDate(int id)
        {
            AccountDateResultDTO result = null;
            var tcdmse = SingleQueryObject.GetObj();

            var pp = tcdmse.master_AccountDateInfo.AsNoTracking().Where(p => p.AccountDateID == id).FirstOrDefault();

            if (pp == null)
            {
                throw new Exception("此条信息不存在!");
            }
            result = Mapper.Map <master_AccountDateInfo, AccountDateResultDTO>(pp);

            return(result);
        }
Esempio n. 26
0
        /// <summary>
        /// 查询提醒管理
        /// </summary>
        /// <returns></returns>
        public List <WarningDTO> GetWarningInfo(WarningSearchDTO dto)
        {
            List <WarningDTO> result = null;
            var tcdmse = SingleQueryObject.GetObj();

            var pp = tcdmse.common_WarningInfo.AsNoTracking().Where(p => p.WarningID != null);

            pp = pp.Where(t => t.UserID == dto.UserID);

            dto.Count = pp.Count();
            pp        = pp.OrderBy(m => m.WarningID).Skip((dto.page - 1) * dto.rows).Take(dto.rows);

            result = Mapper.Map <List <common_WarningInfo>, List <WarningDTO> >(pp.ToList());

            return(result);
        }
Esempio n. 27
0
        /// <summary>
        /// 得到所有部门信息
        /// </summary>
        /// <returns></returns>
        public List <DepartmentResultDTO> GetDepartmentList()
        {
            List <DepartmentResultDTO> result = new List <DepartmentResultDTO>();
            var tcdmse = SingleQueryObject.GetObj();

            var roots      = tcdmse.master_DepartmentInfo.AsNoTracking().Where(p => p.DepartParentID == null).ToList();
            var departlist = AutoMapper.Mapper.Map <List <master_DepartmentInfo>, List <DepartmentResultDTO> >(roots);

            for (int i = 0; i < departlist.Count; i++)
            {
                departlist[i] = GetDepartTree(departlist[i]);
            }
            result = departlist;

            return(result);
        }
Esempio n. 28
0
        /// <summary>
        /// 得到经销商授权付款条款信息
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public List <DistributorPaymentResultDTO> GetDistributorAuthorityPay(DistributorAuthoritySearchDTO dto)
        {
            List <DistributorPaymentResultDTO> result = null;
            var tcdmse = SingleQueryObject.GetObj();

            var pp = tcdmse.master_DistributorPayInfo.AsNoTracking().Where(p => p.DistributorPayID != null);

            if (dto.DistributorID != null)
            {
                pp = pp.Where(p => p.DistributorID == dto.DistributorID);
            }

            result = Mapper.Map <List <master_DistributorPayInfo>, List <DistributorPaymentResultDTO> >(pp.ToList());

            return(result);
        }
Esempio n. 29
0
        /// <summary>
        /// 得到经销商信息(开头字符为查询条件)
        /// </summary>
        /// <returns></returns>
        public List <DistributorBaseDTO> GetDistributorBaseInfoByName(string DistributorName)
        {
            List <DistributorBaseDTO> result = null;
            var tcdmse = SingleQueryObject.GetObj();

            if (!string.IsNullOrEmpty(DistributorName))
            {
                result = tcdmse.master_DistributorInfo.AsNoTracking().Where(m => m.DistributorName.StartsWith(DistributorName)).Take(15).Select(m => new DistributorBaseDTO
                {
                    DistributorID   = m.DistributorID,
                    DistributorName = m.DistributorName
                }).ToList();
            }

            return(result);
        }
Esempio n. 30
0
        /// <summary>
        /// 得到经销商公告授权信息
        /// </summary>
        /// <returns></returns>
        public List <DistributorAnnounceAuthorityResultDTO> GetDistributorAnnounceAuthorityList(DistributorAnnounceAuthoritySearchDTO dto)
        {
            List <DistributorAnnounceAuthorityResultDTO> result = null;
            var tcdmse = SingleQueryObject.GetObj();

            var pp = tcdmse.master_DistributorInfo.AsNoTracking().Where(p => p.DistributorID != null);

            if (!string.IsNullOrEmpty(dto.SearchText))
            {
                pp = pp.Where(p => p.DistributorName.Contains(dto.SearchText));
            }
            dto.Count = pp.Count();
            pp        = pp.OrderBy(m => m.DistributorCode).Skip((dto.page - 1) * dto.rows).Take(dto.rows);
            result    = Mapper.Map <List <master_DistributorInfo>, List <DistributorAnnounceAuthorityResultDTO> >(pp.ToList());

            return(result);
        }