public TblStudent getStudent(int givenID) { TblStudent objStudent = (TblStudent)NHSession.CreateCriteria(typeof(TblStudent)) .Add(Restrictions.Eq(Constants.allModelProperties.StudentId, givenID)) .UniqueResult(); return(objStudent); }
public bool DeleteStudent(TblStudent student) { bool result = false; using (ITransaction T = NHSession.BeginTransaction()) { try { NHSession.Delete(student); T.Commit(); result = true; } catch (Exception ex) { T.Rollback(); } } return(result); }