/// <summary>
/// 添加页面打开加载基础数据
/// </summary>
/// <returns></returns>
public string LoadBasicData()
{
ResultMsg msg = new ResultMsg();
try
{
dynamic obj = new ExpandoObject(); //动态类创建
Parallel.Invoke(() => //并行读取两种类型数据
{
obj.Role = role.GetRoleByIsEnable(); //读取角色
}, () =>
{
obj.Dep = dep.GetByIsEnableTrue(); //读取部门
});
msg.Code = 1;
msg.Data = obj;
msg.Msg = "数据读取成功!";
}
catch (Exception ex)
{
msg.Code = 0;
msg.Data = null;
msg.Msg = "数据读取失败!错误:" + ex.Message;
}
return msg.SendMsg(msg);
}
动态类
最新推荐文章于 2024-03-10 16:41:03 发布