예제 #1
0
        public JsonResult Get()
        {
            ServicioTuristicoModel servicio_turisticoQuery = new ServicioTuristicoModel(new ServicioTuristico());

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

            return(new JsonResult(response));
        }
예제 #2
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));
            }
        }
예제 #3
0
        public JsonResult Delete(int id)
        {
            ServicioTuristicoModel servicio_turisticoQuery = new ServicioTuristicoModel(new ServicioTuristico());

            servicio_turisticoQuery.Servicio_turistico.Id = id;

            if (servicio_turisticoQuery.Delete())
            {
                ResponseMenssage response = new ResponseMenssage("success", servicio_turisticoQuery.Servicio_turistico);
                return(new JsonResult(response));
            }
            else
            {
                ResponseMenssage response = new ResponseMenssage("error", "error al eliminar");
                return(new JsonResult(response));
            }
        }
예제 #4
0
        public JsonResult Put(int id, [FromBody] ServicioTuristico servicio_turistico)
        {
            ServicioTuristicoModel servicio_turisticoQuery = new ServicioTuristicoModel(servicio_turistico);

            servicio_turisticoQuery.Servicio_turistico.Id = id;

            if (servicio_turisticoQuery.Update())
            {
                ResponseMenssage response = new ResponseMenssage("success", servicio_turisticoQuery.Servicio_turistico);
                return(new JsonResult(response));
            }
            else
            {
                ResponseMenssage response = new ResponseMenssage("error", "error al modificar");
                return(new JsonResult(response));
            }
        }
예제 #5
0
        public JsonResult Get(int id)
        {
            ServicioTuristico servicio_turistico = new ServicioTuristico
            {
                Id = id
            };
            ServicioTuristicoModel servicio_turisticoQuery = new ServicioTuristicoModel(servicio_turistico);


            if (servicio_turisticoQuery.ReadById())
            {
                ResponseMenssage response = new ResponseMenssage("success", servicio_turisticoQuery.Servicio_turistico);
                return(new JsonResult(response));
            }
            else
            {
                ResponseMenssage response = new ResponseMenssage("error", "servicio_turistico no encontrada");
                return(new JsonResult(response));
            }
        }