Exemple #1
0
        public JsonResult Delete(System.String id)
        {
            RemoveTerritoryRequest request = new RemoveTerritoryRequest();

            request.TerritoryID = id;
            RemoveTerritoryResponse response = _territoryService.RemoveTerritory(request);

            return(Json(response));
        }
        public RemoveTerritoryResponse RemoveTerritory(RemoveTerritoryRequest request)
        {
            RemoveTerritoryResponse response = new RemoveTerritoryResponse();

            response.Errors = new List <BusinessRule>();
            try {
                if (_territoryRepository.Remove(request.TerritoryID) > 0)
                {
                    response.TerritoryDeleted = true;
                }
            } catch (Exception ex)
            {
                response.Errors.Add(new BusinessRule("DAL", "DAL_ERROR: " + ex.Message));
            }
            return(response);
        }