public int UpdateRequisitionToApplicantStaffing(TblApplicantRequisitionStaffing tblApplicantRequisition) { tblApplicantRequisition.ModifiedBy = CurrentContext.EmployeeID; tblApplicantRequisition.ModifiedDate = DateTime.Now; tblApplicantRequisition.Applicant = null; dbContext.Entry(tblApplicantRequisition).State = EntityState.Modified; dbContext.TblApplicantRequisitionStaffing.Update(tblApplicantRequisition); dbContext.SaveChanges(); dbContext.Entry(tblApplicantRequisition).State = EntityState.Detached; TblApplicants tblApplicants = dbContext.TblApplicants.AsNoTracking().Where(r => r.ApplicantId == tblApplicantRequisition.ApplicantId).FirstOrDefault(); if (tblApplicantRequisition.Status == InterviewStatus.BlackListed) { tblApplicants.Status = ApplicantStatus.BlackListed; } else if (tblApplicantRequisition.Status == InterviewStatus.Selected) { tblApplicants.Status = ApplicantStatus.Selected; } else { tblApplicants.Status = ApplicantStatus.Available; } dbContext.Entry(tblApplicants).State = EntityState.Modified; dbContext.TblApplicants.Update(tblApplicants); dbContext.SaveChanges(); dbContext.Entry(tblApplicants).State = EntityState.Detached; return(1); }
public int UpdateRequisitionStaffingToApplicant(TblApplicantRequisitionStaffing tblApplicantRequisition) { return(RequisitionStaffingDAL.UpdateRequisitionToApplicantStaffing(tblApplicantRequisition)); }
public IActionResult Requisition([FromBody] TblApplicantRequisitionStaffing tblApplicantRequisition) { return(Ok(_requisitionstaffing.UpdateRequisitionStaffingToApplicant(tblApplicantRequisition))); }