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

197 lines
5.1 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QMAPP.Entity.Sys;
using QMFrameWork.Data;
using QMAPP.DAL.Sys;
using System.Data;
namespace QMAPP.BLL.Sys
{
/// <summary>
/// 支持交互问题类型逻辑层对象
/// 创建者:wangyf
/// 创建日期:2015.03.30
/// </summary>
public class SIProblemTypeBLL : BaseBLL
{
#region 获取信息
/// <summary>
/// 获取信息
/// </summary>
/// <param name="">条件</param>
/// <returns>信息</returns>
public SIProblemType Get(SIProblemType model)
{
try
{
return new SIProblemTypeDAL().Get(model);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 获取列表
/// <summary>
/// 获取列表
/// </summary>
/// <param name="condition">条件</param>
/// <param name="page">数据页</param>
/// <returns>数据页</returns>
public DataPage GetList(SIProblemType condition, DataPage page)
{
try
{
return new SIProblemTypeDAL().GetList(condition, page);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 判断类型名称是否已经存在
/// <summary>
/// 判断类型名称是否已经存在
/// </summary>
/// <param name="condition">条件</param>
/// <param name="page">数据页</param>
/// <returns>数据页</returns>
public bool CheckProblemTypeNameExist(SIProblemType condition)
{
try
{
return new SIProblemTypeDAL().CheckProblemTypeNameExist(condition);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 插入信息
/// <summary>
/// 插入信息(单表)
/// </summary>
/// <param name="">信息</param>
/// <returns>插入行数</returns>
public int Insert(SIProblemType model)
{
try
{
//基本信息
model.PID = Guid.NewGuid().ToString();
model.FlgDel = "0";
model.CreateUser = this.LoginUser.UserID;
model.CreateDate = DateTime.Now;
model.UpdateUser = model.CreateUser;
model.UpdateDate = model.CreateDate;
return new SIProblemTypeDAL().Insert(model);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 更新信息
/// <summary>
/// 更新信息
/// </summary>
/// <param name=""></param>
/// <returns>更新行数</returns>
public int Update(SIProblemType model)
{
try
{
//基本信息
model.UpdateUser = this.LoginUser.UserID;
model.UpdateDate = DateTime.Now;
return new SIProblemTypeDAL().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.DeleteSIProblemType(new SIProblemType { PID = str ,FlgDel = "1" });
}
return count;
}
catch (Exception ex)
{
throw ex;
}
}
/// <summary>
/// 删除信息
/// </summary>
/// <param name="">信息</param>
/// <returns>删除个数</returns>
public int DeleteSIProblemType(SIProblemType model)
{
int count = 0;
try
{
count = new SIProblemTypeDAL().Delete(model);
return count;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 获取导出的数据
/// <summary>
/// 获取导出的数据
/// </summary>
/// <param name="user">查询条件</param>
/// <returns>数据</returns>
public DataTable GetExportData(SIProblemType entity)
{
DataTable dt = new DataTable();
try
{
dt = new SIProblemTypeDAL().GetExportData(entity);
return dt;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
}
}