public IHttpActionResult GetAllCollectionPoints()
        {
            // declare and initialize error variable to accept the error from Repo
            string error = "";

            // get the list from collectionpointrepo and will insert the error if there is one
            List <CollectionPointModel> cpm = CollectionPointRepo.GetAllCollectionPoint(out error);

            // if the erorr is not blank or the collectionpoint list is null
            if (error != "" || cpm == null)
            {
                // if the error is 404
                if (error == ConError.Status.NOTFOUND)
                {
                    return(Content(HttpStatusCode.NotFound, "CollectionsPoints Not Found"));
                }
                // if the error is other one
                return(Content(HttpStatusCode.BadRequest, error));
            }
            // if there is no error
            return(Ok(cpm));
        }
Ejemplo n.º 2
0
        public List <CollectionPoint> GetAllCollectionPoint()
        {
            List <CollectionPoint> clist = cprepo.GetAllCollectionPoint();

            return(clist);
        }