Example #1
0
        private static void ParseProperties(JoinToken es, HttpContextBase hcb = null)
        {
            if (es == null)
            {
                return;
            }

            var ps = es.GetType().GetProperties();

            foreach (var p in ps)
            {
                if (hcb == null)
                {
                    var context = HttpContext.Current;
                    if (context == null)
                    {
                        return;
                    }
                    p.SetValue(es, context.Request[p.Name], null);
                }
                else
                {
                    p.SetValue(es, hcb.Request[p.Name], null);
                }
            }
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        public static JoinToken ParseJoinToken()
        {
            var result = new JoinToken();

            ParseProperties(result);
            return(result);
        }
Example #3
0
        /// <summary>
        ///
        /// </summary>
        public static JoinToken ParseJoinToken(HttpContextBase context = null)
        {
            var result = new JoinToken();

            ParseProperties(result, context);
            return(result);
        }
Example #4
0
        private static void ParseProperties(JoinToken es)
        {
            if (es == null)
                return;

            var ps = es.GetType().GetProperties();
            foreach (var p in ps)
            {
                var context = HttpContext.Current;
                if (context == null)
                    return;
                p.SetValue(es, context.Request[p.Name], null);
            }
        }
Example #5
0
        /// <summary>
        /// 接入微信
        /// </summary>
        /// <returns></returns>
        public static bool Join(IMsgCall call, WeChatParam param = null)
        {
            var sign = ParseJoinToken();

            if (sign.Check(param))
            {
                if (JoinToken.IsGetRequest())
                {
                    sign.Response();
                }
                else
                {
                    ReceiveMsg.Reg(call);
                }
                return(true);
            }
            return(false);
        }
Example #6
0
        private static void ParseProperties(JoinToken es)
        {
            if (es == null)
            {
                return;
            }
            var ps = es.GetType().GetProperties();

            foreach (var p in ps)
            {
                var context = HttpContext.Current;
                if (context == null)
                {
                    return;
                }
                p.SetValue(es, context.Request[p.Name], null);
                LogHelper.Debug("ParseProperties)" + p.Name + ":" + context.Request[p.Name], "微信CallBack_");
            }
        }
Example #7
0
 /// <summary>
 /// 
 /// </summary>
 public static JoinToken ParseJoinToken(HttpContextBase context = null)
 {
     var result = new JoinToken();
     ParseProperties(result, context);
     return result;
 }
Example #8
0
 /// <summary>
 /// 
 /// </summary>
 public static JoinToken ParseFromContext()
 {
     var result = new JoinToken();
     ParseProperties(result);
     return result;
 }