public ActionResult DeleteConfirmed(int id) { TemporaryCV temporaryCV = CandidatesService.Get(id); CandidatesService.RemoveByEntity(temporaryCV); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "TemporaryCVId,CandidateName,CVLink,IntervieweeScore,HireThreadId,Status")] TemporaryCV temporaryCV) { if (ModelState.IsValid) { CandidatesService.Update(temporaryCV, temporaryCV.TemporaryCVId); return(RedirectToAction("Index")); } return(View(temporaryCV)); }
// GET: TemporaryCVs/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TemporaryCV temporaryCV = CandidatesService.Get(id); if (temporaryCV == null) { return(HttpNotFound()); } return(View(temporaryCV)); }
public virtual async Task <bool> AssignCandidatesToInterview(int interviewId, string candidateIdsList) { try { InterviewRepository iRepo = new InterviewRepository(); IntervieweeRepository iCRepo = new IntervieweeRepository(); TemporaryCVRepository tCVRepo = new TemporaryCVRepository(); var idList = candidateIdsList.Trim().Split(','); int newCapacity = 0; foreach (var tempId in idList) { if (tempId != null && tempId.Trim() != "") { int id = Int32.Parse(tempId); await iCRepo.Insert(new Interviewee { InterviewId = interviewId, IntervieweeId = id }); TemporaryCV temp = tCVRepo.Get(id).Result; temp.Status = "assigned"; await tCVRepo.Update(temp, id); newCapacity += 1; } } Interview tempInter = iRepo.Get(interviewId).Result; tempInter.NumberOfCandidatesAssigned += newCapacity; await iRepo.Update(tempInter, tempInter.InterviewId); return(true); } catch (Exception e) { Console.WriteLine(e); return(false); } }