using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data; namespace HySoft.BaseCallCenter.BLL { /// /// T_Form_EntityAttribute /// public partial class T_Form_EntityAttribute { private readonly HySoft.BaseCallCenter.DAL.T_Form_EntityAttribute dal = new HySoft.BaseCallCenter.DAL.T_Form_EntityAttribute(); public T_Form_EntityAttribute() { } #region Method /// /// 是否存在该记录 /// public bool Exists(int F_AttributeId) { return dal.Exists(F_AttributeId); } /// /// 增加一条数据 /// public int Add(HySoft.BaseCallCenter.Model.T_Form_EntityAttribute model) { return dal.Add(model); } /// /// 更新一条数据 /// public bool Update(HySoft.BaseCallCenter.Model.T_Form_EntityAttribute model) { return dal.Update(model); } /// /// 删除一条数据 /// public bool Delete(int F_AttributeId) { return dal.Delete(F_AttributeId); } /// /// 删除一条数据 /// public bool DeleteList(string F_AttributeIdlist) { return dal.DeleteList(F_AttributeIdlist); } /// /// 得到一个对象实体 /// public HySoft.BaseCallCenter.Model.T_Form_EntityAttribute GetModel(int F_AttributeId) { return dal.GetModel(F_AttributeId); } /// /// 获得数据列表 /// 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_Form_EntityAttribute model; for (int n = 0; n < rowsCount; n++) { model = new HySoft.BaseCallCenter.Model.T_Form_EntityAttribute(); if (dt.Rows[n]["F_AttributeId"] != null && dt.Rows[n]["F_AttributeId"].ToString() != "") { model.F_AttributeId = int.Parse(dt.Rows[n]["F_AttributeId"].ToString()); } if (dt.Rows[n]["F_TypeId"] != null && dt.Rows[n]["F_TypeId"].ToString() != "") { model.F_TypeId = int.Parse(dt.Rows[n]["F_TypeId"].ToString()); } if (dt.Rows[n]["F_DBTypeName"] != null && dt.Rows[n]["F_DBTypeName"].ToString() != "") { model.F_DBTypeName = dt.Rows[n]["F_DBTypeName"].ToString(); } if (dt.Rows[n]["F_Name"] != null && dt.Rows[n]["F_Name"].ToString() != "") { model.F_Name = dt.Rows[n]["F_Name"].ToString(); } if (dt.Rows[n]["F_DBFieldlName"] != null && dt.Rows[n]["F_DBFieldlName"].ToString() != "") { model.F_DBFieldlName = dt.Rows[n]["F_DBFieldlName"].ToString(); } if (dt.Rows[n]["F_Length"] != null && dt.Rows[n]["F_Length"].ToString() != "") { model.F_Length = int.Parse(dt.Rows[n]["F_Length"].ToString()); } if (dt.Rows[n]["F_IsNullable"] != null && dt.Rows[n]["F_IsNullable"].ToString() != "") { if ((dt.Rows[n]["F_IsNullable"].ToString() == "1") || (dt.Rows[n]["F_IsNullable"].ToString().ToLower() == "true")) { model.F_IsNullable = true; } else { model.F_IsNullable = false; } } 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_DBTableName"] != null && dt.Rows[n]["F_DBTableName"].ToString() != "") { model.F_DBTableName = dt.Rows[n]["F_DBTableName"].ToString(); } if (dt.Rows[n]["F_DefaultValue"] != null && dt.Rows[n]["F_DefaultValue"].ToString() != "") { model.F_DefaultValue = dt.Rows[n]["F_DefaultValue"].ToString(); } if (dt.Rows[n]["F_ColumnNumber"] != null && dt.Rows[n]["F_ColumnNumber"].ToString() != "") { model.F_ColumnNumber = int.Parse(dt.Rows[n]["F_ColumnNumber"].ToString()); } if (dt.Rows[n]["F_ValidForUpdateAPI"] != null && dt.Rows[n]["F_ValidForUpdateAPI"].ToString() != "") { if ((dt.Rows[n]["F_ValidForUpdateAPI"].ToString() == "1") || (dt.Rows[n]["F_ValidForUpdateAPI"].ToString().ToLower() == "true")) { model.F_ValidForUpdateAPI = true; } else { model.F_ValidForUpdateAPI = false; } } if (dt.Rows[n]["F_ValidForReadAPI"] != null && dt.Rows[n]["F_ValidForReadAPI"].ToString() != "") { if ((dt.Rows[n]["F_ValidForReadAPI"].ToString() == "1") || (dt.Rows[n]["F_ValidForReadAPI"].ToString().ToLower() == "true")) { model.F_ValidForReadAPI = true; } else { model.F_ValidForReadAPI = false; } } if (dt.Rows[n]["F_ValidForCreateAPI"] != null && dt.Rows[n]["F_ValidForCreateAPI"].ToString() != "") { if ((dt.Rows[n]["F_ValidForCreateAPI"].ToString() == "1") || (dt.Rows[n]["F_ValidForCreateAPI"].ToString().ToLower() == "true")) { model.F_ValidForCreateAPI = true; } else { model.F_ValidForCreateAPI = false; } } if (dt.Rows[n]["F_VisibleToPlatform"] != null && dt.Rows[n]["F_VisibleToPlatform"].ToString() != "") { if ((dt.Rows[n]["F_VisibleToPlatform"].ToString() == "1") || (dt.Rows[n]["F_VisibleToPlatform"].ToString().ToLower() == "true")) { model.F_VisibleToPlatform = true; } else { model.F_VisibleToPlatform = false; } } if (dt.Rows[n]["F_IsPKAttribute"] != null && dt.Rows[n]["F_IsPKAttribute"].ToString() != "") { if ((dt.Rows[n]["F_IsPKAttribute"].ToString() == "1") || (dt.Rows[n]["F_IsPKAttribute"].ToString().ToLower() == "true")) { model.F_IsPKAttribute = true; } else { model.F_IsPKAttribute = false; } } if (dt.Rows[n]["F_IsCustomField"] != null && dt.Rows[n]["F_IsCustomField"].ToString() != "") { if ((dt.Rows[n]["F_IsCustomField"].ToString() == "1") || (dt.Rows[n]["F_IsCustomField"].ToString().ToLower() == "true")) { model.F_IsCustomField = true; } else { model.F_IsCustomField = false; } } if (dt.Rows[n]["F_DisplayMask"] != null && dt.Rows[n]["F_DisplayMask"].ToString() != "") { model.F_DisplayMask = int.Parse(dt.Rows[n]["F_DisplayMask"].ToString()); } if (dt.Rows[n]["F_IsSortAttribute"] != null && dt.Rows[n]["F_IsSortAttribute"].ToString() != "") { if ((dt.Rows[n]["F_IsSortAttribute"].ToString() == "1") || (dt.Rows[n]["F_IsSortAttribute"].ToString().ToLower() == "true")) { model.F_IsSortAttribute = true; } else { model.F_IsSortAttribute = false; } } if (dt.Rows[n]["F_PrecisionValue"] != null && dt.Rows[n]["F_PrecisionValue"].ToString() != "") { model.F_PrecisionValue = int.Parse(dt.Rows[n]["F_PrecisionValue"].ToString()); } if (dt.Rows[n]["F_IsIdentity"] != null && dt.Rows[n]["F_IsIdentity"].ToString() != "") { if ((dt.Rows[n]["F_IsIdentity"].ToString() == "1") || (dt.Rows[n]["F_IsIdentity"].ToString().ToLower() == "true")) { model.F_IsIdentity = true; } else { model.F_IsIdentity = false; } } if (dt.Rows[n]["F_AppDefaultValue"] != null && dt.Rows[n]["F_AppDefaultValue"].ToString() != "") { model.F_AppDefaultValue = int.Parse(dt.Rows[n]["F_AppDefaultValue"].ToString()); } if (dt.Rows[n]["F_Locked"] != null && dt.Rows[n]["F_Locked"].ToString() != "") { if ((dt.Rows[n]["F_Locked"].ToString() == "1") || (dt.Rows[n]["F_Locked"].ToString().ToLower() == "true")) { model.F_Locked = true; } else { model.F_Locked = false; } } if (dt.Rows[n]["F_MaxLength"] != null && dt.Rows[n]["F_MaxLength"].ToString() != "") { model.F_MaxLength = int.Parse(dt.Rows[n]["F_MaxLength"].ToString()); } if (dt.Rows[n]["F_MinValue"] != null && dt.Rows[n]["F_MinValue"].ToString() != "") { model.F_MinValue = decimal.Parse(dt.Rows[n]["F_MinValue"].ToString()); } if (dt.Rows[n]["F_MaxValue"] != null && dt.Rows[n]["F_MaxValue"].ToString() != "") { model.F_MaxValue = decimal.Parse(dt.Rows[n]["F_MaxValue"].ToString()); } if (dt.Rows[n]["F_LookupKey"] != null && dt.Rows[n]["F_LookupKey"].ToString() != "") { model.F_LookupKey = dt.Rows[n]["F_LookupKey"].ToString(); } if (dt.Rows[n]["F_LookupStyle"] != null && dt.Rows[n]["F_LookupStyle"].ToString() != "") { model.F_LookupStyle = dt.Rows[n]["F_LookupStyle"].ToString(); } if (dt.Rows[n]["F_IsLookup"] != null && dt.Rows[n]["F_IsLookup"].ToString() != "") { if ((dt.Rows[n]["F_IsLookup"].ToString() == "1") || (dt.Rows[n]["F_IsLookup"].ToString().ToLower() == "true")) { model.F_IsLookup = true; } else { model.F_IsLookup = false; } } if (dt.Rows[n]["F_Des"] != null && dt.Rows[n]["F_Des"].ToString() != "") { model.F_Des = dt.Rows[n]["F_Des"].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 /// /// 增加一条数据 /// public int AddTran(Model.T_Form_EntityAttribute model) { return dal.AddTran(model); } } }