天津投入产出系统后端
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.
 
 
 
 
 
 

200 lines
5.7 KiB

using System;
using System.Collections.Generic;
using QMAPP.BLL;
using QMAPP.Entity;
using QMFrameWork.Data;
using QMFrameWork.Log;
using QMAPP.FJC.Entity.Dianjian;
using QMAPP.FJC.DAL.Dianjian;
namespace QMAPP.FJC.BLL.Dianjian
{
/// <summary>
/// 模块名称:注塑料筒信息
/// 作 者:张松男
/// 编写日期:2021年07月13日
/// </summary>
public class InOutPutInventoryLogBLL : BaseBLL
{
#region 获取信息
/// <summary>
/// 获取信息
/// </summary>
/// <param name="">条件</param>
/// <returns>信息</returns>
public DataResult<InOutPut_InventoryLog> Get(InOutPut_InventoryLog model)
{
DataResult<InOutPut_InventoryLog> result = new DataResult<InOutPut_InventoryLog>();
try
{
result.Result = new InOutPut_InventoryLogDAL().Get(model);
result.IsSuccess = true;
}
catch (Exception ex)
{
LogManager.LogHelper.Error(new LogInfo()
{
ErrorInfo = ex,
Tag = ex.StackTrace,
Info = "获取异常!"
});
result.IsSuccess = false;
result.Ex = ex;
result.Msg = "获取异常";
}
return result;
}
#endregion
#region 获取列表
/// <summary>
/// 获取列表
/// </summary>
/// <param name="condition">条件</param>
/// <param name="page">数据页</param>
/// <returns>数据页</returns>
public DataResult<DataPage> GetList(InOutPut_InventoryLog condition, DataPage page)
{
DataResult<DataPage> result = new DataResult<DataPage>();
try
{
DataPage dataPage = new InOutPut_InventoryLogDAL().GetList(condition, page);
result.IsSuccess = true;
result.Result = dataPage;
}
catch (Exception ex)
{
LogManager.LogHelper.Error(new LogInfo()
{
ErrorInfo = ex,
Tag = ex.StackTrace,
Info = "获取列表异常!"
});
result.IsSuccess = false;
result.Ex = ex;
result.Msg = "获取列表异常!";
}
return result;
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="condition">条件</param>
/// <returns>全部集合</returns>
public List<InOutPut_InventoryLog> GetAllList()
{
try
{
//获取信息列表
return new InOutPut_InventoryLogDAL().GetALL();
}
catch (Exception ex)
{
LogManager.LogHelper.Error(new LogInfo()
{
ErrorInfo = ex,
Tag = ex.StackTrace,
Info = "获取列表异常!"
});
throw ex;
}
}
#endregion
#region 插入信息
/// <summary>
/// 插入信息(单表)
/// </summary>
/// <param name="">信息</param>
/// <returns>插入行数</returns>
public DataResult<int> Insert(InOutPut_InventoryLog info)
{
DataResult<int> result = new DataResult<int>();
try
{
//基本信息
info.PID = Guid.NewGuid().ToString();
InOutPut_InventoryLogDAL cmdDAL = new InOutPut_InventoryLogDAL();
result.Result = cmdDAL.Insert(info);
result.IsSuccess = true;
return result;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 更新信息
/// <summary>
/// 更新信息
/// </summary>
/// <param name=""></param>
/// <returns>更新行数</returns>
public DataResult Update(InOutPut_InventoryLog model)
{
DataResult result = new DataResult();
result.IsSuccess = true;
try
{
InOutPut_InventoryLog info = new InOutPut_InventoryLogDAL().Get(model);
//基本信息
info.Type = model.Type;
int temp = new InOutPut_InventoryLogDAL().Update(info);
if (temp == 0)
{
result.IsSuccess = false;
result.Msg = "更新失败!";
return result;
}
}
catch (Exception ex)
{
LogManager.LogHelper.Error(new LogInfo()
{
ErrorInfo = ex,
Tag = ex.StackTrace,
Info = "更新异常!"
});
result.IsSuccess = false;
result.Ex = ex;
result.Msg = "更新异常";
}
return result;
}
#endregion
#region 删除
/// <summary>
/// 删除信息
/// </summary>
/// <param name="">信息</param>
/// <returns>删除个数</returns>
public int Delete(string model)
{
int count = 0;
try
{
count = new InOutPut_InventoryLogDAL().Delete(model);
return count;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
}
}