Пример #1
0
 public string DeleteCustomer(Guid id)
 {
     try
     {
         object result = _customerBusiness.DeleteCustomer(id);
         return(JsonConvert.SerializeObject(new { Status = "OK", Record = result, Message = "Sucess" }));
     }
     catch (Exception ex)
     {
         AppConstMessage cm = _appConstant.GetMessage(ex.Message);
         return(JsonConvert.SerializeObject(new { Status = "ERROR", Record = "", Message = cm.Message }));
     }
 }
Пример #2
0
        public string DeleteCustomer(string ID)
        {
            try
            {
                object result = null;

                result = _customerBusiness.DeleteCustomer(ID != null && ID != "" ? Guid.Parse(ID) : Guid.Empty);
                return(JsonConvert.SerializeObject(new { Result = "OK", Message = result }));
            }
            catch (Exception ex)
            {
                AppConstMessage cm = c.GetMessage(ex.Message);
                return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));
            }
        }
Пример #3
0
        [HttpDelete("/officialId")] //Same here, this should be encrypted
        public async Task <ActionResult> Delete(string officialId)
        {
            try
            {
                await _customerBusiness.DeleteCustomer(officialId);

                return(Ok());
            }
            catch (ValidationException ex)
            {
                return(BadRequest(ex.Message));
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, "Something went wrong trying to create customer information.");
                return(StatusCode(500));
            }
        }
 public async Task <JsonResult> DeleteCustomer(int idCustomer)
 {
     return(new JsonResult(await _customerBusiness.DeleteCustomer(idCustomer)));
 }
Пример #5
0
 public async Task <string> DeleteCustomer(int id)
 {
     return(await customerBusiness.DeleteCustomer(id));
 }