Exemple #1
0
 public Applicant(ApplicantVM applicantVm, Post postX)
 {
     FullName       = applicantVm.FullName;
     IdNumber       = applicantVm.INumber;
     PhoneNumber    = applicantVm.PhoneNumber;
     Email          = applicantVm.Email;
     City           = applicantVm.City;
     Specialization = applicantVm.Specialization;
     Skill          = applicantVm.Skill;
     Gender         = applicantVm.Gender;
     DateOfBirth    = applicantVm.DateOfBirth;
     post           = postX;
     Gpa            = applicantVm.Gpa;
 }
Exemple #2
0
        public async Task AddApplicant(ApplicantVM vm, Post post)
        {
            var ap = new Applicant(vm, post)
            {
                isAccepted = false
            };

            //var filePath = Path.GetTempFileName() + Path.GetExtension(vm.Cv.FileName);
            //if (vm.Cv.Length > 0)
            //{
            //    using (var stream = new FileStream(filePath, FileMode.Create))
            //    {
            //        await vm.Cv.CopyToAsync(stream);
            //        ap.CvPath = filePath;
            //    }
            //}

            _context.Applicants.Add(ap);
            await _context.SaveChangesAsync();
        }