public async Task <IActionResult> Signup([Bind("Id,Name,Email,Password,UniversityName,UniversityMajor,GraduationYear,Phone,LinkedInAccount,Address")] Op_Candidates op_Candidates)
        {
            if (ModelState.IsValid)
            {
                _context.Add(op_Candidates);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Login"));
            }
            return(View(op_Candidates));
        }
Пример #2
0
 public bool AddCandidate(Op_Candidates candidate)
 {
     try
     {
         db.Candidates.Add(candidate);
         db.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         Console.WriteLine(e.Message);
         return(false);
     }
 }
Пример #3
0
 public bool EditCandidate(Op_Candidates newCandidate)
 {
     try
     {
         var oldData = db.Candidates.Find(newCandidate.Id);
         oldData = newCandidate;
         db.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         Console.WriteLine(e.Message);
         return(false);
     }
 }
Пример #4
0
 public IEnumerable <Op_Application> GetCandidateApplications(Op_Candidates candidate)
 {
     return(db.Applications.Where(a => a.CandidateId == candidate.Id));
 }