コード例 #1
0
        public JsonResult Get()
        {
            UsuarioModel     usuarioQuery = new UsuarioModel(new Usuario());
            ResponseMenssage response     = new ResponseMenssage("success", usuarioQuery.GetUsuarios());

            return(new JsonResult(response));
        }
コード例 #2
0
        public HttpResponseMessage Get(int id)
        {
            Region region = new Region();

            // se genera formato de salida
            var jsonFormatter = new JsonMediaTypeFormatter();

            jsonFormatter.SerializerSettings.DateFormatHandling = Newtonsoft.Json.DateFormatHandling.MicrosoftDateFormat;
            jsonFormatter.SerializerSettings.NullValueHandling  = Newtonsoft.Json.NullValueHandling.Ignore;
            jsonFormatter.SerializerSettings.ContractResolver   = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver();
            jsonFormatter.SerializerSettings.Culture            = new System.Globalization.CultureInfo("en-US");


            if (region.ReadById(id))
            {
                // se crea mensaje de respuesta
                ResponseMenssage response = new ResponseMenssage("success", region);
                return(Request.CreateResponse(HttpStatusCode.OK, response, jsonFormatter));
            }
            else
            {
                ResponseMenssage response = new ResponseMenssage("error", "recurso no encontrado");
                return(Request.CreateResponse(HttpStatusCode.OK, response, jsonFormatter));
            }
        }
コード例 #3
0
        public JsonResult Get()
        {
            ProvinciaModel provinciaQuery = new ProvinciaModel(new Provincia());

            ResponseMenssage response = new ResponseMenssage("success", provinciaQuery.GetProvincias());

            return(new JsonResult(response));
        }
コード例 #4
0
        public JsonResult Get()
        {
            RegionModel regionQuery = new RegionModel(new Region());

            ResponseMenssage response = new ResponseMenssage("success", regionQuery.GetRegions());

            return(new JsonResult(response));
        }
コード例 #5
0
        public JsonResult Get()
        {
            ServicioTuristicoModel servicio_turisticoQuery = new ServicioTuristicoModel(new ServicioTuristico());

            ResponseMenssage response = new ResponseMenssage("success", servicio_turisticoQuery.GetServicioTuristicos());

            return(new JsonResult(response));
        }
コード例 #6
0
        public JsonResult Get()
        {
            ComunaModel comunaQuery = new ComunaModel(new Comuna());

            ResponseMenssage response = new ResponseMenssage("success", comunaQuery.GetComunas());

            return(new JsonResult(response));
        }
コード例 #7
0
        public JsonResult Get()
        {
            ActividadModel actividadQuery = new ActividadModel(new Actividad());

            ResponseMenssage response = new ResponseMenssage("success", actividadQuery.GetActividads());

            return(new JsonResult(response));
        }
コード例 #8
0
        public JsonResult Get()
        {
            AlumnoModel alumnoQuery = new AlumnoModel(new Alumno());

            ResponseMenssage response = new ResponseMenssage("success", alumnoQuery.GetAlumnos());

            return(new JsonResult(response));
        }
コード例 #9
0
        public JsonResult Get()
        {
            TipoActividadModel tipoActividadQuery = new TipoActividadModel(new TipoActividad());

            ResponseMenssage response = new ResponseMenssage("success", tipoActividadQuery.GetTipos());

            return(new JsonResult(response));
        }
コード例 #10
0
        public JsonResult Get()
        {
            TipoOrganizacionModel tipoOrganizacionQuery = new TipoOrganizacionModel(new TipoOrganizacion());

            ResponseMenssage response = new ResponseMenssage("success", tipoOrganizacionQuery.GetTipos());

            return(new JsonResult(response));
        }
コード例 #11
0
        public JsonResult Get()
        {
            TipoEstadiaModel tipoEstadiaQuery = new TipoEstadiaModel(new TipoEstadia());

            ResponseMenssage response = new ResponseMenssage("success", tipoEstadiaQuery.GetTipos());

            return(new JsonResult(response));
        }
