using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QMAPP.BLL;
using QMFrameWork.Data;
using QMAPP.Entity;
using QMFrameWork.Log;
using System.Data;
using QMAPP.FJC.Entity;
using QMAPP.FJC.DAL;
using QMAPP.FJC.Entity.CCParameters;
using QMAPP.FJC.DAL.CCParameters;
namespace QMAPP.FJC.BLL.CCParameters
{
///
/// 作 用:加工参数采集
/// 作 者:张松男
/// 编写日期:2023年02月06日
///
public class PARAMETERSBLL : BaseBLL
{
#region 获取信息
///
/// 获取信息
///
/// 条件
/// 信息
public DataResult Get(PARAMETERS model)
{
DataResult result = new DataResult();
try
{
result.Result = new PARAMETERSDAL().Get(model);
}
catch (Exception ex)
{
result.IsSuccess = false;
result.Msg = Resource.SystemException;
throw ex;
}
result.IsSuccess = true;
return result;
}
#endregion
#region 获取列表(分页)
///
/// 获取列表
///
/// 条件
/// 数据页
/// 数据页
public DataResult GetList(PARAMETERS condition, DataPage page)
{
DataResult result = new DataResult();
try
{
//获取物料信息列表
DataPage dataPage = new PARAMETERSDAL().GetList(condition, page);
result.Result = dataPage;
}
catch (Exception ex)
{
result.IsSuccess = false;
result.Msg = Resource.SystemException;
throw ex;
}
result.IsSuccess = true;
return result;
}
///
/// 获取全部条码格式规则
///
///
public List GetAllList()
{
return new PARAMETERSDAL().GetAllList();
}
#endregion
#region 信息是否重复
///
/// 判断名称是否存在
///
/// 信息
/// true:已存在;fasel:不存在。
public bool Exists(PARAMETERS info)
{
try
{
return new PARAMETERSDAL().Exists(info);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 删除
///
/// 删除信息
///
/// 主键串
/// 删除个数
public DataResult Delete(string strs)
{
int count = 0;
DataResult result = new DataResult();
string[] list = strs.Split(":".ToCharArray());
try
{
foreach (string str in list)
{
count += this.DeleteBarcodeRules(new PARAMETERS { pid = str });
}
result.Result = count;
result.IsSuccess = true;
return result;
}
catch (Exception ex)
{
throw ex;
}
}
///
/// 删除信息
///
/// 信息
/// 删除个数
public int DeleteBarcodeRules(PARAMETERS info)
{
try
{
return new PARAMETERSDAL().Delete(info);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 导出数据
///
/// 获取导出的数据
///
/// 查询条件
/// 数据
public DataResult GetExportData(PARAMETERS info)
{
try
{
DataResult result = new DataResult();
result.Result = new PARAMETERSDAL().GetExportData(info);
result.IsSuccess = true;
return result;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
}
}