コード例 #1
0
        // POST api/Vendedor
        public HttpResponseMessage Post([FromBody] Vendedor v)
        {
            HttpResponseMessage response;

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

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