天津投入产出系统后端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

88 lines
2.6 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Data;
using System.Text;
using QMFrameWork.Data;
using QMAPP.Entity.Report;
using QMAPP.Entity.Sys;
using QMAPP.DAL.Report;
using QMAPP.DAL.Sys;
namespace QMAPP.BLL.Report
{
/// <summary>
/// 用户权限查询
/// </summary>
public class QueryUserPowerBLL : BaseBLL
{
#region 获取用户权限信息
/// <summary>
/// 获取用户权限信息
/// </summary>
/// <param name="condition">查询条件</param>
/// <param name="page">数据页</param>
public DataPage GetUserPowerList(PowerQyCondition condition, DataPage page)
{
//获取权限
page = new QueryUserPowerDAL().GetUserPowerList(condition, page);
//获取角色信息
List<Role> roles = new RoleManageDAL().GetAll().Roles;
//获取组织机构信息
List<Orgaization> organs = new OrgaizationManageDAL().GetAllList();
//结果汇总
List<PowerQueryResult> resultList = page.Result as List<PowerQueryResult>;
foreach (PowerQueryResult result in resultList)
{
Role r = roles.Find(p => p.RoleID == result.ROLEID);
result.ROLENAME = r != null ? r.RoleDESC : "";
Orgaization o = organs.Find(p => p.OrgaID == result.ORGANID);
result.ORGANNAME = o != null ? o.OrgaDESC : "";
}
page.Result = resultList;
return page;
}
#endregion
#region 获取导出的数据
/// <summary>
/// 获取导出的数据
/// </summary>
/// <param name="user">查询条件</param>
/// <returns>数据</returns>
public DataTable GetExportData(PowerQyCondition condition)
{
//获取权限
DataTable dt = new QueryUserPowerDAL().GetExportData(condition);
//获取角色信息
List<Role> roles = new RoleManageDAL().GetAll().Roles;
//获取组织机构信息
List<Orgaization> organs = new OrgaizationManageDAL().GetAllList();
foreach (DataRow row in dt.Rows)
{
Role r = roles.Find(p => p.RoleID == row["ROLEID"].ToString());
row["ROLENAME"] = r != null ? r.RoleDESC : "";
Orgaization o = organs.Find(p => p.OrgaID == row["ORGANID"]);
row["ORGANNAME"] = o != null ? o.OrgaDESC : "";
}
return dt;
}
#endregion
}
}