using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data; namespace HySoft.BaseCallCenter.BLL { /// /// T_QC_IndexBase /// public partial class T_QC_IndexBase { private readonly HySoft.BaseCallCenter.DAL.T_QC_IndexBase dal = new HySoft.BaseCallCenter.DAL.T_QC_IndexBase(); public T_QC_IndexBase() { } #region Method /// /// 是否存在该记录 /// public bool Exists(int F_IndexId) { return dal.Exists(F_IndexId); } /// /// 增加一条数据 /// public int Add(HySoft.BaseCallCenter.Model.T_QC_IndexBase model) { return dal.Add(model); } /// /// 更新一条数据 /// public bool Update(HySoft.BaseCallCenter.Model.T_QC_IndexBase model) { return dal.Update(model); } /// /// 删除一条数据 /// public bool Delete(int F_IndexId) { return dal.Delete(F_IndexId); } /// /// 删除一条数据 /// public bool DeleteList(string F_IndexIdlist) { return dal.DeleteList(F_IndexIdlist); } /// /// 得到一个对象实体 /// public HySoft.BaseCallCenter.Model.T_QC_IndexBase GetModel(int F_IndexId) { return dal.GetModel(F_IndexId); } /// /// 获得数据列表 /// 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) { HySoft.BaseCallCenter.Model.T_QC_IndexBase model; for (int n = 0; n < rowsCount; n++) { model = new HySoft.BaseCallCenter.Model.T_QC_IndexBase(); if (dt.Rows[n]["F_IndexId"] != null && dt.Rows[n]["F_IndexId"].ToString() != "") { model.F_IndexId = int.Parse(dt.Rows[n]["F_IndexId"].ToString()); } if (dt.Rows[n]["F_CategoryId"] != null && dt.Rows[n]["F_CategoryId"].ToString() != "") { model.F_CategoryId = int.Parse(dt.Rows[n]["F_CategoryId"].ToString()); } if (dt.Rows[n]["F_Type"] != null && dt.Rows[n]["F_Type"].ToString() != "") { model.F_Type = int.Parse(dt.Rows[n]["F_Type"].ToString()); } if (dt.Rows[n]["F_Score"] != null && dt.Rows[n]["F_Score"].ToString() != "") { model.F_Score = int.Parse(dt.Rows[n]["F_Score"].ToString()); } if (dt.Rows[n]["F_Title"] != null && dt.Rows[n]["F_Title"].ToString() != "") { model.F_Title = dt.Rows[n]["F_Title"].ToString(); } if (dt.Rows[n]["F_Content"] != null && dt.Rows[n]["F_Content"].ToString() != "") { model.F_Content = dt.Rows[n]["F_Content"].ToString(); } if (dt.Rows[n]["F_Remark"] != null && dt.Rows[n]["F_Remark"].ToString() != "") { model.F_Remark = dt.Rows[n]["F_Remark"].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_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_DeleteFlag"] != null && dt.Rows[n]["F_DeleteFlag"].ToString() != "") { model.F_DeleteFlag = int.Parse(dt.Rows[n]["F_DeleteFlag"].ToString()); } if (dt.Rows[n]["F_SortModel"] != null && dt.Rows[n]["F_SortModel"].ToString() != "") { model.F_SortModel = int.Parse(dt.Rows[n]["F_SortModel"].ToString()); } if (dt.Rows[n]["F_Sort"] != null && dt.Rows[n]["F_Sort"].ToString() != "") { model.F_Sort = int.Parse(dt.Rows[n]["F_Sort"].ToString()); } if (dt.Rows[n]["F_CategoryName"] != null && dt.Rows[n]["F_CategoryName"].ToString() != "") { model.F_CategoryName = dt.Rows[n]["F_CategoryName"].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 } }