Exemplo n.º 1
0
        // POST api/Proveedor
        public HttpResponseMessage Post([FromBody] Proveedor p)
        {
            HttpResponseMessage response;

            try
            {
                ProveedorService service = (ProveedorService) new ProveedorService().setDatabase(db);
                p.FechaAlta   = DateTime.Today;
                p.UsuarioAlta = 1;
                p.Estado      = "A";
                p             = service.saveOrUpdate(p);

                response = this.getSuccessResponse(p);
            }
            catch (Exception e)
            {
                response = this.getErrorResponse(e);
            }
            return(response);
        }