Esempio n. 1
0
        public IHttpActionResult GetStandsInfo()
        {
            var headers = Request.Headers;

            if (headers.Contains("Auth") && headers.GetValues("Auth").First() == "CGIDigitalWeek")
            {
                var standsInfo = CrowdModels.GetStandsInfo();
                return(Json(standsInfo));
            }
            else
            {
                return(Unauthorized());
            }
        }
Esempio n. 2
0
        public IHttpActionResult GetStandsInfo(string standId)
        {
            var headers = Request.Headers;

            if (headers.Contains("Auth") && headers.GetValues("Auth").First() == "CGIDigitalWeek")
            {
                var personCount = CrowdModels.GetStandsOccupation(standId);
                if (!personCount.HasValue)
                {
                    return(NotFound());
                }
                return(Ok(personCount.Value));
            }
            else
            {
                return(Unauthorized());
            }
        }