using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
namespace ZXDT.CallCenter.BLL
{
///
/// T_Form_FormInfo
///
public partial class T_Form_FormInfo
{
private readonly ZXDT.CallCenter.DAL.T_Form_FormInfo dal = new ZXDT.CallCenter.DAL.T_Form_FormInfo();
public T_Form_FormInfo()
{ }
#region Method
///
/// 是否存在该记录
///
public bool Exists(int F_FormId)
{
return dal.Exists(F_FormId);
}
///
/// 增加一条数据
///
public int Add(ZXDT.CallCenter.Model.T_Form_FormInfo model)
{
return dal.Add(model);
}
///
/// 更新一条数据
///
public bool Update(ZXDT.CallCenter.Model.T_Form_FormInfo model)
{
return dal.Update(model);
}
///
/// 删除一条数据
///
public bool Delete(int F_FormId)
{
return dal.Delete(F_FormId);
}
///
/// 删除一条数据
///
public bool DeleteList(string F_FormIdlist)
{
return dal.DeleteList(F_FormIdlist);
}
///
/// 得到一个对象实体
///
public ZXDT.CallCenter.Model.T_Form_FormInfo GetModel(int F_FormId)
{
return dal.GetModel(F_FormId);
}
///
/// 获得数据列表
///
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)
{
ZXDT.CallCenter.Model.T_Form_FormInfo model;
for (int n = 0; n < rowsCount; n++)
{
model = new ZXDT.CallCenter.Model.T_Form_FormInfo();
if (dt.Rows[n]["F_FormId"] != null && dt.Rows[n]["F_FormId"].ToString() != "")
{
model.F_FormId = int.Parse(dt.Rows[n]["F_FormId"].ToString());
}
if (dt.Rows[n]["F_FormName"] != null && dt.Rows[n]["F_FormName"].ToString() != "")
{
model.F_FormName = dt.Rows[n]["F_FormName"].ToString();
}
if (dt.Rows[n]["F_FormTable"] != null && dt.Rows[n]["F_FormTable"].ToString() != "")
{
model.F_FormTable = dt.Rows[n]["F_FormTable"].ToString();
}
if (dt.Rows[n]["F_FormType"] != null && dt.Rows[n]["F_FormType"].ToString() != "")
{
model.F_FormType = dt.Rows[n]["F_FormType"].ToString();
}
if (dt.Rows[n]["F_FormDes"] != null && dt.Rows[n]["F_FormDes"].ToString() != "")
{
model.F_FormDes = dt.Rows[n]["F_FormDes"].ToString();
}
if (dt.Rows[n]["F_FormUrl"] != null && dt.Rows[n]["F_FormUrl"].ToString() != "")
{
model.F_FormUrl = dt.Rows[n]["F_FormUrl"].ToString();
}
if (dt.Rows[n]["F_EntityId"] != null && dt.Rows[n]["F_EntityId"].ToString() != "")
{
model.F_EntityId = int.Parse(dt.Rows[n]["F_EntityId"].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 && dt.Rows[n]["F_CreateBy"].ToString() != "")
{
model.F_CreateBy = int.Parse(dt.Rows[n]["F_CreateBy"].ToString());
}
if (dt.Rows[n]["F_CreateName"] != null && dt.Rows[n]["F_CreateName"].ToString() != "")
{
model.F_CreateName = dt.Rows[n]["F_CreateName"].ToString();
}
if (dt.Rows[n]["F_ModifyOn"] != null && dt.Rows[n]["F_ModifyOn"].ToString() != "")
{
model.F_ModifyOn = DateTime.Parse(dt.Rows[n]["F_ModifyOn"].ToString());
}
if (dt.Rows[n]["F_ModifyBy"] != null && dt.Rows[n]["F_ModifyBy"].ToString() != "")
{
model.F_ModifyBy = int.Parse(dt.Rows[n]["F_ModifyBy"].ToString());
}
if (dt.Rows[n]["F_ModifyName"] != null && dt.Rows[n]["F_ModifyName"].ToString() != "")
{
model.F_ModifyName = dt.Rows[n]["F_ModifyName"].ToString();
}
if (dt.Rows[n]["F_DeleteFlag"] != null && dt.Rows[n]["F_DeleteFlag"].ToString() != "")
{
model.F_DeleteFlag = int.Parse(dt.Rows[n]["F_DeleteFlag"].ToString());
}
if (dt.Rows[n]["F_ColumnCount"] != null && dt.Rows[n]["F_ColumnCount"].ToString() != "")
{
model.F_ColumnCount = int.Parse(dt.Rows[n]["F_ColumnCount"].ToString());
}
if (dt.Rows[n]["F_DBTableName"] != null && dt.Rows[n]["F_DBTableName"].ToString() != "")
{
model.F_DBTableName = dt.Rows[n]["F_DBTableName"].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);
}
///
/// 分页获取数据列表
///
//public DataSet GetList(int PageSize,int PageIndex,string strWhere)
//{
//return dal.GetList(PageSize,PageIndex,strWhere);
//}
#endregion Method
}
}