public IActionResult OnPost(int jobId) { var job = jobData.Delete(jobId); jobData.Commit(); if (job == null) { return(RedirectToPage("./NotFound")); } TempData["Message"] = $"{job.Name} deleted"; return(RedirectToPage("./List")); }
public IActionResult OnPost() { if (!ModelState.IsValid) { Departments = htmlHelper.GetEnumSelectList <DepartmentType>(); return(Page()); } if (Job.Id > 0) { jobData.Update(Job); } else { jobData.Add(Job); } jobData.Commit(); TempData["Message"] = "Restaurant saved!"; return(RedirectToPage("./Detail", new { jobId = Job.Id })); }