public HttpResponseMessage Post(DebitDTO debitDTO) { DebitDTO dto = service.newDebit(debitDTO); if (dto != null) { HttpResponseMessage message = Request.CreateResponse(HttpStatusCode.Created, dto); message.Headers.Location = new Uri(Request.RequestUri + "/" + dto.Id); return(message); } else { return(Request.CreateErrorResponse(HttpStatusCode.SeeOther, sysLanguage.CompanyTitlesControllerStrings.add_title)); } }
public IActionResult AddDebit(DebitDTO debit) { service.newDebit(debit); return(RedirectToAction("Index", "Home")); }