public JsonResult getPatientInfo(long user_id) { PatientLogin pl = new PatientLogin(); user_info_table user = pl.getUserById(user_id); if (user == null) { return Json(new { code = 0, msg = "用户不存在" }, JsonRequestBehavior.AllowGet); } return Json(new { code = 1, msg = user }, JsonRequestBehavior.AllowGet); }
public JsonResult updatePInfo(user_info_table user) { PatientLogin pl = new PatientLogin(); user_info_table temp = pl.getUserById(user.user_id); if (temp != null) { pl.updateUser(user); return Json(new { code = 1, msg = "修改成功" }, JsonRequestBehavior.AllowGet); } return Json(new { code = 0, msg = "指定用户不存在" }, JsonRequestBehavior.AllowGet); }