Exemple #1
0
 /// <summary>
 /// 保存实体数据(新增、修改)
 /// </summary>
 /// <param name="entity">实体</param>
 public void SaveEntity(LogoImgEntity entity)
 {
     try
     {
         LogoImgEntity entityTmp = this.BaseRepository().FindEntity <LogoImgEntity>(entity.F_Code);
         if (entityTmp != null)
         {
             entity.Modify(entity.F_Code);
             this.BaseRepository().Update(entity);
         }
         else
         {
             entity.Create();
             this.BaseRepository().Insert(entity);
         }
     }
     catch (Exception ex)
     {
         if (ex is ExceptionEx)
         {
             throw;
         }
         else
         {
             throw ExceptionEx.ThrowServiceException(ex);
         }
     }
 }
Exemple #2
0
        /// <summary>
        /// 获取logo图片
        /// </summary>
        /// <param name="code">编码</param>
        public void GetImg(string code)
        {
            LogoImgEntity entity      = GetEntity(code);
            string        fileImg     = "";
            string        fileHeadImg = Config.GetValue("fileLogoImg");

            if (entity != null)
            {
                fileImg = string.Format("{0}/{1}{2}", fileHeadImg, entity.F_Code, entity.F_FileName);
            }
            else
            {
                fileImg = string.Format("{0}/{1}.png", fileHeadImg, code);
            }
            FileDownHelper.DownLoadnew(fileImg);
        }
Exemple #3
0
        /// <summary>
        /// 保存实体数据(新增、修改)
        /// </summary>
        /// <param name="entity">实体</param>

        public void SaveEntity(LogoImgEntity entity)
        {
            try
            {
                logoImgService.SaveEntity(entity);
            }
            catch (Exception ex)
            {
                if (ex is ExceptionEx)
                {
                    throw;
                }
                else
                {
                    throw ExceptionEx.ThrowBusinessException(ex);
                }
            }
        }