Beispiel #1
0
        //public TblLecturetime getTimeTable(int givenID)
        //{
        //    TblLecturetime tdObj = (TblLecturetime)NHSession.CreateCriteria(typeof(TblLecturetime))
        //                                 .Add(Restrictions.Eq(Constants.allModelProperties.LecturetimeId, givenID))
        //                                 .UniqueResult();
        //    return tdObj;
        //}
        //public bool deleteTimeTable(TblLecturetime L)
        //{
        //    bool result = false;
        //    using (ITransaction T = NHSession.BeginTransaction())
        //    {
        //        try
        //        {
        //            NHSession.Delete(L);
        //            T.Commit();
        //            result = true;
        //        }
        //        catch (Exception ex)
        //        {
        //            T.Rollback();
        //        }
        //    }
        //    return result;
        //}
        public TblMorningtime getMorningSchedule(int givenID)
        {
            TblMorningtime tdObj = (TblMorningtime)NHSession.CreateCriteria(typeof(TblMorningtime))
                                   .Add(Restrictions.Eq(Constants.allModelProperties.MorningtimeId, givenID))
                                   .UniqueResult();

            return(tdObj);
        }
Beispiel #2
0
        public bool deleteMorningSchedule(TblMorningtime mt)
        {
            bool result = false;

            using (ITransaction T = NHSession.BeginTransaction())
            {
                try
                {
                    NHSession.Delete(mt);
                    T.Commit();
                    result = true;
                }
                catch (Exception ex)
                {
                    T.Rollback();
                }
            }
            return(result);
        }
Beispiel #3
0
        public bool AddTimeTableMorning(TblMorningtime Tbm)
        {
            bool result = false;

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