public ActionResult UpdatePerson(Person person)
        {
            if (person != null)
            {
                if (service.UpdatePerson(person))
                    TempData["Status"] = "Person successfully updated!";
            }

            return RedirectToAction("Index");
        }
 public ActionResult AddPerson(Person person)
 {
     if (person != null)
     {
         if (service.AddPerson(person))
         {
             TempData["Status"] = "Person successfully added!";
         }
     }
     return RedirectToAction("Index");
 }
 public bool AddPerson(Person person)
 {
     db.Persons.Add(person);
     return db.SaveChanges() == 1 ? true : false;
 }
 public bool UpdatePerson(Person person)
 {
     db.Entry(person).State = EntityState.Modified;
     return db.SaveChanges() == 1 ? true : false;
 }
 public HttpResponseMessage Post(Person person)
 {
     return service.UpdatePerson(person)
         ? new HttpResponseMessage(HttpStatusCode.OK) : new HttpResponseMessage(HttpStatusCode.BadRequest);
 }