DataItemBLL.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. using Lottomat.Application.Entity.SystemManage;
  2. using Lottomat.Application.IService.SystemManage;
  3. using Lottomat.Application.Service.SystemManage;
  4. using System;
  5. using System.Collections.Generic;
  6. namespace Lottomat.Application.Busines.SystemManage
  7. {
  8. /// <summary>
  9. /// 版 本 1.0
  10. /// Copyright (c) 2016-2017
  11. /// 创建人:赵轶
  12. /// 日 期:2015.11.17 9:56
  13. /// 描 述:数据字典分类
  14. /// </summary>
  15. public class DataItemBLL
  16. {
  17. private IDataItemService service = new DataItemService();
  18. #region 获取数据
  19. /// <summary>
  20. /// 分类列表
  21. /// </summary>
  22. /// <returns></returns>
  23. public IEnumerable<DataItemEntity> GetList()
  24. {
  25. return service.GetList();
  26. }
  27. /// <summary>
  28. /// 分类实体
  29. /// </summary>
  30. /// <param name="keyValue">主键值</param>
  31. /// <returns></returns>
  32. public DataItemEntity GetEntity(string keyValue)
  33. {
  34. return service.GetEntity(keyValue);
  35. }
  36. /// <summary>
  37. /// 根据分类编号获取实体对象
  38. /// </summary>
  39. /// <param name="ItemCode">编号</param>
  40. /// <returns></returns>
  41. public DataItemEntity GetEntityByCode(string ItemCode)
  42. {
  43. DataItemEntity old = service.GetEntityByCode(ItemCode);
  44. return old;
  45. }
  46. #endregion
  47. #region 验证数据
  48. /// <summary>
  49. /// 分类编号不能重复
  50. /// </summary>
  51. /// <param name="itemCode">编号</param>
  52. /// <param name="keyValue">主键</param>
  53. /// <returns></returns>
  54. public bool ExistItemCode(string itemCode, string keyValue)
  55. {
  56. return service.ExistItemCode(itemCode, keyValue);
  57. }
  58. /// <summary>
  59. /// 分类名称不能重复
  60. /// </summary>
  61. /// <param name="itemName">名称</param>
  62. /// <param name="keyValue">主键</param>
  63. /// <returns></returns>
  64. public bool ExistItemName(string itemName, string keyValue)
  65. {
  66. return service.ExistItemName(itemName, keyValue);
  67. }
  68. #endregion
  69. #region 提交数据
  70. /// <summary>
  71. /// 删除分类
  72. /// </summary>
  73. /// <param name="keyValue">主键</param>
  74. public void RemoveForm(string keyValue)
  75. {
  76. try
  77. {
  78. service.RemoveForm(keyValue);
  79. }
  80. catch (Exception)
  81. {
  82. throw;
  83. }
  84. }
  85. /// <summary>
  86. /// 保存分类表单(新增、修改)
  87. /// </summary>
  88. /// <param name="keyValue">主键值</param>
  89. /// <param name="dataItemEntity">分类实体</param>
  90. /// <returns></returns>
  91. public void SaveForm(string keyValue, DataItemEntity dataItemEntity)
  92. {
  93. try
  94. {
  95. service.SaveForm(keyValue, dataItemEntity);
  96. }
  97. catch (Exception)
  98. {
  99. throw;
  100. }
  101. }
  102. public DataItemEntity GetByItemName(string ItemName)
  103. {
  104. try
  105. {
  106. return service.GetByItemName(ItemName);
  107. }
  108. catch (Exception)
  109. {
  110. throw;
  111. }
  112. }
  113. #endregion
  114. }
  115. }