Exemplo n.º 1
0
        public ActionResult Lottery()
        {
            PublicUserModel            loginUser          = this.GetLoginUser();
            UserSiteManageBll          userSiteManageBll  = new UserSiteManageBll();
            List <UserSiteManageModel> userSiteManageList = userSiteManageBll.GetUserSiteListByUserId(loginUser.UserID);//用户关联的站点
            UserSiteManageModel        userSiteItem       = userSiteManageList.Where(s => s.SiteID == 1).FirstOrDefault();
            bool hasZJB = true;

            if (userSiteItem.IsNull())
            {
                hasZJB = false;
            }
            ViewBag.HasZJB = hasZJB;
            return(View(loginUser));
        }
Exemplo n.º 2
0
        public ActionResult LotteryHandler()
        {
            PublicUserModel            loginUser          = this.GetLoginUser();
            UserSiteManageBll          userSiteManageBll  = new UserSiteManageBll();
            List <UserSiteManageModel> userSiteManageList = userSiteManageBll.GetUserSiteListByUserId(loginUser.UserID);//用户关联的站点
            UserSiteManageModel        userSiteItem       = userSiteManageList.Where(s => s.SiteID == 1).FirstOrDefault();

            if (userSiteItem.IsNull())
            {
                return(Json(new { Code = -5, Angle = 0 }, JsonRequestBehavior.AllowGet));
            }

            var json = new Lottery_ZJB().Lottery(userSiteItem.SiteUserName, userSiteItem.SiteUserPwd);

            return(Content(json));
        }
Exemplo n.º 3
0
        public JsonResult CheckSite(int siteId)
        {
            int                        uid                = this.GetLoginUser().UserID;
            UserBll                    userBll            = new UserBll();
            UserSiteManageBll          userSiteManageBll  = new UserSiteManageBll();
            List <UserSiteManageModel> userSiteManageList = userSiteManageBll.GetUserSiteListByUserId(this.GetLoginUser().UserID);//用户关联的站点
            UserSiteManageModel        userSiteItem       = userSiteManageList.Where(s => s.SiteID == siteId).FirstOrDefault();

            if (userSiteItem.IsNull())
            {
                return(Json(new { msg = "您还未绑定帐号!" }));
            }

            bool flag = false;

            try
            {
                flag = UserVerifier.CheckSite(siteId, userSiteItem.SiteUserName, userSiteItem.SiteUserPwd);
            }
            catch (Exception)
            {
            }

            if (flag)
            {
                UserSiteManage siteManage =
                    ncBase.CurrentEntities.UserSiteManage.Where(
                        o => o.SiteID == siteId && o.SiteUserName == userSiteItem.SiteUserName && o.UserID == uid).FirstOrDefault();
                if (siteManage.IsNoNull())
                {
                    siteManage.SiteStatus = BitConverter.GetBytes(1)[0];
                    siteManage.BanTime    = DateTime.Now;
                    ncBase.CurrentEntities.SaveChanges();
                    return(Json(new { msg = "账号验证成功并已经激活使用!" }));
                }

                return(Json(new { msg = "未知错误!" }));
            }
            return(Json(new { msg = "账号密码不正确!" }));
        }