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.
212 lines
5.3 KiB
212 lines
5.3 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using QMAPP.BLL;
|
|
using QMAPP.FJC.Entity.Basic;
|
|
using QMAPP.FJC.DAL.Basic;
|
|
using QMFrameWork.Data;
|
|
using QMAPP.FJC.Entity;
|
|
using QMAPP.FJC.BLL.Dict;
|
|
using QMAPP.Entity;
|
|
using QMFrameWork.Log;
|
|
|
|
|
|
namespace QMAPP.FJC.BLL.Basic
|
|
{
|
|
/// <summary>
|
|
/// 模块编号:
|
|
/// 作 用:设备的模具列表
|
|
/// 作 者:王庆男
|
|
/// 编写日期:2015年06月19日
|
|
///</summary>
|
|
public class MachineInfoModelBLL : BaseBLL
|
|
{
|
|
|
|
|
|
#region 获取信息
|
|
/// <summary>
|
|
/// 获取信息
|
|
/// </summary>
|
|
/// <param name="">条件</param>
|
|
/// <returns>信息</returns>
|
|
public MachineInfoModels Get(MachineInfoModels model)
|
|
{
|
|
try
|
|
{
|
|
return new MachineInfoModelDAL().Get(model);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
|
|
#region 获取列表
|
|
/// <summary>
|
|
/// 获取列表
|
|
/// </summary>
|
|
/// <param name="condition">条件</param>
|
|
/// <param name="page">数据页</param>
|
|
/// <returns>数据页</returns>
|
|
public DataPage GetList(MachineInfoModels condition, DataPage page)
|
|
{
|
|
try
|
|
{
|
|
return new MachineInfoModelDAL().GetList(condition, page);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取列表
|
|
/// </summary>
|
|
/// <param name="condition">条件</param>
|
|
/// <param name="page">数据页</param>
|
|
/// <returns>数据页</returns>
|
|
public List<MachineInfoModels> GetAllList(MachineInfoModels condition)
|
|
{
|
|
try
|
|
{
|
|
return new MachineInfoModelDAL().GetList(condition);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
|
|
#region 信息是否重复
|
|
/// <summary>
|
|
/// 判断名称是否存在
|
|
/// </summary>
|
|
/// <param name="info"></param>
|
|
/// <returns>true:已存在;fasel:不存在。</returns>
|
|
public bool ExistsMachineInfoModel(MachineInfoModels model)
|
|
{
|
|
try
|
|
{
|
|
return new MachineInfoModelDAL().ExistsMachineInfoModel(model);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
#region 插入信息
|
|
/// <summary>
|
|
/// 插入信息(单表)
|
|
/// </summary>
|
|
/// <param name="">信息</param>
|
|
/// <returns>插入行数</returns>
|
|
public int Insert(MachineInfoModels model)
|
|
{
|
|
try
|
|
{
|
|
//基本信息
|
|
model.PID = Guid.NewGuid().ToString();
|
|
model.CREATEUSER = this.LoginUser.UserID;
|
|
model.CREATEDATE = DateTime.Now;
|
|
model.UPDATEUSER = model.CREATEUSER;
|
|
model.UPDATEDATE = model.CREATEDATE;
|
|
MachineInfoModelDAL cmdDAL = new MachineInfoModelDAL();
|
|
if (ExistsMachineInfoModel(model) == true)
|
|
return -1;
|
|
return new MachineInfoModelDAL().Insert(model);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
|
|
#region 更新信息
|
|
/// <summary>
|
|
/// 更新信息
|
|
/// </summary>
|
|
/// <param name=""></param>
|
|
/// <returns>更新行数</returns>
|
|
public int Update(MachineInfoModels model)
|
|
{
|
|
try
|
|
{
|
|
//if (ExistsMachineInfoModel(Model) == true)
|
|
//return -1;
|
|
//基本信息
|
|
model.UPDATEUSER = this.LoginUser.UserID;
|
|
return new MachineInfoModelDAL().Update(model);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
|
|
#region 删除
|
|
/// <summary>
|
|
/// 删除信息
|
|
/// </summary>
|
|
/// <param name=""></param>
|
|
/// <returns>删除个数</returns>
|
|
public int Delete(string strs)
|
|
{
|
|
int count = 0;
|
|
string[] list = strs.Split(":".ToCharArray());
|
|
try
|
|
{
|
|
foreach (string str in list)
|
|
{
|
|
count += this.DeleteMachineInfoModel(new MachineInfoModels { PID = str });
|
|
}
|
|
return count;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 删除信息
|
|
/// </summary>
|
|
/// <param name="">信息</param>
|
|
/// <returns>删除个数</returns>
|
|
public int DeleteMachineInfoModel(MachineInfoModels model)
|
|
{
|
|
int count = 0;
|
|
try
|
|
{
|
|
count = new MachineInfoModelDAL().Delete(model);
|
|
return count;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
#endregion
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|