| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Data;
- namespace YTSoft.BaseCallCenter.BLL
- {
- /// <summary>
- /// T_Form_EntityAttribute
- /// </summary>
- public partial class T_Form_EntityAttribute
- {
- private readonly YTSoft.BaseCallCenter.DAL.T_Form_EntityAttribute dal = new YTSoft.BaseCallCenter.DAL.T_Form_EntityAttribute();
- public T_Form_EntityAttribute()
- { }
- #region Method
- /// <summary>
- /// 是否存在该记录
- /// </summary>
- public bool Exists(int F_AttributeId)
- {
- return dal.Exists(F_AttributeId);
- }
- /// <summary>
- /// 增加一条数据
- /// </summary>
- public int Add(YTSoft.BaseCallCenter.Model.T_Form_EntityAttribute model)
- {
- return dal.Add(model);
- }
- /// <summary>
- /// 更新一条数据
- /// </summary>
- public bool Update(YTSoft.BaseCallCenter.Model.T_Form_EntityAttribute model)
- {
- return dal.Update(model);
- }
- /// <summary>
- /// 删除一条数据
- /// </summary>
- public bool Delete(int F_AttributeId)
- {
- return dal.Delete(F_AttributeId);
- }
- /// <summary>
- /// 删除一条数据
- /// </summary>
- public bool DeleteList(string F_AttributeIdlist)
- {
- return dal.DeleteList(F_AttributeIdlist);
- }
- /// <summary>
- /// 得到一个对象实体
- /// </summary>
- public YTSoft.BaseCallCenter.Model.T_Form_EntityAttribute GetModel(int F_AttributeId)
- {
- return dal.GetModel(F_AttributeId);
- }
- /// <summary>
- /// 获得数据列表
- /// </summary>
- public DataSet GetList(string strWhere)
- {
- return dal.GetList(strWhere);
- }
- /// <summary>
- /// 获得前几行数据
- /// </summary>
- public DataSet GetList(int Top, string strWhere, string filedOrder)
- {
- return dal.GetList(Top, strWhere, filedOrder);
- }
- /// <summary>
- /// 获得数据列表
- /// </summary>
- public List<YTSoft.BaseCallCenter.Model.T_Form_EntityAttribute> GetModelList(string strWhere)
- {
- DataSet ds = dal.GetList(strWhere);
- return DataTableToList(ds.Tables[0]);
- }
- /// <summary>
- /// 获得数据列表
- /// </summary>
- public List<YTSoft.BaseCallCenter.Model.T_Form_EntityAttribute> DataTableToList(DataTable dt)
- {
- List<YTSoft.BaseCallCenter.Model.T_Form_EntityAttribute> modelList = new List<YTSoft.BaseCallCenter.Model.T_Form_EntityAttribute>();
- int rowsCount = dt.Rows.Count;
- if (rowsCount > 0)
- {
- YTSoft.BaseCallCenter.Model.T_Form_EntityAttribute model;
- for (int n = 0; n < rowsCount; n++)
- {
- model = new YTSoft.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;
- }
- /// <summary>
- /// 获得数据列表
- /// </summary>
- public DataSet GetAllList()
- {
- return GetList("");
- }
- /// <summary>
- /// 分页获取数据列表
- /// </summary>
- public int GetRecordCount(string strWhere)
- {
- return dal.GetRecordCount(strWhere);
- }
- /// <summary>
- /// 分页获取数据列表
- /// </summary>
- public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
- {
- return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
- }
- /// <summary>
- /// 分页获取数据列表
- /// </summary>
- //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
- //{
- //return dal.GetList(PageSize,PageIndex,strWhere);
- //}
- #endregion Method
- /// <summary>
- /// 增加一条数据
- /// </summary>
- public int AddTran(Model.T_Form_EntityAttribute model)
- {
- return dal.AddTran(model);
- }
- }
- }
|