Ejemplo n.º 1
0
        public static List <string> NewJobsCoordinationDto(int idJob, List <FullGraduateDto> fullGraduateDtos, int userId, string byEmail, string password, string url)
        {
            JobDto job = JobManager.JobById(idJob);
            List <CoordinatingJobsForGraduates> coordinatingJobs = new List <CoordinatingJobsForGraduates>();

            foreach (FullGraduateDto graduate in fullGraduateDtos)
            {
                coordinatingJobs.Add(
                    new CoordinatingJobsForGraduates()
                {
                    candidateId     = graduate.Id,
                    jobId           = idJob,
                    placementStatus = 1,
                    dateReceived    = DateTime.Now,
                    lastUpdateDate  = DateTime.Now
                });
            }
            coordinatingJobs = JobsCoordinationManager.NewJobsCoordination(coordinatingJobs);

            for (int i = 0; i < coordinatingJobs.Count; i++)
            {
                if (fullGraduateDtos[i].Id == coordinatingJobs[i].candidateId)
                {
                    coordinatingJobs[i].Graduate =
                        new Graduate()
                    {
                        firstName = fullGraduateDtos[i].firstName,
                        linkToCV  = fullGraduateDtos[i].linkToCV,
                        email     = fullGraduateDtos[i].email
                    };
                }
                coordinatingJobs[i].Job = new Job()
                {
                    description = job.description,
                    title       = job.title
                };
            }

            MailManager mail    = new MailManager(byEmail, password, url);
            var         errList = mail.sendjobOfferToGraduates(coordinatingJobs, userId);

            //delete JobsCoordination feild sending offer and return
            JobsCoordinationManager.DeleteJobsCoordination(errList.Select(crd => crd.Id).ToList());
            return(errList.Select(crd => $"{crd.Graduate.firstName} {crd.Graduate.lastName}").ToList());
        }
Ejemplo n.º 2
0
        public static List <FullGraduateDto> sendingCandidateToContact(string massege, List <CoordinatingJobsForGraduatesDto> coordinatings, int userId, string byEmail, string password, string fldCVPath)
        {
            List <FullGraduateDto> graduates = GraduateManager.GraduateListById(
                coordinatings.Select(c => c.candidateId).ToList());

            List <string> detailes = JobManager.get0TitleAnd1ContactMailOfJobById(coordinatings[0].jobId);

            MailManager mail = new MailManager(byEmail, password, fldCVPath);

            graduates = mail.sendCVCandidateToContact(detailes[0], massege, graduates, detailes[1], userId);

            coordinatings.RemoveAll(c => graduates.Any(g => g.Id == c.candidateId));

            JobsCoordinationManager.JobsCoordinationUpdate(
                coordinatings.Select(c => c.Id).ToList()
                , 3); //send CV
            JobManager.JobUpdate(coordinatings[0].jobId, true);

            return(graduates);
        }