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); } }
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); } }
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); } }