コード例 #1
0
 public HttpResponseMessage Delete(int id)
 {
     if (id == 0)
     {
         return(Request.CreateResponse(HttpStatusCode.NotFound, id));
     }
     else
     {
         Models.clsVehiculo obj = new Models.clsVehiculo();
         obj.Borrar(id);
         return(Request.CreateResponse(HttpStatusCode.OK, id));
     }
 }
コード例 #2
0
 public HttpResponseMessage Put(Models.clsVehiculo objPersona)
 {
     if (objPersona == null)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
     }
     else
     {
         Models.clsVehiculo ob = new Models.clsVehiculo();
         ob.Modificar(objPersona);
         return(Request.CreateResponse(HttpStatusCode.OK, objPersona));
     }
 }
コード例 #3
0
 public HttpResponseMessage Post(Models.clsVehiculo objPersona)
 {
     if (objPersona != null)
     {
         Models.clsVehiculo obj = new Models.clsVehiculo();
         obj.Alta(objPersona);
         HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created, objPersona);
         return(response);
     }
     else
     {
         return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
     }
 }
コード例 #4
0
 public Models.clsVehiculo Get(int id)
 {
     Models.clsVehiculo objPersona = new Models.clsVehiculo();
     objPersona = new Models.clsVehiculo().Recuperar(id);
     if (objPersona.PER_ID == 0)
     {
         HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.NotFound, id);
         return(objPersona);
     }
     else
     {
         HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, id);
         return(objPersona);
     }
 }
コード例 #5
0
        public List <Models.clsVehiculo> Get()
        {
            List <Models.clsVehiculo> lstPersonas = new List <Models.clsVehiculo>();

            return(lstPersonas = new Models.clsVehiculo().funSelectTodos());
        }