Exemplo n.º 1
0
        // GET api/division
        public HttpResponseMessage Get()
        {
            var division = _division.GetAllDIVISION();

            if (division != null)
            {
                var divisionEntities = division as List <DIVISION> ?? division.ToList();
                if (divisionEntities.Any())
                {
                    return(Request.CreateResponse(HttpStatusCode.OK, divisionEntities));
                }
            }
            return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "division not found"));
        }
Exemplo n.º 2
0
        // GET api/values
        public HttpResponseMessage Get()
        {
            var hierarchys = _divisionServices.GetAllDIVISION();

            if (hierarchys != null)
            {
                var hierarchyEntities = hierarchys as List <DIVISION> ?? hierarchys.ToList();
                if (hierarchyEntities.Any())
                {
                    return(Request.CreateResponse(HttpStatusCode.OK, hierarchyEntities));
                }
            }
            return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "Hierarchies not found"));
        }