コード例 #1
0
        public void ProcessRequest(HttpContext context)
        {
            //validate query parameters
            QueryParams queryParams;

            try
            {
                queryParams = new QueryParams(context.Request);
            }
            catch
            {
                context.Response.StatusCode = 400; //bad request
                return;
            }

            //convert query parameters to entities
            var ctx          = new DiscCtx(ConfigManager.ConnStr);
            var reportParams = queryParams.Materialize(ctx);

            if (reportParams == null)
            {
                context.Response.StatusCode = 400;
                return;
            }

            //compute and set report parameters
            var report = new SourcesReport
            {
                ReportParams = reportParams,
            };

            context.Response.Write(report.TransformText());
        }
コード例 #2
0
        public void ProcessRequest(HttpContext context)
        {
            //validate query parameters
            QueryParams queryParams;
            try
            {
                queryParams = new QueryParams(context.Request);
            }
            catch
            {
                context.Response.StatusCode = 400; //bad request
                return;
            }

            //convert query parameters to entities            
            var ctx = new DiscCtx(ConfigManager.ConnStr);
            var reportParams = queryParams.Materialize(ctx);
            if (reportParams == null)
            {
                context.Response.StatusCode = 400;
                return;
            }
            
            //compute and set report parameters 
            var report = new SourcesReport
                {
                    ReportParams = reportParams,
                };

           context.Response.Write(report.TransformText());
        }