コード例 #12
0
        public JsonResult Get()
        {
            TipoUsuarioModel tipoUsuarioQuery = new TipoUsuarioModel(new TipoUsuario());

            ResponseMenssage response = new ResponseMenssage("success", tipoUsuarioQuery.GetTipos());

            return(new JsonResult(response));
        }
コード例 #13
0
        public JsonResult Get()
        {
            CursoModel cursoQuery = new CursoModel(new Curso());

            ResponseMenssage response = new ResponseMenssage("success", cursoQuery.GetCursos());

            return(new JsonResult(response));
        }
コード例 #14
0
        public JsonResult Get()
        {
            EstadiaModel estadiaQuery = new EstadiaModel(new Estadia());

            ResponseMenssage response = new ResponseMenssage("success", estadiaQuery.GetEstadias());

            return(new JsonResult(response));
        }
コード例 #15
0
        public JsonResult Get()
        {
            TipoTransporteModel tipoTransporteQuery = new TipoTransporteModel(new TipoTransporte());

            ResponseMenssage response = new ResponseMenssage("success", tipoTransporteQuery.GetTipos());

            return(new JsonResult(response));
        }
コード例 #16
0
        public JsonResult Get()
        {
            OrganizacionModel organizacionQuery = new OrganizacionModel(new Organizacion());

            ResponseMenssage response = new ResponseMenssage("success", organizacionQuery.GetOrganizaciones());

            return(new JsonResult(response));
        }
コード例 #17
0
        public JsonResult Get()
        {
            ApoderadoModel apoderadoQuery = new ApoderadoModel(new Apoderado());

            ResponseMenssage response = new ResponseMenssage("success", apoderadoQuery.GetApoderados());

            return(new JsonResult(response));
        }
コード例 #18
0
        public JsonResult GetOrganizaciones(int id_organizacion)
        {
            Curso curso = new Curso();

            curso.Id_organizacion = id_organizacion;
            CursoModel cursoQuery = new CursoModel(curso);

            ResponseMenssage response = new ResponseMenssage("success", cursoQuery.GetCursosByOrganizacion());

            return(new JsonResult(response));
        }
コード例 #19
0
        public JsonResult GetProvincias(int id_provincia)
        {
            Comuna comuna = new Comuna();

            comuna.Id_provincia = id_provincia;
            ComunaModel comunaQuery = new ComunaModel(comuna);

            ResponseMenssage response = new ResponseMenssage("success", comunaQuery.GetComunasByProvincia());

            return(new JsonResult(response));
        }
コード例 #20
0
        public JsonResult GetCursoes(int id_curso)
        {
            Alumno alumno = new Alumno();

            alumno.Id_curso = id_curso;
            AlumnoModel alumnoQuery = new AlumnoModel(alumno);

            ResponseMenssage response = new ResponseMenssage("success", alumnoQuery.GetAlumnosByCurso());

            return(new JsonResult(response));
        }
コード例 #21
0
        public JsonResult GetProvincias(int id_region)
        {
            Provincia provincia = new Provincia();

            provincia.Id_region = id_region;
            ProvinciaModel provinciaQuery = new ProvinciaModel(provincia);

            ResponseMenssage response = new ResponseMenssage("success", provinciaQuery.GetProvinciasByRegion());

            return(new JsonResult(response));
        }
コード例 #22
0
        public HttpResponseMessage Get()
        {
            Region region        = new Region();
            var    jsonFormatter = new JsonMediaTypeFormatter();

            jsonFormatter.SerializerSettings.DateFormatHandling = Newtonsoft.Json.DateFormatHandling.MicrosoftDateFormat;
            jsonFormatter.SerializerSettings.NullValueHandling  = Newtonsoft.Json.NullValueHandling.Ignore;
            jsonFormatter.SerializerSettings.ContractResolver   = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver();
            jsonFormatter.SerializerSettings.Culture            = new System.Globalization.CultureInfo("en-US");

            ResponseMenssage response = new ResponseMenssage("success", region.GetRegions());

            return(Request.CreateResponse(HttpStatusCode.OK, response, jsonFormatter));
        }
