Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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("~/"));
        }
Esempio n. 3
0
        public async Task <IActionResult> Delete(int id)
        {
            await _clientsService.Delete(id);

            return(NoContent());
        }
Esempio n. 4
0
 public HttpResponseMessage Delete(int id)
 {
     return(ToJson(_clientsService.Delete(id)));
 }