public JsonNetResult Create(Job job) { //TODO: Figure out why Attepmts thinks its required ModelState.Remove("Attempts"); if (ModelState.IsValid) { db.Jobs.Add(job); db.SaveChanges(); return new JsonNetResult(new JobCreationResult() { CreationSuccessful = true, Job = job, Message = "Job Created Successfully" }); } else { return this.ErrorResult(); } }
public ActionResult Edit(Job job) { if (ModelState.IsValid) { db.Entry(job).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(job); }