コード例 #23
0
        public JsonResult Post([FromBody] Usuario usuario)
        {
            UsuarioModel usuarioQuery = new UsuarioModel(usuario);

            if (usuarioQuery.Create())
            {
                ResponseMenssage response = new ResponseMenssage("success", usuarioQuery.Usuario);
                return(new JsonResult(response));
            }
            else
            {
                ResponseMenssage response = new ResponseMenssage("error", "no se pudo crear el usuario");
                return(new JsonResult(response));
            }
        }
コード例 #24
0
        public JsonResult PostDetail([FromBody] STDetalle st_detalle)
        {
            STDetalleModel STDetalleModelQuery = new STDetalleModel(st_detalle);

            if (STDetalleModelQuery.Create())
            {
                ResponseMenssage response = new ResponseMenssage("success", STDetalleModelQuery.STDetalle);
                return(new JsonResult(response));
            }
            else
            {
                ResponseMenssage response = new ResponseMenssage("error", "error al crear");
                return(new JsonResult(response));
            }
        }
コード例 #25
0
        public JsonResult Post([FromBody] Region region)
        {
            RegionModel regionQuery = new RegionModel(region);

            if (regionQuery.Create())
            {
                ResponseMenssage response = new ResponseMenssage("success", regionQuery.Region);
                return(new JsonResult(response));
            }
            else
            {
                ResponseMenssage response = new ResponseMenssage("error", "error al crear region");
                return(new JsonResult(response));
            }
        }
コード例 #26
0
        public JsonResult Post([FromBody] ServicioTuristico servicio_turistico)
        {
            ServicioTuristicoModel ServicioTuristicoeQuery = new ServicioTuristicoModel(servicio_turistico);

            if (ServicioTuristicoeQuery.Create())
            {
                ResponseMenssage response = new ResponseMenssage("success", ServicioTuristicoeQuery.Servicio_turistico);
                return(new JsonResult(response));
            }
            else
            {
                ResponseMenssage response = new ResponseMenssage("error", "error al crear");
                return(new JsonResult(response));
            }
        }
コード例 #27
0
        public JsonResult Post([FromBody] TipoTransporte tipo_transporte)
        {
            TipoTransporteModel tipoTransporteQuery = new TipoTransporteModel(tipo_transporte);

            if (tipoTransporteQuery.Create())
            {
                ResponseMenssage response = new ResponseMenssage("success", tipoTransporteQuery.Tipo_transporte);
                return(new JsonResult(response));
            }
            else
            {
                ResponseMenssage response = new ResponseMenssage("error", "error al crear region");
                return(new JsonResult(response));
            }
        }
コード例 #28
0
        public JsonResult Post([FromBody] Organizacion organizacion)
        {
            OrganizacionModel OrganizacioneQuery = new OrganizacionModel(organizacion);

            if (OrganizacioneQuery.Create())
            {
                ResponseMenssage response = new ResponseMenssage("success", OrganizacioneQuery.Organizacion);
                return(new JsonResult(response));
            }
            else
            {
                ResponseMenssage response = new ResponseMenssage("error", "error al crear");
                return(new JsonResult(response));
            }
        }
コード例 #29
0
        public JsonResult Post([FromBody] TipoActividad tipo_actividad)
        {
            TipoActividadModel tipoActividadQuery = new TipoActividadModel(tipo_actividad);

            if (tipoActividadQuery.Create())
            {
                ResponseMenssage response = new ResponseMenssage("success", tipoActividadQuery.Tipo_actividad);
                return(new JsonResult(response));
            }
            else
            {
                ResponseMenssage response = new ResponseMenssage("error", "error al crear region");
                return(new JsonResult(response));
            }
        }
コード例 #30
0
        public JsonResult Post([FromBody] TipoUsuario tipo_usuario)
        {
            TipoUsuarioModel tipoUsuarioQuery = new TipoUsuarioModel(tipo_usuario);

            if (tipoUsuarioQuery.Create())
            {
                ResponseMenssage response = new ResponseMenssage("success", tipoUsuarioQuery.Tipo_usuario);
                return(new JsonResult(response));
            }
            else
            {
                ResponseMenssage response = new ResponseMenssage("error", "error al crear region");
                return(new JsonResult(response));
            }
        }