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)); }
public bool AddCandidate(Op_Candidates candidate) { try { db.Candidates.Add(candidate); db.SaveChanges(); return(true); } catch (Exception e) { Console.WriteLine(e.Message); return(false); } }
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); } }
public IEnumerable <Op_Application> GetCandidateApplications(Op_Candidates candidate) { return(db.Applications.Where(a => a.CandidateId == candidate.Id)); }