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.MD.Entity;
using QMAPP.MD.DAL;
using QMAPP.FJC.Entity.BZD;
namespace QMAPP.FJC.BLL.BZD
{
///
/// 模块名称:BZD条码配置
/// 作 者:宁红钢
/// 编写日期:2019年10月12日
///
public class BZDRecorderBLL : BaseBLL
{
#region 获取信息
///
/// 获取信息
///
/// 条件
/// 信息
public DataResult Get(BZDRecorder2 model)
{
DataResult result = new DataResult();
try
{
result.Result = new BZDRecorderDAL().Get(model);
}
catch (Exception ex)
{
result.IsSuccess = false;
result.Msg = Resource.SystemException;
throw ex;
}
result.IsSuccess = true;
return result;
}
public BZDRecorder2 GetRecord(BZDRecorder2 model)
{
DataResult result = new DataResult();
try
{
return new BZDRecorderDAL().GetRecord(model);
}
catch (Exception ex)
{
result.IsSuccess = false;
result.Msg = Resource.SystemException;
throw ex;
}
}
public BZDRecorder2 Get316Record(BZDRecorder2 model)
{
DataResult result = new DataResult();
try
{
return new BZDRecorderDAL().Get316Record(model);
}
catch (Exception ex)
{
result.IsSuccess = false;
result.Msg = Resource.SystemException;
throw ex;
}
}
#endregion
#region 获取列表(分页)
///
/// 获取列表
///
/// 条件
/// 数据页
/// 数据页
public DataResult GetList(BZDRecorder2 condition, DataPage page)
{
DataResult result = new DataResult();
try
{
//获取物料信息列表
DataPage dataPage = new BZDRecorderDAL().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 BZDRecorderDAL().GetAllList();
}
#endregion
#region 信息是否重复
///
/// 判断名称是否存在
///
/// 信息
/// true:已存在;fasel:不存在。
public bool Exists(BZDRecorder info)
{
try
{
return new BZDRecorderDAL().Exists(info);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
//public List getMaxSeq(string BZDCODE)
//{
// List list = new List();
// list.Add(new BZDRecorderDAL().getMaxSeq(BZDCODE));
// return list;
//}
public List CreateBZDCode(List paramList)
{
return new BZDRecorderDAL().CreateBZDCode(paramList, this.LoginUser.UserID);
}
#region 插入信息
///
/// 插入信息(单表)
///
/// 信息
/// 插入行数
public int Insert(BZDRecorder info)
{
try
{
//基本信息
info.PID = Guid.NewGuid().ToString();
// info.MPID = "";
info.CREATEUSER = this.LoginUser.UserID;
info.CREATEDATE = DateTime.Now;
//info.UPDATEUSER = info.CREATEUSER;
//info.UPDATEDATE = info.CREATEDATE;
//info.FLGDEL = "0";
BZDRecorderDAL cmdDAL = new BZDRecorderDAL();
return new BZDRecorderDAL().Insert(info);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 更新信息
///
/// 更新信息
///
/// 信息
/// 更新行数
public DataResult Update(BZDRecorder info)
{
DataResult result = new DataResult();
try
{
//info.UPDATEUSER = this.LoginUser.UserID;
//info.UPDATEDATE = DateTime.Now;
//info.FLGDEL = "0";
result.Result = new BZDRecorderDAL().Update(info);
result.IsSuccess = true;
return result;
}
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 BZDRecorder { PID = str });
}
result.Result = count;
result.IsSuccess = true;
return result;
}
catch (Exception ex)
{
throw ex;
}
}
///
/// 删除信息
///
/// 信息
/// 删除个数
public int DeleteBarcodeRules(BZDRecorder info)
{
try
{
return new BZDRecorderDAL().Delete(info);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 导出数据
///
/// 获取导出的数据
///
/// 查询条件
/// 数据
public DataTable GetExportData(BZDRecorder2 info)
{
try
{
return new BZDRecorderDAL().GetExportData(info);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
}
}