public JsonResult PesquisarPacienteS2(string q) { DataS2ViewModel data = new DataS2ViewModel(); try { data.items = _agendaService.PesquisarPacienteS2(q); data.responseText = (int)HttpStatusCode.OK; } catch (Exception ex) { Response.StatusCode = (int)HttpStatusCode.BadRequest; data.responseText = (int)HttpStatusCode.BadRequest; return(Json(ex.Message, JsonRequestBehavior.AllowGet)); } return(Json(data, JsonRequestBehavior.AllowGet)); }