public IActionResult SaveUpdateJobDescription(JobDescription jobDescription, string returnUrl) { if (jobDescription.IsNew) { if (DbContext.JobDescription.Create(jobDescription) > 0) { ShowSavedSuccessfullyToast(); } else { ShowTaskFailedToast(); }; } else { if (DbContext.JobDescription.Update(jobDescription)) { ShowToastNotification("Job Description Updated", ToastEnums.ToastType.Success); } else { ShowTaskFailedToast(); }; } return Redirect(returnUrl); }
public IActionResult GetFormForJobDescriptionSaveAndUpdate(long id, long experienceId, string returnUrl) { ViewBag.ReturnUrl = returnUrl; var jobDescription = new JobDescription { ExperienceId = experienceId }; if (id > 0) { jobDescription = DbContext.JobDescription.Get(id); } return PartialView("_JobDescriptionForm", jobDescription); }