public ActionResult OnBindUser(string userName, string phoneNumber, string sessionId)
        {
            StatusReport sr         = new StatusReport();
            SessionBag   sessionBag = null;

            sessionBag = SessionContainer.GetSession(sessionId);
            //string sessionCode = (string)sessionBag.Name;
            //string sessionCode =(string)HttpContext.Session[phoneNumber];

            if (sessionBag == null)//如果sessionId失效,返回失败信息
            {
                sr.status = "Fail";
                sr.result = "session已失效";
                return(Json(sr, JsonRequestBehavior.AllowGet));
            }

            //if (string.IsNullOrEmpty(sessionCode))//如果sessionCode失效,返回失败信息
            //{
            //    sr.status = "Fail";
            //    sr.result = "codeSession已失效";
            //    sr.parameters = phoneNumber;
            //    return Json(sr,JsonRequestBehavior.AllowGet);
            //}

            //if (code != sessionCode)//如果验证码与用户收到的验证码不一致,返回失败信息
            //{
            //    sr.status = "Fail";
            //    sr.result = "code错误";
            //    return Json(sr, JsonRequestBehavior.AllowGet);
            //}

            string openId = sessionBag.OpenId;
            int    id     = ProprietorDal.CheckProprietorExist(userName, phoneNumber);
            string temp   = id != 0 ? "存在" : "不存在";

            if (id != 0)
            {
                sr = ProprietorDal.BindProprietor(Math.Abs(id), userName, phoneNumber, openId, id > 0 ? true : false);
                return(Json(sr, JsonRequestBehavior.AllowGet));
            }
            else
            {
                var data = new
                {
                    msg         = "hello world",
                    username    = userName,
                    phoneNumber = phoneNumber,
                    isExist     = temp
                };
                return(Json(data, JsonRequestBehavior.AllowGet));
            }
        }
        public ActionResult OnGetCode(string userName, string phoneNumber)
        {
            //StatusReport sr = new StatusReport();
            //SessionBag sessionBag = null;
            //sessionBag = SessionContainer.GetSession(sessionId);
            //if (sessionBag == null)
            //{
            //    sr.status = "Fail";
            //    sr.result = "session已失效";
            //    return Json(sr);
            //}
            //string openId = sessionBag.OpenId;
            int    id   = ProprietorDal.CheckProprietorExist(userName, phoneNumber);
            string temp = id > 0 ? "存在" : "不存在";

            if (id != 0)
            {
                string code = getCode();
                //SessionBag sessionBag = null;
                //sessionBag = SessionContainer.GetSession(sessionId);
                //sessionBag.Name = code;
                //filterContext.HttpContext.Session.Add(phoneNumber, code);
                //Session[phoneNumber] = code;
                //Session.Timeout = 60;
                var data = new
                {
                    msg    = "success",
                    code   = code,
                    status = "exist"
                };
                return(Json(data));
                //sr = ProprietorDal.BindProprietor(id, openId);
                //return Json(sr);
            }
            else
            {
                var data = new
                {
                    msg    = "fail",
                    code   = "",
                    status = "notexist"
                };
                return(Json(data));
            }
        }