public IHttpActionResult Delete(string clientId) { LogManager.AddInfo(DateTime.Now + $" BEGIN : ClientsController.delete clientId:{clientId}"); var result = new JsonResultModel <string>() { Success = false };; var stopWatch = GetStopWatch(); try { clientsService.Delete(clientId); result.Success = true; LogManager.AddInfo(DateTime.Now + $" BEGIN : ClientsController.delete clientId:{clientId}"); stopWatch.Stop(); } catch (Exception ex) { stopWatch.Stop(); LogManager.AddError("ClientsController", "delete", string.Empty, string.Empty, stopWatch.ElapsedTicks, ex); // result.Message = ex.Message; } return(Ok(result)); }
public IActionResult Delete(int id) { string token = HttpContext.Session.GetString("InvoiceRegisterJWToken"); bool status = _clientsService.Delete(token, id); if (!status) { ModelState.AddModelError(string.Empty, "Server error. Please contact administrator."); } return(Redirect("~/")); }
public async Task <IActionResult> Delete(int id) { await _clientsService.Delete(id); return(NoContent()); }
public HttpResponseMessage Delete(int id) { return(ToJson(_clientsService.Delete(id))); }