public JsonResult Delete(int personId) { string errorMessage; PersonInfoDb.Delete(GetUserId(), personId, out errorMessage); if (errorMessage == null) { return(Json("Success", JsonRequestBehavior.AllowGet)); } else { return(Json(errorMessage, JsonRequestBehavior.AllowGet)); } }
public JsonResult GetSingle(int personId) { string errorMessage; PersonInfo person = PersonInfoDb.GetSingle(GetUserId(), personId, out errorMessage); if (errorMessage == null) { return(Json(person, JsonRequestBehavior.AllowGet)); } else { return(Json(errorMessage, JsonRequestBehavior.AllowGet)); } }
public JsonResult Add(PersonInfo person) { string errorMessage; int personId = PersonInfoDb.Add(GetUserId(), person, out errorMessage); if (errorMessage == null) { return(Json(personId, JsonRequestBehavior.AllowGet)); } else { return(Json(errorMessage, JsonRequestBehavior.AllowGet)); } }
public ActionResult GetAll() { string errorMessage; List <PersonInfo> list = PersonInfoDb.GetAll(GetUserId(), out errorMessage); if (errorMessage == null) { ViewBag.UserName = GetUserName(); ViewBag.CreatedDate = GetCreatedDate(); return(View("AddressBook", list)); } else { return(Json(errorMessage, JsonRequestBehavior.AllowGet)); } }
public ActionResult GetAll() { RequestToApplicationUtility.LogRequest(1, string.Format("GetAll (user {0}): ", GetUserName()), this.Request.Headers); string errorMessage; List <PersonInfo> list = PersonInfoDb.GetAll(GetUserId(), out errorMessage); if (errorMessage == null) { ViewBag.UserName = GetUserName(); ViewBag.CreatedDate = GetCreatedDate(); return(View("AddressBook", list)); } else { return(Json(errorMessage, JsonRequestBehavior.AllowGet)); } }