Ejemplo n.º 1
0
        public JsonResult GetDetail(System.String id)
        {
            TerritoryDetailView vm      = new TerritoryDetailView();
            GetTerritoryRequest request = new GetTerritoryRequest();

            request.TerritoryID = id;
            GetTerritoryResponse response = _territoryService.GetTerritory(request);

            if (response.TerritoryFound)
            {
                vm = response.Territory.ConvertToTerritoryDetailView();
            }

            return(Json(vm, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
        public GetTerritoryResponse GetTerritory(GetTerritoryRequest request)
        {
            GetTerritoryResponse response = new GetTerritoryResponse();

            Territory territory = _territoryRepository
                                  .FindBy(request.TerritoryID);

            if (territory != null)
            {
                response.TerritoryFound = true;
                response.Territory      = territory.ConvertToTerritoryView();
            }
            else
            {
                response.TerritoryFound = false;
            }


            return(response);
        }