Пример #1
0
        public PreviewPictures SavePicture(int articleId, string smSizepath, string laSizePath, string alt)
        {
            try
            {
                PreviewPictures entity = new PreviewPictures();

                picRepos.Add(entity);

                entity.IsActive      = true;
                entity.LargeSizePath = laSizePath;
                entity.SmallSizePath = smSizepath;
                entity.ArticleId     = articleId;
                entity.Alt           = alt;
                entity.Alias         = alt.ToAlias();

                unitOfWork.Save();

                return(entity);
            }
            catch (Exception ex)
            {
                ExceptionService.WriteException(ex, section, SysConstants.AppException_CityNews);
                throw new Exception(ex.Message);
            }
        }
Пример #2
0
 public void RemovePicture(int pictureId)
 {
     try
     {
         PreviewPictures entry = picRepos.Get(pictureId);
         picRepos.Delete(entry);
     }
     catch (Exception ex)
     {
         ExceptionService.WriteException(ex, section, SysConstants.AppException_CityNews);
         throw new Exception(ex.Message);
     }
 }
Пример #3
0
 public PreviewPictures GetPicture(int Id)
 {
     try
     {
         PreviewPictures picture = picRepos.Get(Id);
         return(picture);
     }
     catch (Exception ex)
     {
         ExceptionService.WriteException(ex, section, SysConstants.AppException_CityNews);
         throw new Exception(ex.Message);
     }
 }