You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

140 lines
3.6 KiB

  1. using Learun.Util;
  2. using System;
  3. using System.Collections.Generic;
  4. namespace Learun.Application.Base.SystemModule
  5. {
  6. /// <summary>
  7. /// 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架
  8. /// Copyright (c) 2013-2018 上海力软信息技术有限公司
  9. /// 创 建:超级管理员
  10. /// 日 期:2019-01-02 12:03
  11. /// 描 述:图片保存
  12. /// </summary>
  13. public class ImgBLL: ImgIBLL
  14. {
  15. private ImgService imgService = new ImgService();
  16. #region 获取数据
  17. /// <summary>
  18. /// 获取页面显示列表数据
  19. /// </summary>
  20. /// <param name="pagination">分页参数</param>
  21. /// <param name="queryJson">查询参数</param>
  22. /// <returns></returns>
  23. public IEnumerable<ImgEntity> GetPageList(Pagination pagination, string queryJson)
  24. {
  25. try
  26. {
  27. return imgService.GetPageList(pagination, queryJson);
  28. }
  29. catch (Exception ex)
  30. {
  31. if (ex is ExceptionEx)
  32. {
  33. throw;
  34. }
  35. else
  36. {
  37. throw ExceptionEx.ThrowBusinessException(ex);
  38. }
  39. }
  40. }
  41. /// <summary>
  42. /// 获取LR_Base_Img表实体数据
  43. /// </summary>
  44. /// <param name="keyValue">主键</param>
  45. /// <returns></returns>
  46. public ImgEntity GetEntity(string keyValue)
  47. {
  48. try
  49. {
  50. return imgService.GetEntity(keyValue);
  51. }
  52. catch (Exception ex)
  53. {
  54. if (ex is ExceptionEx)
  55. {
  56. throw;
  57. }
  58. else
  59. {
  60. throw ExceptionEx.ThrowServiceException(ex);
  61. }
  62. }
  63. }
  64. #endregion
  65. #region 提交数据
  66. /// <summary>
  67. /// 删除实体数据
  68. /// </summary>
  69. /// <param name="keyValue">主键</param>
  70. public void DeleteEntity(string keyValue)
  71. {
  72. try
  73. {
  74. imgService.DeleteEntity(keyValue);
  75. }
  76. catch (Exception ex)
  77. {
  78. if (ex is ExceptionEx)
  79. {
  80. throw;
  81. }
  82. else
  83. {
  84. throw ExceptionEx.ThrowBusinessException(ex);
  85. }
  86. }
  87. }
  88. /// <summary>
  89. /// 保存实体数据(新增、修改)
  90. /// </summary>
  91. /// <param name="keyValue">主键</param>
  92. /// <param name="entity">实体</param>
  93. public void SaveEntity(string keyValue, ImgEntity entity)
  94. {
  95. try
  96. {
  97. imgService.SaveEntity(keyValue, entity);
  98. }
  99. catch (Exception ex)
  100. {
  101. if (ex is ExceptionEx)
  102. {
  103. throw;
  104. }
  105. else
  106. {
  107. throw ExceptionEx.ThrowBusinessException(ex);
  108. }
  109. }
  110. }
  111. #endregion
  112. /// <summary>
  113. /// 获取图片
  114. /// </summary>
  115. /// <param name="keyValue">主键</param>
  116. public void GetImg(string keyValue)
  117. {
  118. ImgEntity imgEntity = GetEntity(keyValue);
  119. if (imgEntity != null && !string.IsNullOrEmpty(imgEntity.F_Content))
  120. {
  121. FileDownHelper.DownLoadBase64(imgEntity.F_Content.Replace("data:image/png;base64,", ""), imgEntity.F_Name);
  122. }
  123. }
  124. }
  125. }