public ActionResult DeleteConfirmed(byte id) { ApplicantJob applicantJob = _context.ApplicantJob.Find(id); _context.ApplicantJob.Remove(applicantJob); _context.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ApplicantId,JobId")] ApplicantJob applicantJob) { if (ModelState.IsValid) { _context.Entry(applicantJob).State = EntityState.Modified; _context.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ApplicantId = new SelectList(_context.Applicants, "ApplicantId", "FirstName", applicantJob.ApplicantId); ViewBag.JobId = new SelectList(_context.Jobs, "JobId", "JobName", applicantJob.JobId); return(View(applicantJob)); }
public ActionResult Details(byte?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ApplicantJob applicantJob = _context.ApplicantJob.Find(id); if (applicantJob == null) { return(HttpNotFound()); } return(View(applicantJob)); }
public async Task <ActionResult> Delete(int id, ApplicantJob applicantJob) { try { // TODO: Add delete logic here _context.ApplicantJob.Remove(applicantJob); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }
public ActionResult Edit(byte?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ApplicantJob applicantJob = _context.ApplicantJob.Find(id); if (applicantJob == null) { return(HttpNotFound()); } ViewBag.ApplicantId = new SelectList(_context.Applicants, "ApplicantId", "FirstName", applicantJob.ApplicantId); ViewBag.JobId = new SelectList(_context.Jobs, "JobId", "JobName", applicantJob.JobId); return(View(applicantJob)); }
public async Task <ActionResult> Create(int id) { try { // TODO: Add insert logic here var user = await GetCurrentUserAsync(); var jobApplication = new ApplicantJob { ApplicantId = user.ApplicantId, JobId = id }; _context.Add(jobApplication); await _context.SaveChangesAsync(); return(RedirectToAction("Index", "Applicant")); } catch { return(View()); } }