using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using QMFrameWork.Common.Encrypt;
using QMFrameWork.Data;
using QMAPP.FJC.DAL.Operation;
using QMAPP.FJC.Entity.Operation;
using QMAPP.BLL;
using QMAPP.Entity;
using QMAPP.FJC.BLL.Dict;
using QMAPP.FJC.Entity.CCParameters;
using QMAPP.FJC.DAL.CCParameters;
namespace QMAPP.FJC.BLL.CCParameters
{
///
/// 作 用:加工参数采集
/// 作 者:张松男
/// 编写日期:2023年01月16日
///
public class SYSCONFIGBLL : BaseBLL
{
#region 获取信息
///
/// 获取信息
///
/// 条件
/// 信息
public DataResult Get(SYSCONFIG model)
{
DataResult result = new DataResult();
try
{
result.Result = new SYSCONFIGDAL().Get(model);
result.IsSuccess = true;
return result;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 获取列表
///
/// 获取列表
///
/// 条件
/// 数据页
/// 数据页
public DataResult GetList(SYSCONFIG condition, DataPage page)
{
DataResult result = new DataResult();
try
{
//获取物料信息列表
DataPage dataPage = new SYSCONFIGDAL().GetList(condition, page);
result.Result = dataPage;
result.IsSuccess = true;
return result;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 插入信息
///
/// 插入信息(单表)
///
/// 信息
/// 插入行数
public DataResult Insert(SYSCONFIG model)
{
DataResult result = new DataResult();
try
{
result.Result = new SYSCONFIGDAL().Insert(model);
result.IsSuccess = true;
return result;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 更新信息
///
/// 更新信息
///
///
/// 更新行数
public DataResult Update(SYSCONFIG model)
{
try
{
DataResult result = new DataResult();
result.Result = new SYSCONFIGDAL().Update(model);
result.IsSuccess = true;
return result;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 信息是否重复
///
/// 判断名称是否存在
///
/// 信息
/// true:已存在;fasel:不存在。
public bool Exists(SYSCONFIG info)
{
try
{
return new SYSCONFIGDAL().Exists(info);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 删除
///
/// 删除信息
///
///
/// 删除个数
public DataResult Delete(string strs)
{
DataResult result = new DataResult();
int count = 0;
string[] list = strs.Split(":".ToCharArray());
try
{
foreach (string str in list)
{
count += this.DeleteMainProduct(new SYSCONFIG { CODE = str });
}
result.Result = count;
result.IsSuccess = true;
return result;
}
catch (Exception ex)
{
throw ex;
}
}
///
/// 删除信息
///
/// 信息
/// 删除个数
public int DeleteMainProduct(SYSCONFIG model)
{
int count = 0;
try
{
count = new SYSCONFIGDAL().Delete(model);
return count;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 导出数据
///
/// 获取导出的数据
///
/// 查询条件
/// 数据
public DataTable GetExportData(SYSCONFIG model)
{
try
{
return new SYSCONFIGDAL().GetExportData(model);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
}
}