Esempio n. 1
0
 public void AddApprovedJobsToStaffMember(StaffMemberEntity staffMember, List <int> jobIds)
 {
     foreach (int id in jobIds)
     {
         if (!jobRepository.JobExists(id))
         {
             throw new KeyNotFoundException($"No job with the ID of {id} was found");
         }
         else if (!jobRepository.JobIsAssigned(id, staffMember.Id))
         {
             JobEntity job = jobRepository.GetJob(id);
             jobRepository.AddApprovedJobForStaffMember(job, staffMember);
         }
     }
     UtilityMethods.VerifyDatabaseSaveSuccess(jobRepository);
 }