コード例 #1
0
        public void AddTechJobOpening(Guid recruiterId, TechJobOpening techJobOpening)
        {
            if (recruiterId == Guid.Empty)
            {
                throw new ArgumentNullException(nameof(recruiterId));
            }

            if (techJobOpening == null)
            {
                throw new ArgumentNullException(nameof(techJobOpening));
            }

            techJobOpening.Id        = Guid.NewGuid();
            techJobOpening.CreatedOn = DateTimeOffset.Now;
            techJobOpening.CreatedBy = recruiterId;
            techJobOpening.UpdatedOn = DateTimeOffset.Now;
            techJobOpening.UpdatedBy = recruiterId;
            _context.TechJobOpenings.Add(techJobOpening);
        }
コード例 #2
0
 private void ApplyUpdateToEntity(TechJobOpening techJobOpeningFromRepo, TechJobOpeningForUpdateDto techJobOpeningUpdate)
 {
     techJobOpeningFromRepo.StartingDate       = techJobOpeningUpdate.StartingDate;
     techJobOpeningFromRepo.Title              = techJobOpeningUpdate.Title;
     techJobOpeningFromRepo.JobTechLanguage    = techJobOpeningUpdate.JobTechLanguage.ToJobTechLanguage();
     techJobOpeningFromRepo.JobPosition        = techJobOpeningUpdate.JobPosition.ToPosition();
     techJobOpeningFromRepo.Seniority          = techJobOpeningUpdate.Seniority.ToSeniority();
     techJobOpeningFromRepo.ContractType       = techJobOpeningUpdate.ContractType.ToContractType();
     techJobOpeningFromRepo.RemoteWorkAccepted = techJobOpeningUpdate.RemoteWorkAccepted;
     techJobOpeningFromRepo.MissionDescription = techJobOpeningUpdate.MissionDescription;
     techJobOpeningFromRepo.City            = techJobOpeningUpdate.City;
     techJobOpeningFromRepo.PostCode        = techJobOpeningUpdate.PostCode;
     techJobOpeningFromRepo.Country         = techJobOpeningUpdate.Country.ToCountry();
     techJobOpeningFromRepo.MinimumSalary   = techJobOpeningUpdate.MinimumSalary;
     techJobOpeningFromRepo.MaximumSalary   = techJobOpeningUpdate.MaximumSalary;
     techJobOpeningFromRepo.Reward          = techJobOpeningUpdate.Reward;
     techJobOpeningFromRepo.BonusReward     = techJobOpeningUpdate.BonusReward;
     techJobOpeningFromRepo.PictureFileName = techJobOpeningUpdate.PictureFileName;
     techJobOpeningFromRepo.RseDescription  = techJobOpeningUpdate.RseDescription;
 }
コード例 #3
0
 public static TechJobOpeningDto ToDto(this TechJobOpening source)
 {
     return(new TechJobOpeningDto()
     {
         Id = source.Id,
         CreatedOn = source.CreatedOn,
         ClosingDate = source.ClosingDate,
         StartingDate = source.StartingDate,
         Title = source.Title,
         CompanyId = source.CompanyId,
         CompanyName = source.Company.Name,
         CompanyCategory = source.Company.Category.ToString(),
         CreatedById = source.CreatedBy,
         RecruiterFirstName = source.CreatedByFirstName,
         RecruiterLastName = source.CreatedByLastName,
         RecruiterPosition = source.CreatedByPosiion.ToString(),
         JobTechLanguage = source.JobTechLanguage.ToString(),
         JobPosition = source.JobPosition.ToString(),
         Seniority = source.Seniority.ToString(),
         ContractType = source.ContractType.ToString(),
         RemoteWorkAccepted = source.RemoteWorkAccepted,
         MissionDescription = source.MissionDescription,
         City = source.City.ToString(),
         PostCode = source.PostCode,
         Country = source.Country.ToString(),
         Reward = source.Reward,
         BonusReward = source.BonusReward,
         LikesNb = source.LikesNb,
         RekommendationsNb = source.RekommendationsNb,
         ViewsNb = source.ViewsNb,
         MinimumSalary = source.MinimumSalary,
         MaximumSalary = source.MaximumSalary,
         Status = source.Status,
         PictureFileName = source.PictureFileName,
         RseDescription = source.RseDescription,
         Rekommendations = ToRekommendationDtoCollection(source.Rekommendations)
     });
 }
コード例 #4
0
 public static TechJobOpeningForUpdateDto ToUpdateDto(this TechJobOpening source)
 {
     return(new TechJobOpeningForUpdateDto()
     {
         StartingDate = source.StartingDate,
         Title = source.Title,
         JobTechLanguage = source.JobTechLanguage.ToString(),
         JobPosition = source.JobPosition.ToString(),
         Seniority = source.Seniority.ToString(),
         ContractType = source.ContractType.ToString(),
         RemoteWorkAccepted = source.RemoteWorkAccepted,
         MissionDescription = source.MissionDescription,
         City = source.City.ToString(),
         PostCode = source.PostCode,
         Country = source.Country.ToString(),
         MinimumSalary = source.MinimumSalary,
         MaximumSalary = source.MaximumSalary,
         Reward = source.Reward,
         BonusReward = source.BonusReward,
         PictureFileName = source.PictureFileName,
         RseDescription = source.RseDescription
     });
 }
コード例 #5
0
 public void DeleteTechJobOpening(TechJobOpening techJobOpening)
 {
     _context.TechJobOpenings.Remove(techJobOpening);
 }
コード例 #6
0
        //public void RecomputeXpAndRekoAvgFromRekommender(Guid rekommenderId)
        //{
        //    //var rekommender = _context.Rekommenders.FirstOrDefault(a => a.Id == rekommenderId);
        //    if (rekommender != null)
        //    {
        //        IEnumerable<Rekommendation> rekommendationsList = _context.Rekommendations.Where(a => a.RekommenderId == rekommenderId)
        //            .Where(a => a.Status != RekommendationStatus.EmailToBeVerified);
        //        int totalRekoGrade = 0;
        //        int rekommenderXp = 0;
        //        int rekommendationsCount = 0;
        //        foreach(Rekommendation rekommendation in rekommendationsList)
        //        {
        //            if (rekommendation.Grade != -1)
        //            {
        //                totalRekoGrade += rekommendation.Grade;
        //                rekommendationsCount++;
        //            }
        //                switch (rekommendation.Status)
        //            {
        //                case RekommendationStatus.NotViewed:
        //                case RekommendationStatus.Viewed:
        //                    rekommenderXp += 2;
        //                    break;
        //                case RekommendationStatus.Selected:
        //                    rekommenderXp += 8;
        //                    break;
        //                case RekommendationStatus.Accepted:
        //                    rekommenderXp += 20;
        //                    break;
        //                case RekommendationStatus.Rejected:
        //                case RekommendationStatus.Undefined:
        //                default:
        //                    rekommenderXp += 0;
        //                    break;
        //            }
        //        }
        //rekommender.XpRekommend = rekommenderXp;
        //var avgRekoGrade = (double)totalRekoGrade / rekommendationsCount;
        //rekommender.RekommendationsAvgGrade = (int) Math.Round(avgRekoGrade, MidpointRounding.AwayFromZero);
        //}
        //}

        public void UpdateTechJobOpening(TechJobOpening techJobOpening)
        {
            // No code necessary in this implementation
        }