using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QMAPP.KB.Entity;
using QMAPP.BLL;
using QMFrameWork.Data;
using QMFrameWork.Log;
using QMAPP.FJC.Entity;
using QMAPP.FJC.DAL.SendManage;
using QMAPP.FJC.Entity.SendManage;
using QMAPP.FJC.BLL.Dict;
using System.Data;
namespace QMAPP.FJC.BLL.SendManage
{
///
/// 模块编号:
/// 作 用:
/// 作 者:
/// 编写日期:
///
public class SendPlanRecordBLL : BaseBLL
{
#region 获取列表
///
/// 获取列表
///
/// 条件
/// 数据页
/// 数据页
public DataResult GetList(PastCard condition, DataPage page)
{
DataResult result = new DataResult();
try
{
DataPage dataPage = new SendPlanRecordDAL().GetList(condition, page);
List materielList = dataPage.Result as List;
DictManageBLL dictColorTypeBll = new DictManageBLL(DictKind.COLOR);
//foreach (PastCard m in materielList)
//{
// //颜色
// m.COLORCODE = dictColorTypeBll.GetDictValue(m.COLORCODE);
// m.STARTCREATEDATE = m.CREATEDATE;
//}
result.Result = dataPage;
result.IsSuccess = true;
return result;
}
catch (Exception ex)
{
LogManager.LogHelper.Error(new LogInfo()
{
ErrorInfo = ex,
Tag = ex.StackTrace,
Info = "贴车单查询信息逻辑层-获取列表!"
});
result.IsSuccess = false;
result.Msg = Resource.SystemException;
throw ex;
}
}
#endregion
#region 获取详细列表
///
/// 获取详细列表
///
/// 条件
/// 数据页
/// 数据页
public DataResult GetItem(PastCard condition)
{
DataResult dataResult = new DataResult();
try
{
DataTable dt = new SendPlanRecordDAL().GetItemsData(condition);
#region 转换颜色、出库标记显示类型
//DictManageBLL dictColorTypeBll = new DictManageBLL(DictKind.COLOR);
//DictManageBLL dictOutFlagTypeBll = new DictManageBLL(DictKind.OUTFLAG);
//foreach (DataRow item in dt.Rows)
//{
// //颜色类别
// item["COLOR"] = dictColorTypeBll.GetDictValue(item["COLOR"].ToString());
// item["OUTFLAG"] = dictOutFlagTypeBll.GetDictValue(item["OUTFLAG"].ToString());
//}
#endregion
dataResult.Result = dt;
dataResult.IsSuccess = true;
return dataResult;
}
catch (Exception ex)
{
LogManager.LogHelper.Error(new LogInfo()
{
ErrorInfo = ex,
Tag = ex.StackTrace,
Info = "贴车单查询信息逻辑层-获取列表!"
});
dataResult.IsSuccess = false;
dataResult.Msg = Resource.SystemException;
throw ex;
}
}
#endregion
#region 导出数据
///
/// 获取导出的数据
///
/// 查询条件
/// 数据
public DataResult GetExportData(PastCard model)
{
DataResult result = new DataResult();
try
{
DataTable dt = new SendPlanRecordDAL().GetExportData(model);
result.Result = dt;
}
catch (Exception ex)
{
LogManager.LogHelper.Error(new LogInfo()
{
ErrorInfo = ex,
Tag = ex.StackTrace,
Info = "贴车单查询逻辑层-导出数据!"
});
result.IsSuccess = false;
result.Msg = Resource.SystemException;
throw ex;
}
result.IsSuccess = true;
return result;
}
#endregion
#region 导出数据详细信息
///
/// 获取导出的数据
///
/// 查询条件
/// 数据
public DataTable GetExportData2(PastCardDetail model)
{
try
{
DataTable dt = new SendPlanRecordDAL().GetExportData2(model);
//根据所选信息进行导出
//if (string.IsNullOrEmpty(model.PASTECARDNO_List) == false)
//{
// model.PASTECARDNO_List = "'" + model.PASTECARDNO_List.Replace(":", "','") + "'";
// DataView dv = new DataView(dt);
// dv.RowFilter = "PID in (" + model.PASTECARDNO_List + ")";
// dt = dv.ToTable();
//}
return dt;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
}
}