地铁二期项目正式开始

T_Form_EntityAttribute.cs 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Data;
  6. namespace YTSoft.BaseCallCenter.BLL
  7. {
  8. /// <summary>
  9. /// T_Form_EntityAttribute
  10. /// </summary>
  11. public partial class T_Form_EntityAttribute
  12. {
  13. private readonly YTSoft.BaseCallCenter.DAL.T_Form_EntityAttribute dal = new YTSoft.BaseCallCenter.DAL.T_Form_EntityAttribute();
  14. public T_Form_EntityAttribute()
  15. { }
  16. #region Method
  17. /// <summary>
  18. /// 是否存在该记录
  19. /// </summary>
  20. public bool Exists(int F_AttributeId)
  21. {
  22. return dal.Exists(F_AttributeId);
  23. }
  24. /// <summary>
  25. /// 增加一条数据
  26. /// </summary>
  27. public int Add(YTSoft.BaseCallCenter.Model.T_Form_EntityAttribute model)
  28. {
  29. return dal.Add(model);
  30. }
  31. /// <summary>
  32. /// 更新一条数据
  33. /// </summary>
  34. public bool Update(YTSoft.BaseCallCenter.Model.T_Form_EntityAttribute model)
  35. {
  36. return dal.Update(model);
  37. }
  38. /// <summary>
  39. /// 删除一条数据
  40. /// </summary>
  41. public bool Delete(int F_AttributeId)
  42. {
  43. return dal.Delete(F_AttributeId);
  44. }
  45. /// <summary>
  46. /// 删除一条数据
  47. /// </summary>
  48. public bool DeleteList(string F_AttributeIdlist)
  49. {
  50. return dal.DeleteList(F_AttributeIdlist);
  51. }
  52. /// <summary>
  53. /// 得到一个对象实体
  54. /// </summary>
  55. public YTSoft.BaseCallCenter.Model.T_Form_EntityAttribute GetModel(int F_AttributeId)
  56. {
  57. return dal.GetModel(F_AttributeId);
  58. }
  59. /// <summary>
  60. /// 获得数据列表
  61. /// </summary>
  62. public DataSet GetList(string strWhere)
  63. {
  64. return dal.GetList(strWhere);
  65. }
  66. /// <summary>
  67. /// 获得前几行数据
  68. /// </summary>
  69. public DataSet GetList(int Top, string strWhere, string filedOrder)
  70. {
  71. return dal.GetList(Top, strWhere, filedOrder);
  72. }
  73. /// <summary>
  74. /// 获得数据列表
  75. /// </summary>
  76. public List<YTSoft.BaseCallCenter.Model.T_Form_EntityAttribute> GetModelList(string strWhere)
  77. {
  78. DataSet ds = dal.GetList(strWhere);
  79. return DataTableToList(ds.Tables[0]);
  80. }
  81. /// <summary>
  82. /// 获得数据列表
  83. /// </summary>
  84. public List<YTSoft.BaseCallCenter.Model.T_Form_EntityAttribute> DataTableToList(DataTable dt)
  85. {
  86. List<YTSoft.BaseCallCenter.Model.T_Form_EntityAttribute> modelList = new List<YTSoft.BaseCallCenter.Model.T_Form_EntityAttribute>();
  87. int rowsCount = dt.Rows.Count;
  88. if (rowsCount > 0)
  89. {
  90. YTSoft.BaseCallCenter.Model.T_Form_EntityAttribute model;
  91. for (int n = 0; n < rowsCount; n++)
  92. {
  93. model = new YTSoft.BaseCallCenter.Model.T_Form_EntityAttribute();
  94. if (dt.Rows[n]["F_AttributeId"] != null && dt.Rows[n]["F_AttributeId"].ToString() != "")
  95. {
  96. model.F_AttributeId = int.Parse(dt.Rows[n]["F_AttributeId"].ToString());
  97. }
  98. if (dt.Rows[n]["F_TypeId"] != null && dt.Rows[n]["F_TypeId"].ToString() != "")
  99. {
  100. model.F_TypeId = int.Parse(dt.Rows[n]["F_TypeId"].ToString());
  101. }
  102. if (dt.Rows[n]["F_DBTypeName"] != null && dt.Rows[n]["F_DBTypeName"].ToString() != "")
  103. {
  104. model.F_DBTypeName = dt.Rows[n]["F_DBTypeName"].ToString();
  105. }
  106. if (dt.Rows[n]["F_Name"] != null && dt.Rows[n]["F_Name"].ToString() != "")
  107. {
  108. model.F_Name = dt.Rows[n]["F_Name"].ToString();
  109. }
  110. if (dt.Rows[n]["F_DBFieldlName"] != null && dt.Rows[n]["F_DBFieldlName"].ToString() != "")
  111. {
  112. model.F_DBFieldlName = dt.Rows[n]["F_DBFieldlName"].ToString();
  113. }
  114. if (dt.Rows[n]["F_Length"] != null && dt.Rows[n]["F_Length"].ToString() != "")
  115. {
  116. model.F_Length = int.Parse(dt.Rows[n]["F_Length"].ToString());
  117. }
  118. if (dt.Rows[n]["F_IsNullable"] != null && dt.Rows[n]["F_IsNullable"].ToString() != "")
  119. {
  120. if ((dt.Rows[n]["F_IsNullable"].ToString() == "1") || (dt.Rows[n]["F_IsNullable"].ToString().ToLower() == "true"))
  121. {
  122. model.F_IsNullable = true;
  123. }
  124. else
  125. {
  126. model.F_IsNullable = false;
  127. }
  128. }
  129. if (dt.Rows[n]["F_EntityId"] != null && dt.Rows[n]["F_EntityId"].ToString() != "")
  130. {
  131. model.F_EntityId = int.Parse(dt.Rows[n]["F_EntityId"].ToString());
  132. }
  133. if (dt.Rows[n]["F_DBTableName"] != null && dt.Rows[n]["F_DBTableName"].ToString() != "")
  134. {
  135. model.F_DBTableName = dt.Rows[n]["F_DBTableName"].ToString();
  136. }
  137. if (dt.Rows[n]["F_DefaultValue"] != null && dt.Rows[n]["F_DefaultValue"].ToString() != "")
  138. {
  139. model.F_DefaultValue = dt.Rows[n]["F_DefaultValue"].ToString();
  140. }
  141. if (dt.Rows[n]["F_ColumnNumber"] != null && dt.Rows[n]["F_ColumnNumber"].ToString() != "")
  142. {
  143. model.F_ColumnNumber = int.Parse(dt.Rows[n]["F_ColumnNumber"].ToString());
  144. }
  145. if (dt.Rows[n]["F_ValidForUpdateAPI"] != null && dt.Rows[n]["F_ValidForUpdateAPI"].ToString() != "")
  146. {
  147. if ((dt.Rows[n]["F_ValidForUpdateAPI"].ToString() == "1") || (dt.Rows[n]["F_ValidForUpdateAPI"].ToString().ToLower() == "true"))
  148. {
  149. model.F_ValidForUpdateAPI = true;
  150. }
  151. else
  152. {
  153. model.F_ValidForUpdateAPI = false;
  154. }
  155. }
  156. if (dt.Rows[n]["F_ValidForReadAPI"] != null && dt.Rows[n]["F_ValidForReadAPI"].ToString() != "")
  157. {
  158. if ((dt.Rows[n]["F_ValidForReadAPI"].ToString() == "1") || (dt.Rows[n]["F_ValidForReadAPI"].ToString().ToLower() == "true"))
  159. {
  160. model.F_ValidForReadAPI = true;
  161. }
  162. else
  163. {
  164. model.F_ValidForReadAPI = false;
  165. }
  166. }
  167. if (dt.Rows[n]["F_ValidForCreateAPI"] != null && dt.Rows[n]["F_ValidForCreateAPI"].ToString() != "")
  168. {
  169. if ((dt.Rows[n]["F_ValidForCreateAPI"].ToString() == "1") || (dt.Rows[n]["F_ValidForCreateAPI"].ToString().ToLower() == "true"))
  170. {
  171. model.F_ValidForCreateAPI = true;
  172. }
  173. else
  174. {
  175. model.F_ValidForCreateAPI = false;
  176. }
  177. }
  178. if (dt.Rows[n]["F_VisibleToPlatform"] != null && dt.Rows[n]["F_VisibleToPlatform"].ToString() != "")
  179. {
  180. if ((dt.Rows[n]["F_VisibleToPlatform"].ToString() == "1") || (dt.Rows[n]["F_VisibleToPlatform"].ToString().ToLower() == "true"))
  181. {
  182. model.F_VisibleToPlatform = true;
  183. }
  184. else
  185. {
  186. model.F_VisibleToPlatform = false;
  187. }
  188. }
  189. if (dt.Rows[n]["F_IsPKAttribute"] != null && dt.Rows[n]["F_IsPKAttribute"].ToString() != "")
  190. {
  191. if ((dt.Rows[n]["F_IsPKAttribute"].ToString() == "1") || (dt.Rows[n]["F_IsPKAttribute"].ToString().ToLower() == "true"))
  192. {
  193. model.F_IsPKAttribute = true;
  194. }
  195. else
  196. {
  197. model.F_IsPKAttribute = false;
  198. }
  199. }
  200. if (dt.Rows[n]["F_IsCustomField"] != null && dt.Rows[n]["F_IsCustomField"].ToString() != "")
  201. {
  202. if ((dt.Rows[n]["F_IsCustomField"].ToString() == "1") || (dt.Rows[n]["F_IsCustomField"].ToString().ToLower() == "true"))
  203. {
  204. model.F_IsCustomField = true;
  205. }
  206. else
  207. {
  208. model.F_IsCustomField = false;
  209. }
  210. }
  211. if (dt.Rows[n]["F_DisplayMask"] != null && dt.Rows[n]["F_DisplayMask"].ToString() != "")
  212. {
  213. model.F_DisplayMask = int.Parse(dt.Rows[n]["F_DisplayMask"].ToString());
  214. }
  215. if (dt.Rows[n]["F_IsSortAttribute"] != null && dt.Rows[n]["F_IsSortAttribute"].ToString() != "")
  216. {
  217. if ((dt.Rows[n]["F_IsSortAttribute"].ToString() == "1") || (dt.Rows[n]["F_IsSortAttribute"].ToString().ToLower() == "true"))
  218. {
  219. model.F_IsSortAttribute = true;
  220. }
  221. else
  222. {
  223. model.F_IsSortAttribute = false;
  224. }
  225. }
  226. if (dt.Rows[n]["F_PrecisionValue"] != null && dt.Rows[n]["F_PrecisionValue"].ToString() != "")
  227. {
  228. model.F_PrecisionValue = int.Parse(dt.Rows[n]["F_PrecisionValue"].ToString());
  229. }
  230. if (dt.Rows[n]["F_IsIdentity"] != null && dt.Rows[n]["F_IsIdentity"].ToString() != "")
  231. {
  232. if ((dt.Rows[n]["F_IsIdentity"].ToString() == "1") || (dt.Rows[n]["F_IsIdentity"].ToString().ToLower() == "true"))
  233. {
  234. model.F_IsIdentity = true;
  235. }
  236. else
  237. {
  238. model.F_IsIdentity = false;
  239. }
  240. }
  241. if (dt.Rows[n]["F_AppDefaultValue"] != null && dt.Rows[n]["F_AppDefaultValue"].ToString() != "")
  242. {
  243. model.F_AppDefaultValue = int.Parse(dt.Rows[n]["F_AppDefaultValue"].ToString());
  244. }
  245. if (dt.Rows[n]["F_Locked"] != null && dt.Rows[n]["F_Locked"].ToString() != "")
  246. {
  247. if ((dt.Rows[n]["F_Locked"].ToString() == "1") || (dt.Rows[n]["F_Locked"].ToString().ToLower() == "true"))
  248. {
  249. model.F_Locked = true;
  250. }
  251. else
  252. {
  253. model.F_Locked = false;
  254. }
  255. }
  256. if (dt.Rows[n]["F_MaxLength"] != null && dt.Rows[n]["F_MaxLength"].ToString() != "")
  257. {
  258. model.F_MaxLength = int.Parse(dt.Rows[n]["F_MaxLength"].ToString());
  259. }
  260. if (dt.Rows[n]["F_MinValue"] != null && dt.Rows[n]["F_MinValue"].ToString() != "")
  261. {
  262. model.F_MinValue = decimal.Parse(dt.Rows[n]["F_MinValue"].ToString());
  263. }
  264. if (dt.Rows[n]["F_MaxValue"] != null && dt.Rows[n]["F_MaxValue"].ToString() != "")
  265. {
  266. model.F_MaxValue = decimal.Parse(dt.Rows[n]["F_MaxValue"].ToString());
  267. }
  268. if (dt.Rows[n]["F_LookupKey"] != null && dt.Rows[n]["F_LookupKey"].ToString() != "")
  269. {
  270. model.F_LookupKey = dt.Rows[n]["F_LookupKey"].ToString();
  271. }
  272. if (dt.Rows[n]["F_LookupStyle"] != null && dt.Rows[n]["F_LookupStyle"].ToString() != "")
  273. {
  274. model.F_LookupStyle = dt.Rows[n]["F_LookupStyle"].ToString();
  275. }
  276. if (dt.Rows[n]["F_IsLookup"] != null && dt.Rows[n]["F_IsLookup"].ToString() != "")
  277. {
  278. if ((dt.Rows[n]["F_IsLookup"].ToString() == "1") || (dt.Rows[n]["F_IsLookup"].ToString().ToLower() == "true"))
  279. {
  280. model.F_IsLookup = true;
  281. }
  282. else
  283. {
  284. model.F_IsLookup = false;
  285. }
  286. }
  287. if (dt.Rows[n]["F_Des"] != null && dt.Rows[n]["F_Des"].ToString() != "")
  288. {
  289. model.F_Des = dt.Rows[n]["F_Des"].ToString();
  290. }
  291. modelList.Add(model);
  292. }
  293. }
  294. return modelList;
  295. }
  296. /// <summary>
  297. /// 获得数据列表
  298. /// </summary>
  299. public DataSet GetAllList()
  300. {
  301. return GetList("");
  302. }
  303. /// <summary>
  304. /// 分页获取数据列表
  305. /// </summary>
  306. public int GetRecordCount(string strWhere)
  307. {
  308. return dal.GetRecordCount(strWhere);
  309. }
  310. /// <summary>
  311. /// 分页获取数据列表
  312. /// </summary>
  313. public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
  314. {
  315. return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
  316. }
  317. /// <summary>
  318. /// 分页获取数据列表
  319. /// </summary>
  320. //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
  321. //{
  322. //return dal.GetList(PageSize,PageIndex,strWhere);
  323. //}
  324. #endregion Method
  325. /// <summary>
  326. /// 增加一条数据
  327. /// </summary>
  328. public int AddTran(Model.T_Form_EntityAttribute model)
  329. {
  330. return dal.AddTran(model);
  331. }
  332. }
  333. }