Beispiel #1
0
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        //{
        //return dal.GetList(PageSize,PageIndex,strWhere);
        //}

        #endregion  BasicMethod
        #region  ExtensionMethod
        /// <summary>
        /// 增加一条数据
        /// </summary>
        /// <param name="model">model</param>
        /// <param name="rightIDs">权限ID数组</param>
        public int Add(Eastcom.Model.Sys_Power_Role model, int[] rightIDs, Eastcom.Model.v_Sys_User_Info uModel)
        {
            int result = dal.Add(model);

            if (result > 0)
            {
                Eastcom.BLL.Sys_Power_RoleRight roleRightBLL = new Sys_Power_RoleRight();
                roleRightBLL.Add(result, rightIDs, uModel);
            }
            return(result);
        }
Beispiel #2
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        /// <param name="model">model</param>
        /// <param name="rightIDs">权限ID数组</param>
        public bool Update(Eastcom.Model.Sys_Power_Role model, int[] rightIDs, Eastcom.Model.v_Sys_User_Info uModel)
        {
            bool flag = dal.Update(model);

            if (flag)
            {
                Eastcom.BLL.Sys_Power_RoleRight roleRightBLL = new Sys_Power_RoleRight();
                //删除角色的所有权限再添加
                if (roleRightBLL.DelWhere(string.Format("FK_RoleID={0}", model.RoleID)))
                {
                    roleRightBLL.Add(model.RoleID, rightIDs, uModel);
                }
            }
            return(flag);
        }