Exemple #1
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/json";
            ResultDTO            result     = new ResultDTO();
            JavaScriptSerializer serializer = new JavaScriptSerializer();

            string functionName = RequestUtility.GetQueryString <string>("func");

            if (!String.Equals(functionName, "login", StringComparison.CurrentCultureIgnoreCase) &&
                string.IsNullOrEmpty(RequestUtility.GetQueryString <string>(SessionContents.SSO_TOKEN)) &&
                string.IsNullOrEmpty(RequestUtility.GetHeader <string>(SessionContents.SSO_TOKEN)))
            {
                result.success   = false;
                result.errorcode = ErrorCode.NO_SSO_INFO;
                context.Response.Write(serializer.Serialize(result));
                context.Response.End();
            }

            result = (ResultDTO)GetType().GetMethod(functionName).Invoke(this, new object[0]);


            context.Response.Write(serializer.Serialize(result));
            context.Response.End();
        }