Example #1
0
        public ActionResult MyPosBind(Guid id)
        {
            //当前登录用户
            MpUser  mpUser  = _mpUserService.GetById(MpUserID);
            PosAuth posAuth = _posAuthService.GetUnique(p => p.MpUserId == mpUser.Id);

            //if (posAuth == null)
            //{
            //    return RedirectToAction("PosApply");
            //}
            if (posAuth != null)
            {
                ViewBag.Name = posAuth.Name;
            }
            else
            {
                ViewBag.Name = mpUser.NickName;
            }

            if (mpUser.Sex == 1)
            {
                ViewBag.Sex = "先生";
            }
            else if (mpUser.Sex == 2)
            {
                ViewBag.Sex = "女士";
            }
            else
            {
                ViewBag.Sex = "";
            }

            string mpuserId = MpUserID.ToString();
            Pos    pos      = _posService.GetUnique(p => p.Id == id && p.MpUserIds.Contains(mpuserId));

            if (pos == null)
            {
                throw new OceanException("对不起,参数有误,请检查!");
            }
            return(View(pos));
        }