using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using QMAPP.DAL.FuntionDescriptionDAL;
using QMAPP.DAL.Sys;
using QMAPP.Entity;
using QMFrameWork.Data;
using QMFrameWork.Log;
namespace QMAPP.BLL.FuntionDescriptionBLL
{
public class FuntionDescriptionBLL : BaseBLL
{
#region 获取列表
///
/// 获取列表
///
/// 条件
/// 数据页
/// 数据页
public DataResult GetCountList(FuntionDescription condition, DataPage page)
{
DataResult result = new DataResult();
try
{
DataPage dataPage = new FuntionDescriptionDAL().GetCountList(condition, page);
var users = new UserManageDAL().GetUserComboxSource();
foreach (FuntionDescription item in dataPage.Result as List)
{
//处理人
if (!string.IsNullOrEmpty(item.CREATEUSER))
{
var user = users.FirstOrDefault(x => x.UserID == item.CREATEUSER);
if (user != null)
{
item.CREATEUSERNAME = user.UserName;
}
}
}
result.Result = dataPage;
}
catch (Exception ex)
{
LogManager.LogHelper.Error(new LogInfo()
{
ErrorInfo = ex,
Tag = ex.StackTrace,
Info = "热点查询-获取列表"
});
result.IsSuccess = false;
result.Msg = "系统异常!";
throw ex;
}
result.IsSuccess = true;
return result;
}
#endregion
#region 导出数据
///
/// 获取导出的数据
///
/// 查询条件
/// 数据
public DataResult GetExportData(FuntionDescription model)
{
DataResult result = new DataResult();
try
{
result.IsSuccess = true;
result.Result = new FuntionDescriptionDAL().GetExportData(model);
}
catch (Exception ex)
{
LogManager.LogHelper.Error(new LogInfo()
{
ErrorInfo = ex,
Tag = ex.StackTrace,
Info = "导出错误!"
});
result.IsSuccess = false;
result.Msg = "导出错误!";
}
return result;
}
#endregion
#region 获取功能模块下拉框
///
/// 获取列表
///
/// 条件
/// 数据页
/// 数据页
public List GetModelNameCombox()
{
try
{
return new FuntionDescriptionDAL().GetModelNameCombox();
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 获取菜单项下拉框
///
/// 获取列表
///
/// 条件
/// 数据页
/// 数据页
public List GetMenuNameCombox(string ModelName)
{
try
{
return new FuntionDescriptionDAL().GetMenuNameCombox(ModelName);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
}
}