Example #1
0
 // GET: api/TipoNomina/5
 public IHttpActionResult Get(string id)
 {
     try
     {
         IEnumerable <TipoNomina> list = ServicioTNM.Find(id);
         return(Ok(
                    list.FirstOrDefault() ?? new TipoNomina()
                    ));
     }
     catch (Exception)
     {
         return(BadRequest());
     }
 }
Example #2
0
 // POST: api/TipoNomina
 public IHttpActionResult Post([FromBody] TipoNominaDTO value)
 {
     try
     {
         ServicioTNM.Agregar(value.Tipo, value.Descripcion);
         return(Ok(
                    new  { Description = "Todo bien" }
                    ));
     }
     catch (Exception)
     {
         return(BadRequest());
     }
 }
Example #3
0
 // GET: api/TipoNomina
 public IHttpActionResult  Get()
 {
     try
     {
         IEnumerable <TipoNomina> list = ServicioTNM.Find(null);
         return(Ok(
                    list
                    ));
     }
     catch (Exception)
     {
         return(BadRequest());
     }
 }