コード例 #1
0
        public ActionResult Edit(int id)
        {
            var jm = new JsonWithUIcallback();

            try
            {
                var model = _bll.QueryToEnetity(p => p.Id == id);
                if (model == null)
                {
                    jm.statusCode   = 300;
                    jm.message      = "不存在此信息";
                    jm.closeCurrent = true;
                    return(Json(jm));
                }

                ViewBag.ShowNav             = _bll.FindSortList();
                ViewBag.ControllerAndAction = AdminsControllerPermission.GetAllControllerAndActionByAssembly();


                return(View(model));
            }
            catch (Exception ex)
            {
                ComToolsController.AddtxtLog(ex, "编辑", EnumHelper.Nlog.Error.ToString());
                jm.statusCode   = 300;
                jm.message      = ex.ToString();
                jm.closeCurrent = true;
            }
            return(Json(jm));
        }
コード例 #2
0
        public ActionResult Create()
        {
            ViewBag.ShowNav             = _bll.FindSortList();
            ViewBag.ControllerAndAction = AdminsControllerPermission.GetAllControllerAndActionByAssembly();

            //自定义内容
            return(View());
        }
コード例 #3
0
        public JsonResult GetAllControllerAndActionByAssembly()
        {
            var jm   = new AdminUiCallBack();
            var data = AdminsControllerPermission.GetAllControllerAndActionByAssembly();

            jm.data = data.OrderBy(u => u.name).ToList();
            jm.code = 0;
            jm.msg  = "获取成功";
            return(new JsonResult(jm));
        }
コード例 #4
0
 public static List <ControllerPermission> GetControllerPermission()
 {
     return(AdminsControllerPermission.GetAllControllerAndActionByAssembly());
 }