예제 #1
0
        public object Get(GetTvShowsReport request)
        {
            AuthorizationInfo user_info = _ac.GetAuthorizationInfo(Request);
            UserPolicy        policy    = _userManager.GetUserPolicy(user_info.User);

            if (!policy.IsAdministrator)
            {
                return(new List <Dictionary <string, object> >());
            }

            DateTime end_date;

            if (string.IsNullOrEmpty(request.end_date))
            {
                end_date = DateTime.Now;
            }
            else
            {
                _logger.Info("End_Date: " + request.end_date);
                end_date = DateTime.ParseExact(request.end_date, "yyyy-MM-dd", CultureInfo.InvariantCulture);
            }

            List <Dictionary <string, object> > report = repository.GetTvShowReport(request.user_id, request.days, end_date);

            return(report);
        }
예제 #2
0
        public object Get(GetTvShowsReport request)
        {
            DateTime end_date;

            if (string.IsNullOrEmpty(request.end_date))
            {
                end_date = DateTime.Now;
            }
            else
            {
                _logger.Info("End_Date: " + request.end_date);
                end_date = DateTime.ParseExact(request.end_date, "yyyy-MM-dd", CultureInfo.InvariantCulture);
            }

            List <Dictionary <string, object> > report = Repository.GetTvShowReport(request.days, end_date);

            return(report);
        }