public TblNews getNews(int givenID) { TblNews _objCourse = (TblNews)NHSession.CreateCriteria(typeof(TblNews)) .Add(Restrictions.Eq(Constants.allModelProperties.NewsId, givenID)) .UniqueResult(); return(_objCourse); }
public bool DeleteNews(TblNews news) { bool result = false; using (ITransaction T = NHSession.BeginTransaction()) { try { NHSession.Delete(news); T.Commit(); result = true; } catch (Exception ex) { T.Rollback(); } } return(result); }