Ejemplo n.º 1
0
        /// <summary>
        /// 首页
        /// </summary>
        /// <returns></returns>
        public ActionResult Index(string unid)
        {
            var model = new Model.Puzzle();

            ViewData["LastOne"] = false;
            //预览
            if (this.LoginUser != null && !string.IsNullOrEmpty(unid))
            {
                model = IPuzzleService.Find_Puzzle(unid);
                return(View(model));
            }
            var user   = CookieHelper.GetCurrentWxUser();
            var person = CookieHelper.GetCurrentPeople();

            if (user == null || person == null)
            {
                return(OAuthExpired());
            }

            model = IPuzzleService.Get_NextPuzzle(unid, user?.openid, person?.UNID);
            if (model == null || model.UNID.Equals(unid))
            {
                ViewData["LastOne"] = true;
            }

            return(View(model));
        }
Ejemplo n.º 2
0
        public JsonResult Update(Model.Puzzle model, string unid)
        {
            var result = IPuzzleService.Update_Puzzle(model, unid);

            return(JResult(result));
        }
Ejemplo n.º 3
0
        public JsonResult Add(Model.Puzzle model)
        {
            var result = IPuzzleService.Add_Puzzle(model);

            return(JResult(result));
        }