Iman.BLL/RoleDistributeMenuManager.cs
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Text;
using Iman.Domain;
using System.Collections;
namespace BusinessLogics
{
public class RoleDistributeTMenuManager
{
public static void ExecuteDistribution(int roleId, IList<TRoleMenuMap> selectedTMenuList)
{
IList<TRoleMenuMap> existsRoleTMenuList = GetExistsTRoleMenuMapList(roleId);
IBatisNet.DataMapper.ISqlMapper sqlMapper = Mapper.Instance();
try
{
sqlMapper.BeginTransaction();
IDictionary param = new Hashtable();
if (existsRoleTMenuList.Count != 0)
{
//删除为角色已经分配的菜单映射
param.Add("ROLE_ID", roleId);
TRoleMenuMap.Delete(sqlMapper, "DeleteByRoleID", param);
}
foreach (TRoleMenuMap TRoleMenuMap in selectedTMenuList)
{
TRoleMenuMap.ROLE_ID = roleId;
TRoleMenuMap.Save(sqlMapper);
if (TRoleMenuMap.ChildMenus != null)
{
foreach (TRoleMenuMap childTMenuMap in TRoleMenuMap.ChildMenus)
{
childTMenuMap.ROLE_ID = roleId;
childTMenuMap.Save(sqlMapper);
}
}
}
sqlMapper.CommitTransaction();
}
catch
{
//throw ex;
//sqlMapper.RollBackTransaction();
}
}
private static IList<TRoleMenuMap> GetExistsTRoleMenuMapList(int roleId)
{
IDictionary queryParams = new Hashtable();
queryParams.Add("RoleId", roleId);
IList<TRoleMenuMap> roleTMenuList = new List<TRoleMenuMap>();
roleTMenuList = TRoleMenuMap.QueryList("SelectByParam", queryParams);
return roleTMenuList;
}
后面还有 27 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
