public GetUserProfilesByUserIdsSpecification(Guid[] userIds, CommonSpecParams specParams)
            : base(x =>
                   (userIds.Contains(x.UserId)) &&
                   ((x.FirstName.ToLower().Contains(specParams.Search)) ||
                    (x.LastName.ToLower().Contains(specParams.Search)) || (string.IsNullOrEmpty(specParams.Search)))
                   )
        {
            AddInclude(x => x.AppUser);
            AddOrderBy(x => x.FirstName);
            ApplyPaging(specParams.PageSize * (specParams.PageIndex - 1), specParams.PageSize);

            if (!string.IsNullOrEmpty(specParams.Sort))
            {
                switch (specParams.Sort)
                {
                case "nameAsc":
                    AddOrderBy(p => p.FirstName);
                    break;

                case "nameDesc":
                    AddOrderByDescending(p => p.FirstName);
                    break;

                default:
                    AddOrderBy(p => p.FirstName);
                    break;
                }
            }
        }
示例#2
0
 public GetUserProfilesCountSpecification(CommonSpecParams specParams)
     : base(x =>
            ((x.FirstName.Contains(specParams.Search)) &&
             (x.LastName.Contains(specParams.Search))) || string.IsNullOrEmpty(specParams.Search)
            )
 {
 }
        public GetSchedulerSpecification(CommonSpecParams specParams, int campaignId, int userProfileId)
            : base(x =>
                   (x.UserProfileId == userProfileId) &&
                   (x.CampaignId == campaignId) &&
                   (
                       (x.FirstName.Contains(specParams.Search)) ||
                       (x.LastName.Contains(specParams.Search)) ||
                       (x.Company.Contains(specParams.Search)) ||
                       (string.IsNullOrEmpty(specParams.Search))
                   )
                   )
        {
            AddOrderBy(x => x.FirstName);
            ApplyPaging(specParams.PageSize * (specParams.PageIndex - 1), specParams.PageSize);

            if (!string.IsNullOrEmpty(specParams.Sort))
            {
                switch (specParams.Sort)
                {
                case "nameAsc":
                    AddOrderBy(p => p.FirstName);
                    break;

                case "nameDesc":
                    AddOrderByDescending(p => p.FirstName);
                    break;

                default:
                    AddOrderBy(p => p.FirstName);
                    break;
                }
            }
        }
示例#4
0
        public GetCampaignsSpecification(CommonSpecParams specParams)
            : base(x =>
                   ((x.CampaignName.ToLower().Contains(specParams.Search)) ||
                    (x.Plan.ToLower().Contains(specParams.Search)) ||
                    (x.Client.ToLower().Contains(specParams.Search))) || string.IsNullOrEmpty(specParams.Search)
                   )
        {
            AddInclude(x => x.CampaignAssignments);
            AddOrderBy(x => x.CampaignName);
            ApplyPaging(specParams.PageSize * (specParams.PageIndex - 1), specParams.PageSize);

            if (!string.IsNullOrEmpty(specParams.Sort))
            {
                switch (specParams.Sort)
                {
                case "nameAsc":
                    AddOrderBy(p => p.CampaignName);
                    break;

                case "nameDesc":
                    AddOrderByDescending(p => p.CampaignName);
                    break;

                default:
                    AddOrderBy(p => p.CampaignName);
                    break;
                }
            }
        }
        public GetUserProfilesByDepartmentSpecification(int departmentId, CommonSpecParams specParams)
            : base(x =>
                   (x.DepartmentId == departmentId) &&
                   (((x.FirstName.Contains(specParams.Search)) &&
                     (x.LastName.Contains(specParams.Search))) || string.IsNullOrEmpty(specParams.Search))
                   )
        {
            AddOrderBy(x => x.FirstName);
            ApplyPaging(specParams.PageSize * (specParams.PageIndex - 1), specParams.PageSize);

            if (!string.IsNullOrEmpty(specParams.Sort))
            {
                switch (specParams.Sort)
                {
                case "nameAsc":
                    AddOrderBy(p => p.FirstName);
                    break;

                case "nameDesc":
                    AddOrderByDescending(p => p.FirstName);
                    break;

                default:
                    AddOrderBy(p => p.FirstName);
                    break;
                }
            }
        }
