using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CallCenterApi.BLL
{
///
/// T_Repository_List_Audit
///
public partial class T_Repository_List_Audit
{
private readonly CallCenterApi.DAL.T_Repository_List_Audit dal = new CallCenterApi.DAL.T_Repository_List_Audit();
public T_Repository_List_Audit()
{ }
#region Method
///
/// 是否存在该记录
///
public bool Exists(int F_AuditId)
{
return dal.Exists(F_AuditId);
}
///
/// 增加一条数据
///
public int Add(CallCenterApi.Model.T_Repository_List_Audit model)
{
return dal.Add(model);
}
///
/// 更新一条数据
///
public bool Update(CallCenterApi.Model.T_Repository_List_Audit model)
{
return dal.Update(model);
}
///
/// 删除一条数据
///
public bool Delete(int F_AuditId)
{
return dal.Delete(F_AuditId);
}
///
/// 删除一条数据
///
public bool DeleteList(string F_AuditIdlist)
{
return dal.DeleteList(F_AuditIdlist);
}
///
/// 得到一个对象实体
///
public CallCenterApi.Model.T_Repository_List_Audit GetModel(int F_AuditId)
{
return dal.GetModel(F_AuditId);
}
///
/// 获得数据列表
///
public DataSet GetList(string strWhere)
{
return dal.GetList(strWhere);
}
///
/// 获得前几行数据
///
public DataSet GetList(int Top, string strWhere, string filedOrder)
{
return dal.GetList(Top, strWhere, filedOrder);
}
///
/// 获得数据列表
///
public List GetModelList(string strWhere)
{
DataSet ds = dal.GetList(strWhere);
return DataTableToList(ds.Tables[0]);
}
///
/// 获得数据列表
///
public List DataTableToList(DataTable dt)
{
List modelList = new List();
int rowsCount = dt.Rows.Count;
if (rowsCount > 0)
{
CallCenterApi.Model.T_Repository_List_Audit model;
for (int n = 0; n < rowsCount; n++)
{
model = new CallCenterApi.Model.T_Repository_List_Audit();
if (dt.Rows[n]["F_AuditId"] != null && dt.Rows[n]["F_AuditId"].ToString() != "")
{
model.F_AuditId = int.Parse(dt.Rows[n]["F_AuditId"].ToString());
}
if (dt.Rows[n]["F_RepositoryId"] != null && dt.Rows[n]["F_RepositoryId"].ToString() != "")
{
model.F_RepositoryId = int.Parse(dt.Rows[n]["F_RepositoryId"].ToString());
}
if (dt.Rows[n]["F_Action"] != null && dt.Rows[n]["F_Action"].ToString() != "")
{
model.F_Action = int.Parse(dt.Rows[n]["F_Action"].ToString());
}
if (dt.Rows[n]["F_CreateOn"] != null && dt.Rows[n]["F_CreateOn"].ToString() != "")
{
model.F_CreateOn = DateTime.Parse(dt.Rows[n]["F_CreateOn"].ToString());
}
if (dt.Rows[n]["F_CreateBy"] != null)
{
model.F_CreateBy = dt.Rows[n]["F_CreateBy"].ToString();
}
if (dt.Rows[n]["F_PreLogID"] != null && dt.Rows[n]["F_PreLogID"].ToString() != "")
{
model.F_PreLogID = int.Parse(dt.Rows[n]["F_PreLogID"].ToString());
}
if (dt.Rows[n]["F_AfterLogID"] != null && dt.Rows[n]["F_AfterLogID"].ToString() != "")
{
model.F_AfterLogID = int.Parse(dt.Rows[n]["F_AfterLogID"].ToString());
}
if (dt.Rows[n]["F_AuditOn"] != null && dt.Rows[n]["F_AuditOn"].ToString() != "")
{
model.F_AuditOn = DateTime.Parse(dt.Rows[n]["F_AuditOn"].ToString());
}
if (dt.Rows[n]["F_AuditBy"] != null)
{
model.F_AuditBy = dt.Rows[n]["F_AuditBy"].ToString();
}
if (dt.Rows[n]["F_ISPass"] != null && dt.Rows[n]["F_ISPass"].ToString() != "")
{
model.F_ISPass = int.Parse(dt.Rows[n]["F_ISPass"].ToString());
}
if (dt.Rows[n]["F_AuditRemark"] != null && dt.Rows[n]["F_AuditRemark"].ToString() != "")
{
model.F_AuditRemark = dt.Rows[n]["F_AuditRemark"].ToString();
}
if (dt.Rows[n]["F_Expand1"] != null && dt.Rows[n]["F_Expand1"].ToString() != "")
{
model.F_Expand1 = dt.Rows[n]["F_Expand1"].ToString();
}
if (dt.Rows[n]["F_Expand2"] != null && dt.Rows[n]["F_Expand2"].ToString() != "")
{
model.F_Expand2 = dt.Rows[n]["F_Expand2"].ToString();
}
if (dt.Rows[n]["F_IntExpand1"] != null && dt.Rows[n]["F_IntExpand1"].ToString() != "")
{
model.F_IntExpand1 = int.Parse(dt.Rows[n]["F_IntExpand1"].ToString());
}
modelList.Add(model);
}
}
return modelList;
}
///
/// 获得数据列表
///
public DataSet GetAllList()
{
return GetList("");
}
///
/// 分页获取数据列表
///
public int GetRecordCount(string strWhere)
{
return dal.GetRecordCount(strWhere);
}
///
/// 分页获取数据列表
///
public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
{
return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
}
#endregion Method
}
}