using Learun.Util; using System; using System.Collections.Generic; namespace Learun.Application.Base.SystemModule { /// /// 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架 /// Copyright (c) 2013-2018 上海力软信息技术有限公司 /// 创 建:超级管理员 /// 日 期:2019-01-02 12:03 /// 描 述:图片保存 /// public class ImgBLL: ImgIBLL { private ImgService imgService = new ImgService(); #region 获取数据 /// /// 获取页面显示列表数据 /// /// 分页参数 /// 查询参数 /// public IEnumerable GetPageList(Pagination pagination, string queryJson) { try { return imgService.GetPageList(pagination, queryJson); } catch (Exception ex) { if (ex is ExceptionEx) { throw; } else { throw ExceptionEx.ThrowBusinessException(ex); } } } /// /// 获取LR_Base_Img表实体数据 /// /// 主键 /// public ImgEntity GetEntity(string keyValue) { try { return imgService.GetEntity(keyValue); } catch (Exception ex) { if (ex is ExceptionEx) { throw; } else { throw ExceptionEx.ThrowServiceException(ex); } } } #endregion #region 提交数据 /// /// 删除实体数据 /// /// 主键 public void DeleteEntity(string keyValue) { try { imgService.DeleteEntity(keyValue); } catch (Exception ex) { if (ex is ExceptionEx) { throw; } else { throw ExceptionEx.ThrowBusinessException(ex); } } } /// /// 保存实体数据(新增、修改) /// /// 主键 /// 实体 public void SaveEntity(string keyValue, ImgEntity entity) { try { imgService.SaveEntity(keyValue, entity); } catch (Exception ex) { if (ex is ExceptionEx) { throw; } else { throw ExceptionEx.ThrowBusinessException(ex); } } } #endregion /// /// 获取图片 /// /// 主键 public void GetImg(string keyValue) { ImgEntity imgEntity = GetEntity(keyValue); if (imgEntity != null && !string.IsNullOrEmpty(imgEntity.F_Content)) { FileDownHelper.DownLoadBase64(imgEntity.F_Content.Replace("data:image/png;base64,", ""), imgEntity.F_Name); } } } }