private User GetLoggedUser() { UserSession userSession = SessionProvider.GetInstance().GetSession <UserSession>(UserSession.SESSION_NAME); if (userSession == null) { return(null); } return(_genericDao.Find <User>(userSession.UserAuthenticationDto.Id)); }
private static void SetDefaultCollectionToPaintingsInRemovedCollection(IUnitOfWork unitOfWork, Guid collectionId) { GenericDao genericDao = new GenericDao(unitOfWork); PaintingCRUDService paintingCRUDService = new PaintingCRUDService(unitOfWork); IList <Painting> paintingsToUpdate = genericDao.Find <Painting>(x => x.CollectionId == collectionId); foreach (Painting paintingToUpdate in paintingsToUpdate) { paintingToUpdate.CollectionId = GuidConstants.DEFAULT_COLLECTION_ID; } genericDao.Persist <Painting>(paintingsToUpdate); }
public void Generate(IUnitOfWork unitOfWork, ExhibitionGenerateDto generateDto) { _genericDao = new GenericDao(unitOfWork); _galleryDao = new GalleryDao(unitOfWork); Exhibition exhibition = _genericDao.Find <Exhibition>(generateDto.ExhibitionId); //object missing = System.Reflection.Missing.Value; try { Document document = new Document(); GenerateExhibition(document, exhibition); document.SaveAs2(@"d:\aaa.docx"); document.Close(); document = null; } catch (Exception ex) { } }
public T Read(Guid id) { return(CreateDto(_genericDao.Find <U>(id))); }