public TblSession getSession(int id) { TblSession obj = (TblSession)NHSession.CreateCriteria(typeof(TblSession)) .Add(Restrictions.Eq(Constants.allModelProperties.SessionId, id)) .UniqueResult(); return(obj); }
public bool DeleteSession(TblSession session) { bool result = false; using (ITransaction T = NHSession.BeginTransaction()) { try { NHSession.Delete(session); T.Commit(); result = true; } catch (Exception ex) { T.Rollback(); } } return(result); }