예제 #1
0
        public JsonResult InsertPower(sysmenu_power menupower)
        {
            string msg = string.Empty;

            if (string.IsNullOrEmpty(menupower.menuno))
            {
                msg += "菜单编号不能为空<br />";
            }
            if (string.IsNullOrEmpty(menupower.powerno))
            {
                msg += "权限编号不能为空<br />";
            }

            string             powername = menupower.powername;
            OperateResultModel orm       = new OperateResultModel();

            if (string.IsNullOrEmpty(msg))
            {
                menupower.pkid       = NewGuid;
                menupower.creater    = SessionUser.UserNo;
                menupower.createdate = DateTime.Now;
                menupower.powername  = null;
                Permission permission = new Permission();
                orm = permission.InsertMenuPower(menupower);
                menupower.powername = powername;
                orm.rows            = menupower;
            }
            else
            {
                orm.message = msg;
                orm.success = false;
            }
            return(JsonResultHelper.ConvertToJsonResult(orm));
        }
예제 #2
0
        /// <summary>
        /// 插入菜单权限信息
        /// </summary>
        /// <param name="menupower">菜单权限实体</param>
        /// <returns></returns>
        public OperateResultModel InsertMenuPower(sysmenu_power menupower)
        {
            SysMenuPowerDal dal = new SysMenuPowerDal();

            return(dal.Insert(menupower));
        }