Exemplo n.º 1
0
        //Get TimeTable Model For Delete
        public TblTimetable getTimeTable(int givenID)
        {
            TblTimetable tdObj = (TblTimetable)NHSession.CreateCriteria(typeof(TblTimetable))
                                 .Add(Restrictions.Eq(Constants.allModelProperties.TimetableId, givenID))
                                 .UniqueResult();

            return(tdObj);
        }
Exemplo n.º 2
0
        //Get TimeTable For checking Already Exist
        public TblTimetable getTimeTable(int DeptID, int courseID, int sessionID, string section)
        {
            var          dis   = Restrictions.Disjunction();
            TblTimetable tdObj = (TblTimetable)NHSession.CreateCriteria(typeof(TblTimetable))
                                 .Add(Restrictions.Eq(Constants.allModelProperties.DeptId, DeptID))
                                 .Add(Restrictions.Eq(Constants.allModelProperties.CourseId, courseID))
                                 .Add(Restrictions.Eq(Constants.allModelProperties.SessionId, sessionID))
                                 .Add(dis.Add(Restrictions.Eq(Constants.allModelProperties.ClassSection, section)))
                                 .UniqueResult();

            return(tdObj);
        }
Exemplo n.º 3
0
 public int AddTimeTable(TblTimetable Tb)
 {
     using (ITransaction T = NHSession.BeginTransaction())
     {
         try
         {
             int result = (Int32)NHSession.Save(Tb);
             T.Commit();
             return(result);
         }
         catch (Exception ex)
         {
             T.Rollback();
         }
     }
     return(-1);
 }
Exemplo n.º 4
0
        public bool deleteTimeTable(TblTimetable L)
        {
            bool result = false;

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