public void Reload() { using (ISession session = UserContext.SessionFactory.OpenSession()) { using (ITransaction tx = session.BeginTransaction()) { try { using (AppliactionContext.Log.LogTime(this, String.Format("Reload paper type '{0} {1}'.", Type, Color.ToString()))) { DbPaperType reloadedpaperType = session.Load <DbPaperType>(_dbPapertype.Id); _dbPapertype.Color = reloadedpaperType.Color; _dbPapertype.Type = reloadedpaperType.Type; tx.Commit(); } } catch (Exception ex) { AppliactionContext.Log.Critical(this, ex.Message); tx.Rollback(); throw ex; } } } }
public PaperType(DbPaperType dbPaperType) { _dbPapertype = dbPaperType; }