Esempio n. 1
0
        public ActionResult Setting()
        {
            string badge = HttpContext.User.Identity.Name;

            Right.Entity.RightEntity right = Right.Entity.RightEntity.GetListByProperty(a => a.RightUser, badge).FirstOrDefault();

            if (right == null || !(right.RightName.Contains("权限设置") || right.RightName.Contains("值集维护")))
            {
                ViewBag.errorMessage = "对不起,您没有该模块的权限~";
                return(View("~/Views/Shared/_Error.cshtml"));
            }

            ViewBag.setList   = ValueSet.Service.ValueSetService.GetSetList();
            ViewBag.rightName = right.RightName;

            return(View());
        }
Esempio n. 2
0
        // 获取单个权限信息
        public JsonResult GetRightById(int id)
        {
            bool   state = true;
            string msg   = string.Empty;

            Right.Entity.RightEntity entity = null;

            try
            {
                entity = Right.Entity.RightEntity.GetSingle(id);
            }
            catch (Exception e)
            {
                state = false;
                msg   = e.Message;
            }

            return(new JsonResult {
                Data = new { state = state, msg = msg, data = entity }, JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Esempio n. 3
0
        public JsonResult SaveRight(string dataJson)
        {
            bool   state = true;
            string msg   = string.Empty;

            Right.Entity.RightEntity right = null;

            try
            {
                string badge = HttpContext.User.Identity.Name;
                right = Service.RightService.SaveRight(badge, dataJson, out state, out msg);
            }
            catch (Exception e)
            {
                state = false;
                msg   = e.Message;
            }

            return(new JsonResult {
                Data = new { state = state, msg = msg, data = right }
            });
        }