Пример #1
0
        public TblTeacher getTeacher(int givenID)
        {
            TblTeacher _objTeacher = (TblTeacher)NHSession.CreateCriteria(typeof(TblTeacher))
                                     .Add(Restrictions.Eq(Constants.allModelProperties.TeacherId, givenID))
                                     .UniqueResult();

            return(_objTeacher);
        }
Пример #2
0
        public bool DeleteTeacher(TblTeacher teacher)
        {
            bool result = false;

            using (ITransaction T = NHSession.BeginTransaction())
            {
                try
                {
                    NHSession.Delete(teacher);
                    T.Commit();
                    result = true;
                }
                catch (Exception ex)
                {
                    T.Rollback();
                }
            }
            return(result);
        }