Exemplo n.º 1
0
        /// <summary>
        /// 根据按钮ID获取按钮详细信息
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public JsonResult GetButtonByID(int id)
        {
            AjaxStatusModel ajax = new AjaxStatusModel(); //功能操作类的返回类型都是AjaxStatusModel,数据放到AjaxStatusModel.data中,前台获取json后加载

            ajax.status = EnumAjaxStatus.Error;           //默认失败
            ajax.msg    = "获取失败!";                        //前台获取,用于显示提示信息
            SYSButton btn = ButtonData.GetButtonByID(id); //业务层获取底层方法,返回数据

            if (btn != null)
            {
                ajax.data = btn;//放入数据
                ajax.msg  = "获取成功!";
            }
            return(Json(ajax));
        }