示例#1
0
        public IActionResult EditRank(ProjectRankModel model)
        {
            ViewBag.IsLogin = !string.IsNullOrEmpty(cache.GetString("user"));
            if (ViewBag.IsLogin)
            {
                ViewBag.User = JsonConvert.DeserializeObject <AccountModel>(cache.GetString("user"));
            }
            else
            {
                return(RedirectToAction("Login", "Account"));
            }
            if (!ViewBag.User.IsAdmin)
            {
                return(RedirectToAction("Login", "Account"));
            }

            if (ModelState.IsValid)
            {
                ranksvc.EditRank(model);
                return(RedirectToAction(nameof(ProjectSystem)));
            }
            return(View(model));
        }