public bool DeleteFormPago(FormaPagoDTOs formapago) { var entity = new FormaPago() { Id = formapago.Id, Forma = formapago.Forma, Descripcion = formapago.Descripcion }; return(_repository.Delete <FormaPago>(entity)); }
public bool UpdateFormaPago(FormaPagoDTOs forma) { var entity = new FormaPago() { Id = forma.Id, Forma = forma.Forma, Descripcion = forma.Descripcion }; return(_repository.Update <FormaPago>(entity)); }
public FormaPago CreatePagos(FormaPagoDTOs formapago) { var entity = new FormaPago() { Forma = formapago.Forma, Descripcion = formapago.Descripcion }; _repository.Add(entity); return(entity); }
public IActionResult Update(FormaPagoDTOs forma) { try { return(new JsonResult(_service.UpdateFormaPago(forma)) { StatusCode = 200 }); } catch (Exception e) { return(BadRequest(e.Message)); } }
public IActionResult Post(FormaPagoDTOs formapago) { try { return(new JsonResult(_service.CreatePagos(formapago)) { StatusCode = 201 }); } catch (Exception e) { return(BadRequest(e.Message)); } }