示例#1
0
        public static string ToHumanReadable(this JobOfferTypeEnum jobType)
        {
            switch (jobType)
            {
            case JobOfferTypeEnum.Normal:
                return("normal");

            case JobOfferTypeEnum.Contract:
                return("contract");

            case JobOfferTypeEnum.Both:
                return("both");

            default:
#if DEBUG
                throw new NotImplementedException();
#else
                return(jobType.ToString());
#endif
            }
        }
示例#2
0
        private void PayJobOfferFee(Company company, Country country, JobOfferTypeEnum offerType, double offerAmount, int currencyID, decimal price)
        {
            transactionService.PayForJobOffer(company, country, currencyID, price);

            companyFinanceSummaryService.AddFinances(company, new JobOfferCostFinance(price, currencyID));
        }
示例#3
0
        public PartialViewResult Offers(int countryID, double minSkill, double maxSkill, double minSalary, double maxSalary, bool?sameRegion, JobOfferTypeEnum offerType, WorkTypeEnum workTypeID, PagingParam pagingParam)
        {
            pagingParam = pagingParam ?? new PagingParam();

            var offers = jobOfferRepository.Where(o => o.CountryID == countryID);

            if (offerType != JobOfferTypeEnum.Both)
            {
                offers = offers.Where(o => o.TypeID == (int)offerType);
            }
            if (workTypeID != WorkTypeEnum.Any)
            {
                offers = offers.Where(o => o.Company.WorkTypeID == (int)workTypeID);
            }
            //if (minSkill.HasValue)
            offers = offers.Where(o => o.MinSkill >= (decimal)minSkill);
            // if (maxSkill.HasValue)
            offers = offers.Where(o => o.MinSkill <= (decimal)maxSkill);
            //if (minSalary.HasValue)
            offers = offers.Where(o => o.NormalJobOffer.Salary >= (decimal)minSalary || o.ContractJobOffer.MinSalary >= (decimal)minSalary);
            //if(maxSalary.HasValue)
            offers = offers.Where(o => o.NormalJobOffer.Salary <= (decimal)maxSalary || o.ContractJobOffer.MinSalary <= (decimal)maxSalary);

            if (sameRegion == true)
            {
                int?regionID = SessionHelper.CurrentEntity.GetCurrentRegion()?.ID;
                offers = offers.Where(o => o.Company.RegionID == regionID);
            }


            JobOffersDOMSelector selector = new JobOffersDOMSelector();

            IList <JobOfferDOM> processed = offers
                                            .Apply(selector)
                                            .OrderByDescending(o => o.NormalSalary)
                                            .Apply(pagingParam)
                                            .ToList();

            var vm = new JobMarketOfferListViewModel(processed, countryID, (int)workTypeID, (int)offerType, minSalary, maxSalary, minSkill, maxSkill,
                                                     includeRegionInformation: sameRegion != true, pagingParam: pagingParam);

            return(PartialView(vm));
        }