Exemplo n.º 1
0
 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();
     }
 }
Exemplo n.º 2
0
 public ActionResult Edit(Job job)
 {
     if (ModelState.IsValid)
     {
         db.Entry(job).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(job);
 }