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
{
///
/// 支持交互问题类型逻辑层对象
/// 创建者:wangyf
/// 创建日期:2015.03.30
///
public class SIProblemTypeBLL : BaseBLL
{
#region 获取信息
///
/// 获取信息
///
/// 条件
/// 信息
public SIProblemType Get(SIProblemType model)
{
try
{
return new SIProblemTypeDAL().Get(model);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 获取列表
///
/// 获取列表
///
/// 条件
/// 数据页
/// 数据页
public DataPage GetList(SIProblemType condition, DataPage page)
{
try
{
return new SIProblemTypeDAL().GetList(condition, page);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 判断类型名称是否已经存在
///
/// 判断类型名称是否已经存在
///
/// 条件
/// 数据页
/// 数据页
public bool CheckProblemTypeNameExist(SIProblemType condition)
{
try
{
return new SIProblemTypeDAL().CheckProblemTypeNameExist(condition);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 插入信息
///
/// 插入信息(单表)
///
/// 信息
/// 插入行数
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 更新信息
///
/// 更新信息
///
///
/// 更新行数
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 删除
///
/// 删除信息
///
///
/// 删除个数
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;
}
}
///
/// 删除信息
///
/// 信息
/// 删除个数
public int DeleteSIProblemType(SIProblemType model)
{
int count = 0;
try
{
count = new SIProblemTypeDAL().Delete(model);
return count;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 获取导出的数据
///
/// 获取导出的数据
///
/// 查询条件
/// 数据
public DataTable GetExportData(SIProblemType entity)
{
DataTable dt = new DataTable();
try
{
dt = new SIProblemTypeDAL().GetExportData(entity);
return dt;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
}
}