-
Notifications
You must be signed in to change notification settings - Fork 0
/
HospitalController.cs
46 lines (40 loc) · 1.08 KB
/
HospitalController.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using AccesoDatos;
using Logica;
namespace ServicioRestHospital.Controllers
{
public class HospitalController : ApiController
{
logicaHospital lh = new logicaHospital();
// GET: api/Hospital
public List<Hospital> Get()
{
return lh.seleccionarHospitales();
}
// GET: api/Hospital/5
public Hospital Get(int id)
{
return lh.seleccionarHospital(id);
}
// POST: api/Hospital
public int Post([FromBody]Hospital nuevoHospital)
{
return lh.insertarHos(nuevoHospital);
}
// PUT: api/Hospital/5
public bool Put(int id, [FromBody]Hospital hospitalModificado)
{
return lh.actualizarHos(hospitalModificado);
}
// DELETE: api/Hospital/5
public bool Delete(int id)
{
return lh.eliminarHos(id);
}
}
}