public async Task <IActionResult> Edit(int id, [Bind("NotificationID,UserID,Date,Description,Type")] Notification notification) { if (id != notification.NotificationID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(notification); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!NotificationExists(notification.NotificationID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["UserID"] = new SelectList(_context.Candidates, "UserID", "FullName", notification.UserID); ViewData["UserID"] = new SelectList(_context.Employers, "UserID", "Company", notification.UserID); return(View(notification)); }
public async Task <IActionResult> Edit(int id, [Bind("ResumeID,UserID,Language,Email,Phone,HighestEducation,WorkExperience,Skills")] Resume resume) { if (id != resume.ResumeID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(resume); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ResumeExists(resume.ResumeID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["UserID"] = new SelectList(_context.Candidates, "UserID", "FullName", resume.UserID); return(View(resume)); }
public async Task <IActionResult> Edit(int id, [Bind("UserID,FullName,Email,PhoneNumber")] Candidate candidate) { if (id != candidate.UserID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(candidate); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CandidateExists(candidate.UserID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(candidate)); }
public async Task <IActionResult> Edit(int id, [Bind("SavedSearchID,CandidateID,EmployerID,SearchedTerm")] SavedSearch savedSearch) { if (id != savedSearch.SavedSearchID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(savedSearch); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SavedSearchExists(savedSearch.SavedSearchID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(savedSearch)); }
public async Task <IActionResult> Edit(int id, [Bind("ApplicationID,Date,Coverletter,JobPostingID,UserID,ResumeID")] JobApplication jobApplication) { if (id != jobApplication.ApplicationID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(jobApplication); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!JobApplicationExists(jobApplication.ApplicationID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["UserID"] = new SelectList(_context.Candidates, "UserID", "FullName", jobApplication.UserID); ViewData["JobPostingID"] = new SelectList(_context.JobPostings, "JobPostingID", "JobPostingID", jobApplication.JobPostingID); ViewData["ResumeID"] = new SelectList(_context.Resumes, "ResumeID", "ResumeID", jobApplication.ResumeID); return(View(jobApplication)); }
public async Task <IActionResult> Edit(int id, [Bind("JobPostingID,Company,Description,CompanyAddress,Email,Salary,UserID")] JobPosting jobPosting) { if (id != jobPosting.JobPostingID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(jobPosting); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!JobPostingExists(jobPosting.JobPostingID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["UserID"] = new SelectList(_context.Employers, "UserID", "Company", jobPosting.UserID); return(View(jobPosting)); }
public async Task <IActionResult> Edit(int id, [Bind("JobCreatedID,UserID,JobPostingID")] JobCreated jobCreated) { if (id != jobCreated.JobCreatedID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(jobCreated); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!JobCreatedExists(jobCreated.JobCreatedID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(jobCreated)); }
public async Task <IActionResult> Edit(int id, [Bind("UserID,FullName,Company,JobTitle,Email,Phone,YearEstablished,Biography")] Employer employer) { if (id != employer.UserID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(employer); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EmployerExists(employer.UserID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(employer)); }