Exemple #1
0
        public HttpResponseMessage GetSortedFormsByGradeByYear(int grade, int year)
        {
            string userId = ((ClaimsPrincipal)RequestContext.Principal).FindFirst(x => x.Type == "UserId").Value;

            logger.Info("UserId: " + userId + ": Requesting Sorted Form List For Grade: " + grade + " For Year: " + year);

            try
            {
                IEnumerable <FormDTOForAdmin> forms = formsService.GetSortedFormsByGradeByYear(grade, year);
                logger.Info("Success!");
                return(Request.CreateResponse(HttpStatusCode.OK, forms));
            }
            catch (Exception e)
            {
                logger.Error(e);
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, e));
            }
        }