using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QMAPP.FJC.Entity.Operation;
using QMAPP.FJC.DAL.Operation;
using QMAPP.KB.Entity;
using QMAPP.BLL;
using QMFrameWork.Data;
using QMAPP.FJC.BLL.Dict;
namespace QMAPP.FJC.BLL.Operation
{
public class InjectionCheckBLL : BaseBLL
{
public DataResult Insert(InjectionCheck model)
{
DataResult result = new DataResult();
result.IsSuccess = true;
try
{
int i = new InjectionCheckDAL().Insert(model);
if (i == 0)
{
result.IsSuccess = false;
}
return result;
}
catch (Exception ex)
{
throw ex;
}
}
#region 获取列表
///
/// 获取列表
///
/// 条件
/// 数据页
/// 数据页
public DataPage GetList(InjectionCheck condition, DataPage page)
{
try
{
page = new InjectionCheckDAL().GetList(condition, page);
List list = page.Result as List;
DictManageBLL dictProType = new DictManageBLL(DictKind.PRODUCTTYPE);
foreach (InjectionCheck o in list)
{
o.ISINJECT = (o.HAVEINJECTION > 0) ? true : false;
o.PRODUCTTYPE = dictProType.GetDictValue(o.PRODUCTTYPE);
}
page.Result = list;
return page;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
public DataResult Delete(string pid)
{
DataResult result = new DataResult();
result.IsSuccess = true;
try
{
int i = new InjectionCheckDAL().Delete(pid);
if (i == 0)
{
result.IsSuccess = false;
}
return result;
}
catch (Exception ex)
{
throw ex;
}
}
}
}