public JsonResult Delete(System.String id) { RemoveCustomerDemographicRequest request = new RemoveCustomerDemographicRequest(); request.CustomerTypeID = id; RemoveCustomerDemographicResponse response = _customerDemographicService.RemoveCustomerDemographic(request); return(Json(response)); }
public RemoveCustomerDemographicResponse RemoveCustomerDemographic(RemoveCustomerDemographicRequest request) { RemoveCustomerDemographicResponse response = new RemoveCustomerDemographicResponse(); response.Errors = new List <BusinessRule>(); try { if (_customerDemographicRepository.Remove(request.CustomerTypeID) > 0) { response.CustomerDemographicDeleted = true; } } catch (Exception ex) { response.Errors.Add(new BusinessRule("DAL", "DAL_ERROR: " + ex.Message)); } return(response); }