Beispiel #1
0
 public IEnumerable <Candidate> GetPendingCandidates()
 {
     using (var context = new CTContext(_conn))
     {
         return(context.Candidates.Where(c => c.Status == 0).ToList());
     }
 }
Beispiel #2
0
 public int GetDeclinedAmount()
 {
     using (var context = new CTContext(_conn))
     {
         return(GetDeclinedCandidates().Count());
     }
 }
Beispiel #3
0
 public int GetPendingAmount()
 {
     using (var context = new CTContext(_conn))
     {
         return(GetPendingCandidates().Count());
     }
 }
Beispiel #4
0
 public Candidate GetCandidateById(int id)
 {
     using (var context = new CTContext(_conn))
     {
         return(context.Candidates.FirstOrDefault(c => c.Id == id));
     }
 }
Beispiel #5
0
 public void DeclineCandidate(int id)
 {
     using (var context = new CTContext(_conn))
     {
         var candidate = context.Candidates.FirstOrDefault(c => c.Id == id);
         candidate.Status = 2;
         context.Candidates.Update(candidate);
         context.SaveChanges();
     }
 }
Beispiel #6
0
 public void AddCandidate(Candidate c)
 {
     using (var context = new CTContext(_conn))
     {
         var candidate = new Candidate
         {
             Name   = c.Name,
             Email  = c.Email,
             Number = c.Number,
             Notes  = c.Notes,
             Status = 0
         };
         context.Candidates.Add(candidate);
         context.SaveChanges();
     }
 }