public async Task <IActionResult> DeleteMThrmssourcing([FromRoute] long id) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var mThrmssourcing = await _context.MThrmssourcing.FindAsync(id); if (mThrmssourcing == null) { return(NotFound()); } var _candidate = new MThrmscvrepository() { MThrmscvrepositoryId = (long)mThrmssourcing.CandidateId, Status = "available" }; using (var newContext = new AMTDEVContext()) { newContext.MThrmscvrepository.Attach(_candidate); newContext.Entry(_candidate).Property(X => X.Status).IsModified = true; newContext.SaveChanges(); } var _shortlistrecord = new MThrmsshortlist() { SourcingId = (long)mThrmssourcing.MThrmssourcingId }; // using (var newContext = new AMTDEVContext()) // { // //newContext.MThrmsshortlist.Attach(_shortlistrecord); _context.MThrmsshortlist.Attach(_shortlistrecord); _context.Remove(_shortlistrecord); // newContext.SaveChanges();MIL // } _context.MThrmssourcing.Remove(mThrmssourcing); await _context.SaveChangesAsync(); return(Ok(mThrmssourcing)); }
public async Task <IActionResult> PostMThrmssourcing([FromBody] MThrmssourcing mThrmssourcing) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.MThrmssourcing.Add(mThrmssourcing); await _context.SaveChangesAsync(); var _candidate = new MThrmscvrepository() { MThrmscvrepositoryId = (long)mThrmssourcing.CandidateId, Status = "sourcing" }; using (var newContext = new AMTDEVContext()) { newContext.MThrmscvrepository.Attach(_candidate); newContext.Entry(_candidate).Property(X => X.Status).IsModified = true; newContext.SaveChanges(); } var _shortlistrecord = new MThrmsshortlist() { MThrmsshortlistId = 0, ManPowerId = mThrmssourcing.ManPowerId, DesignationId = mThrmssourcing.DesignationId, ResourceRequisitionId = mThrmssourcing.ResourceRequisitionId, JobCode = mThrmssourcing.JobCode, ResourceAllocationId = mThrmssourcing.ResourceAllocationId, RecruiterId = mThrmssourcing.RecruiterId, SourcingId = mThrmssourcing.MThrmssourcingId, CandidateId = mThrmssourcing.CandidateId }; using (var newContext = new AMTDEVContext()) { newContext.MThrmsshortlist.Add(_shortlistrecord); newContext.SaveChanges(); } return(CreatedAtAction("GetMThrmssourcing", new { id = mThrmssourcing.MThrmssourcingId }, mThrmssourcing)); }
public async Task <IActionResult> PutMThrmsresourceAllocation2([FromRoute] long id, [FromRoute] long recr) { // if (!ModelState.IsValid) // { // return BadRequest(ModelState); // } // if (id != mThrmsresourceAllocation.MThrmsresourceAllocationId) // { // return BadRequest(); // } // _context.Entry(mThrmsresourceAllocation).State = EntityState.Modified; // try // { // await _context.SaveChangesAsync(); // } // catch (DbUpdateConcurrencyException) // { // if (!MThrmsresourceAllocationExists(id)) // { // return NotFound(); // } // else // { // throw; // } // } // return CreatedAtAction("GetMThrmsresourceAllocation", mThrmsresourceAllocation.MThrmsresourceAllocationId, mThrmsresourceAllocation); AMTDEVContext _context = new AMTDEVContext(); var user = new MThrmsresourceAllocation { MThrmsresourceAllocationId = id, RecruiterId = recr }; _context.MThrmsresourceAllocation.Attach(user).Property(x => x.RecruiterId).IsModified = true; await _context.SaveChangesAsync(); return(CreatedAtAction("GetMThrmsresourceAllocation", user.MThrmsresourceAllocationId, user)); }
public MThrmsresourceRequisitionsController(AMTDEVContext context) { _context = context; }
public MThrmsfiletestsController(AMTDEVContext context) { _context = context; }
public MThrmsmanPowerBudgetsController(AMTDEVContext context) { _context = context; }
public MThrmscvrepositoriesController(AMTDEVContext context) { _context = context; }
public MThrmsonboardingsController(AMTDEVContext context) { _context = context; }
public MThrmsresourceAllocationsController(AMTDEVContext context) { _context = context; }
public MThrmsofferLettersController(AMTDEVContext context) { _context = context; }
public MThrmsshortlistsController(AMTDEVContext context) { _context = context; }
public MThrmsinterviewFeedbacksController(AMTDEVContext context) { _context = context; }
public MThrmsdesignationInventoriesController(AMTDEVContext context) { _context = context; }
public MThrmscandidateEntriesController(AMTDEVContext context) { _context = context; }
public MThrmsdesignationsController(AMTDEVContext context) { _context = context; }
public MThrmsinterviewChecklistEvaluationsController(AMTDEVContext context) { _context = context; }
public MThrmsattendancesController(AMTDEVContext context) { _context = context; }
public MThrmscompaniesController(AMTDEVContext context) { _context = context; }
public MThrmsbranchesController(AMTDEVContext context) { _context = context; }
public MThrmschecklistItemsController(AMTDEVContext context) { _context = context; }
public MThrmssourcingsController(AMTDEVContext context) { _context = context; }
public MThrmsinterviewScheduleRoundDetailsController(AMTDEVContext context) { _context = context; }
public MThrmsemployeesController(AMTDEVContext context) { _context = context; }
public MThrmsdepartmentsController(AMTDEVContext context) { _context = context; }
public MThrmsinventoriesController(AMTDEVContext context) { _context = context; }
public MThrmsinventoryManagementDetailsController(AMTDEVContext context) { _context = context; }
public MThrmsinterviewRoundsDefinitionsController(AMTDEVContext context) { _context = context; }