示例#1
0
        public string roleModify()
        {
            Data.DTO.PQRoleModify request = new Data.DTO.PQRoleModify();
            request = this.Json2Obj(jsonStr, request.GetType()) as Data.DTO.PQRoleModify;
            Data.DTO.PSRoleModify response = new Data.DTO.PSRoleModify();
            Data.BLL.cUserBLL     client   = new Data.BLL.cUserBLL();
            response = client.RoleModify(request);
            string strResponse = this.Obj2Json(response);

            return(strResponse);
        }
示例#2
0
        public string rightView()
        {
            Data.DTO.PQRightView request = new Data.DTO.PQRightView();
            request = this.Json2Obj(jsonStr, request.GetType()) as Data.DTO.PQRightView;
            Data.DTO.PSRightView response = new Data.DTO.PSRightView();
            Data.BLL.cUserBLL    client   = new Data.BLL.cUserBLL();
            response = client.RightView(request);
            string strResponse = this.Obj2Json(response);

            return(strResponse);
        }
示例#3
0
        public string orgQuery()
        {
            Data.DTO.PQOrgQuery request = new Data.DTO.PQOrgQuery();
            request = this.Json2Obj(jsonStr, request.GetType()) as Data.DTO.PQOrgQuery;
            Data.DTO.PSOrgQuery response = new Data.DTO.PSOrgQuery();
            Data.BLL.cUserBLL   client   = new Data.BLL.cUserBLL();
            response = client.OrgQuery(request);
            string strResponse = this.Obj2Json(response);

            return(strResponse);
        }
示例#4
0
        /// <summary>
        /// 取工具详情,所有数据一起返回
        /// </summary>
        /// <returns></returns>
        public string login()
        {
            Data.DTO.PQLogin request = new Data.DTO.PQLogin();
            request = this.Json2Obj(jsonStr, request.GetType()) as Data.DTO.PQLogin;
            Data.DTO.PSLogin  response = new Data.DTO.PSLogin();
            Data.BLL.cUserBLL client   = new Data.BLL.cUserBLL();
            response = client.Login(request);
            string strResponse = this.Obj2Json(response);

            return(strResponse);
        }
示例#5
0
 //日志管理
 protected void AfterInvoke(String methodName)
 {
     try
     {
         Data.DTO.PQLogModify request = new Data.DTO.PQLogModify();
         request = this.Json2Obj(jsonStr, request.GetType()) as Data.DTO.PQLogModify;
         foreach (string method in methodList)
         {
             if (methodName.Contains(method))
             {
                 string op = methodName.Replace(method, "");
                 request.Operate  = op;
                 request.Function = method;
                 break;
             }
         }
         Data.BLL.cUserBLL user = new Data.BLL.cUserBLL();
         user.LogModify(request);
     }
     catch {
         //不处理日志错误
     }
 }
示例#6
0
        /// <summary>
        /// 主处理函数
        /// </summary>
        /// <param name="context"></param>
        public void ProcessRequest(HttpContext context)
        {
            string methodName = string.Empty;

            try
            {
                //if (!BaseData.isTrue)
                //{
                //    if (Session.Count > 10)
                //    {
                //        Session.RemoveAt(Session.Count - 1);
                //        return;
                //    }
                //}
                HttpRequest Request = context.Request;
                methodName = Request["method"];
                Type       type   = this.GetType();
                MethodInfo method = type.GetMethod(methodName);
                if (method == null)
                {
                    throw new Exception("method is null");
                }
                jsonStr = Request["json"];
                if (string.IsNullOrEmpty(jsonStr))
                {
                    jsonStr = "{a:1}";
                }
                jsonStr = System.Web.HttpUtility.UrlDecode(jsonStr);
                //过滤掉登录方法和登录初始化方法, 验证认证
                Data.DTO.PSTokenView response = new Data.DTO.PSTokenView();
                if (methodName != "login" && methodName != "getFans")
                {
                    Data.DTO.PQTokenView request = new Data.DTO.PQTokenView();
                    request.token = Request["token"];
                    Data.BLL.cUserBLL client = new Data.BLL.cUserBLL();
                    response = client.TokenView(request);
                    if (response.ErrorCode != "A_0")
                    {
                        //说明token令牌不正确
                        context.Response.Write(this.Obj2Json(response));
                        return;
                    }
                    else
                    {
                        jsonStr = AddJsonInfo(jsonStr, "UID", response.UserID);
                        jsonStr = AddJsonInfo(jsonStr, "AccountNumber", response.UserAccount);
                        jsonStr = AddJsonInfo(jsonStr, "CurrentPageURL", context.Server.UrlEncode(Request.UrlReferrer.ToString()));
                    }
                }
                string respStr = string.Empty;
                if (methodName.EndsWith("Query"))
                {
                    if (string.IsNullOrEmpty(Request["page"]))
                    {
                        jsonStr = AddJsonInfo(jsonStr, "Page", 0);
                        jsonStr = AddJsonInfo(jsonStr, "PageRow", -1);
                    }
                    else
                    {
                        jsonStr = AddJsonInfo(jsonStr, "Page", Request["page"]);
                        jsonStr = AddJsonInfo(jsonStr, "PageRow", Request["limit"]);
                    }
                }
                if (methodName.Equals("uploadImg"))
                {
                    respStr = this.uploadImg(context.Server, Request.Files);
                }
                else if (methodName.Equals("initQuery"))
                {
                    respStr = this.initQuery(context.Server, response.FunctionCodes);
                    respStr = AddJsonInfo(respStr, "AccountNumber", response.UserAccount);
                }
                else
                {
                    BeforeInvoke(methodName, response.FunctionCodes);
                    respStr = (string)method.Invoke(this, null);
                }
                context.Response.Write(respStr);
            }
            catch (Exception ex)
            {
                Hashtable result = new Hashtable();

                result["ErrorCode"]       = ex.Message;
                result["ErrorMessage"]    = "errorCode_" + ex.Message;
                result["ErrorStackTrace"] = ex.StackTrace.ToString();

                String errorJson = this.Obj2Json(result);
                context.Response.Clear();
                context.Response.Write(errorJson);
            }
            finally
            {
                AfterInvoke(methodName);
            }
        }