天津投入产出系统后端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

227 lines
6.4 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QMAPP.BLL;
using QMAPP.MD.Entity;
using QMAPP.Entity;
using QMAPP.MD.DAL;
using QMFrameWork.Data;
using QMFrameWork.Log;
namespace QMAPP.MD.BLL
{
/// <summary>
/// 物料类别信息
/// 20180117
/// </summary>
public class MaterialClassBLL : BaseBLL
{
#region 获取信息
/// <summary>
/// 获取信息
/// </summary>
/// <param name="">条件</param>
/// <returns>信息</returns>
public DataResult<MaterialClass> Get(MaterialClass model)
{
DataResult<MaterialClass> result = new DataResult<MaterialClass>();
try
{
result.Result = new MaterialClassDAL().Get(model);
}
catch (Exception ex)
{
result.IsSuccess = false;
result.Msg = Resource.SystemException;
throw ex;
}
result.IsSuccess = true;
return result;
}
/// <summary>
/// 获取信息
/// </summary>
/// <param name="">条件</param>
/// <returns>信息</returns>
public DataResult<MaterialClass> GetMP4(MaterialClass model)
{
DataResult<MaterialClass> result = new DataResult<MaterialClass>();
try
{
result.Result = new MaterialClassDAL().GetMP4(model);
}
catch (Exception ex)
{
result.IsSuccess = false;
result.Msg = Resource.SystemException;
throw ex;
}
result.IsSuccess = true;
return result;
}
#endregion
#region 获取分页列表
/// <summary>
/// 获取分页列表
/// </summary>
/// <param name="condition">条件</param>
/// <param name="page">数据页</param>
/// <returns>数据页</returns>
public DataResult<DataPage> GetList(MaterialClass condition, DataPage page)
{
DataResult<DataPage> result = new DataResult<DataPage>();
try
{
//获取物料信息列表
DataPage dataPage = new MaterialClassDAL().GetList(condition, page);
#region 外购件标识
List<MaterialClass> materielList = dataPage.Result as List<MaterialClass>;
#endregion
result.Result = dataPage;
}
catch (Exception ex)
{
result.IsSuccess = false;
result.Msg = Resource.SystemException;
throw ex;
}
result.IsSuccess = true;
return result;
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="condition">条件</param>
/// <returns>全部集合</returns>
public List<MaterialClass> GetAllList(MaterialClass condition)
{
try
{
//获取物料信息列表
List<MaterialClass> list = new MaterialClassDAL().GetList(condition);
return list;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 获取组织机构树形列表
/// <summary>
/// 获取组织机构树形列表
/// </summary>
/// <returns>数据页</returns>
public List<MaterialClass> GetSubTreeList(MaterialClass materialcalss)
{
try
{
return new MaterialClassDAL().GetSubTreeList(materialcalss);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 获取SEQ_NUM最大号
/// <summary>
/// 获取信息
/// </summary>
/// <param name="">条件</param>
/// <returns>信息</returns>
public int GetMaxSeqNum(MaterialClass model)
{
try
{
var pi = new MaterialClassDAL().GetMaxSeqNum(model);
return pi.SEQ_NUM;
}
catch (Exception ex)
{
LogManager.LogHelper.Error(new LogInfo()
{
ErrorInfo = ex,
Tag = ex.StackTrace,
Info = "获取SEQ_NUM最大号"
});
throw ex;
}
}
#endregion
#region 插入信息
/// <summary>
/// 插入信息(单表)
/// </summary>
/// <param name="">信息</param>
/// <returns>插入行数</returns>
public DataResult<int> Insert(MaterialClass model)
{
DataResult<int> result = new DataResult<int>();
//基本信息
model.PID = Guid.NewGuid().ToString();
model.FLGDEL = "0";
model.CREATEUSER = this.LoginUser.UserID;
model.UPDATEUSER = model.CREATEUSER;
try
{
//if (ExistsMateriel(model) == true)
//{
// result.IsSuccess = false;
// result.Msg = Resource.MaterielCodeIsHave;
// return result;
//}
result.Result = new MaterialClassDAL().Insert(model);
}
catch (Exception ex)
{
result.IsSuccess = false;
result.Msg = Resource.SystemException;
throw ex;
}
result.IsSuccess = true;
return result;
}
#endregion
#region 删除信息
/// <summary>
/// 删除信息
/// </summary>
/// <param name="">信息</param>
/// <returns>插入行数</returns>
public DataResult<int> Delete(string pid)
{
DataResult<int> result = new DataResult<int>();
try
{
result.Result = new MaterialClassDAL().Delete(pid);
}
catch (Exception ex)
{
result.IsSuccess = false;
result.Msg = Resource.SystemException;
return result;
}
result.IsSuccess = true;
return result;
}
#endregion
}
}