示例#6
0
        public GetDepartmentsSpecification(CommonSpecParams specParams)
            : base(x =>
                   ((x.Name.Contains(specParams.Search)) ||
                    (x.Description.ToLower().Contains(specParams.Search)) ||
                    (x.ShortName.ToLower().Contains(specParams.Search))) || string.IsNullOrEmpty(specParams.Search)
                   )
        {
            AddOrderBy(x => x.Name);
            ApplyPaging(specParams.PageSize * (specParams.PageIndex - 1), specParams.PageSize);

            if (!string.IsNullOrEmpty(specParams.Sort))
            {
                switch (specParams.Sort)
                {
                case "nameAsc":
                    AddOrderBy(p => p.Name);
                    break;

                case "nameDesc":
                    AddOrderByDescending(p => p.Name);
                    break;

                default:
                    AddOrderBy(p => p.Name);
                    break;
                }
            }
        }
示例#7
0
 public GetUserProfilesByUserIdsCountSpecification(Guid[] userIds, CommonSpecParams specParams)
     : base(x =>
            (userIds.Contains(x.UserId)) &&
            ((x.FirstName.ToLower().Contains(specParams.Search)) ||
             (x.LastName.ToLower().Contains(specParams.Search)) || (string.IsNullOrEmpty(specParams.Search)))
            )
 {
 }
示例#8
0
 public GetCampaignsCountSpecification(CommonSpecParams specParams)
     : base(x =>
            ((x.CampaignName.ToLower().Contains(specParams.Search)) ||
             (x.Plan.ToLower().Contains(specParams.Search)) ||
             (x.Client.ToLower().Contains(specParams.Search))) || string.IsNullOrEmpty(specParams.Search)
            )
 {
 }
 public GetDepartmentsCountSpecification(CommonSpecParams specParams)
     : base(x =>
            ((x.Name.Contains(specParams.Search)) ||
             (x.Description.ToLower().Contains(specParams.Search)) ||
             (x.ShortName.ToLower().Contains(specParams.Search))) || string.IsNullOrEmpty(specParams.Search)
            )
 {
 }
        public GetUserProfilesByDepartmentCountSpecification(int departmentId, CommonSpecParams specParams)
            : base(x =>
                 (x.DepartmentId == departmentId) &&
                 (((x.FirstName.Contains(specParams.Search)) &&
                 (x.LastName.Contains(specParams.Search))) || string.IsNullOrEmpty(specParams.Search))
                )

        {

        }
 public GetSdrGroupByManagerIdCountSpecification(int managerId, CommonSpecParams specParams)
     : base(x =>
            (x.ManagerId == managerId) &&
            (
                (x.Sdr.FirstName.Contains(specParams.Search)) ||
                (x.Sdr.LastName.Contains(specParams.Search))
            )
            )
 {
     AddInclude(s => s.Sdr);
 }
示例#12
0
 public GetSchedulerCountSpecification(CommonSpecParams specParams, int campaignId, int userProfileId)
     : base(x =>
            (x.UserProfileId == userProfileId) &&
            (x.CampaignId == campaignId) &&
            (
                (x.FirstName.Contains(specParams.Search)) ||
                (x.LastName.Contains(specParams.Search)) ||
                (x.Company.Contains(specParams.Search)) ||
                (string.IsNullOrEmpty(specParams.Search))
            )
            )
 {
 }
        public GetWagesSpecification(CommonSpecParams specParams)
            : base()
        {
            AddOrderBy(x => x.CampaignType);
            ApplyPaging(specParams.PageSize * (specParams.PageIndex - 1), specParams.PageSize);

            if (!string.IsNullOrEmpty(specParams.Sort))
            {
                switch (specParams.Sort)
                {
                case "nameAsc":
                    AddOrderBy(p => p.CampaignType);
                    break;

                case "nameDesc":
                    AddOrderByDescending(p => p.CampaignType);
                    break;

                default:
                    AddOrderBy(p => p.CampaignType);
                    break;
                }
            }
        }