using System;
using System.Collections.Generic;
using System.Data;
using QMAPP.BLL;
using QMAPP.Entity;
using QMAPP.FJC.BLL.Dict;
using QMAPP.FJC.DAL.FeedInManage;
using QMAPP.FJC.Entity.FeedInManage;
using QMAPP.FJC.Entity.Injection;
using QMFrameWork.Data;
using QMFrameWork.Log;
using QMAPP.FJC.Entity.ProduceManage;
namespace QMAPP.FJC.BLL.ProduceManage
{
///
/// 模块编号:M4-3
/// 作 用:不合格品记录查询
/// 作 者:张敬贺
/// 编写日期:2015年06月15日
///
public class UnQualityBLL : BaseBLL
{
#region 获取列表
///
/// 获取列表
///
/// 条件
/// 数据页
/// 数据页
public DataResult GetList(Epidermis condition, DataPage page)
{
DataResult result = new DataResult();
try
{
result.IsSuccess = true;
page = new UnQualityDAL().GetList(condition, page);
List list = page.Result as List;
//处理字典信息
DictManageBLL dictPROCESSTYPE = new DictManageBLL(DictKind.PROCESSTYPE);
DictManageBLL dictPRODUCTTYPE = new DictManageBLL(DictKind.PRODUCTTYPE);
foreach (var info in list)
{
//替换工序类别显示值
info.PROCESSTYPE = dictPROCESSTYPE.GetDictValue(info.PROCESSTYPE);
//替换零件类别显示值
info.PRODUCTTYPE = dictPRODUCTTYPE.GetDictValue(info.PRODUCTTYPE);
}
result.Result = page;
}
catch (Exception ex)
{
LogManager.LogHelper.Error(new LogInfo()
{
ErrorInfo = ex,
Tag = ex.StackTrace,
Info = "不合格品信息获取列表错误!"
});
result.IsSuccess = false;
result.Msg = "不合格品信息获取列表错误!";
}
return result;
}
#endregion
#region 导出数据
///
/// 获取导出的数据
///
/// 查询条件
/// 数据
public DataResult GetExportData(Epidermis model)
{
DataResult result = new DataResult();
try
{
result.IsSuccess = true;
result.Result = new UnQualityDAL().GetExportData(model);
//处理字典信息
DictManageBLL dictPROCESSTYPE = new DictManageBLL(DictKind.PROCESSTYPE);
DictManageBLL dictPRODUCTTYPE = new DictManageBLL(DictKind.PRODUCTTYPE);
foreach (DataRow dr in result.Result.Rows)
{
//替换工序类别显示值
dr["PROCESSTYPE"] = dictPROCESSTYPE.GetDictValue(dr["PROCESSTYPE"].ToString());
//替换零件类别显示值
dr["PRODUCTTYPE"] = dictPRODUCTTYPE.GetDictValue(dr["PRODUCTTYPE"].ToString());
}
}
catch (Exception ex)
{
LogManager.LogHelper.Error(new LogInfo()
{
ErrorInfo = ex,
Tag = ex.StackTrace,
Info = "不合格品信息导出错误!"
});
result.IsSuccess = false;
result.Msg = "不合格品信息导出错误!";
}
return result;
}
#endregion
}
}