Exemple #1
0
        public IList <DisciplinesNHibernate> GetOneDiscipline(string facappid, string facidnum, string discipline)
        {
            var nHibernateSession = new NHibernateFactory().GetSessionFactory().OpenSession();
            IList <DisciplinesNHibernate> DisciplineList = new List <DisciplinesNHibernate>();

            try
            {
                //DisciplineList = nHibernateSession.Query<DisciplinesNHibernate>()
                //    .Where(x => x.PortletID == portletId && x.UserID == userId)
                //    .OrderBy(x => x.Name).ToList();

                DisciplineList = nHibernateSession.Query <DisciplinesNHibernate>()
                                 .Where(x => x.FAC_APPID == facappid && x.FAC_ID_NUM == facidnum && x.SCHOOL_CDE == discipline)
                                 .OrderBy(x => x.INSTIT_DIV_CDE).ToList();
            }
            catch (Exception e)
            {
                ExceptionManager.Publish(e);
            }
            finally
            {
                nHibernateSession.Close();
            }

            return(DisciplineList);
        }
Exemple #2
0
        public void RemoveUserAccess(string userId, string firstName, string lastName, string schoolcde)
        {
            var nHibernateSession = new NHibernateFactory().GetSessionFactory().OpenSession();
            IList <UserAccessNHibernate> UserAccessList = new List <UserAccessNHibernate>();

            try
            {
                UserAccessList = nHibernateSession.Query <UserAccessNHibernate>()
                                 .Where(x => x.USER_ID == userId && x.FIRST_NAME == firstName && x.LAST_NAME == lastName && x.SCHOOL_CDE == schoolcde).ToList();

                using (var transaction = nHibernateSession.BeginTransaction())
                {
                    foreach (UserAccessNHibernate dspln in UserAccessList)
                    {
                        nHibernateSession.Delete(dspln);
                    }
                    transaction.Commit();
                }
            }
            catch (Exception e)
            {
                ExceptionManager.Publish(e);
            }
            finally
            {
                nHibernateSession.Close();
            }
        }
Exemple #3
0
        public IList <DisciplinesNHibernate> GetAllDisciplines()
        {
            var nHibernateSession = new NHibernateFactory().GetSessionFactory().OpenSession();
            IList <DisciplinesNHibernate> DisciplineList = new List <DisciplinesNHibernate>();

            try
            {
                //DisciplineList = nHibernateSession.Query<DisciplinesNHibernate>()
                //    .Where(x => x.PortletID == portletId && x.UserID == userId)
                //    .OrderBy(x => x.Name).ToList();

                DisciplineList = nHibernateSession.Query <DisciplinesNHibernate>()
                                 .OrderBy(x => x.SCHOOL_CDE).ToList();
            }
            catch (Exception e)
            {
                ExceptionManager.Publish(e);
            }
            finally
            {
                nHibernateSession.Close();
            }

            return(DisciplineList);
        }
Exemple #4
0
        public void RemoveDiscipline(string facappid, string facidnum, string discipline)
        {
            var nHibernateSession = new NHibernateFactory().GetSessionFactory().OpenSession();
            IList <DisciplinesNHibernate> DisciplineList = new List <DisciplinesNHibernate>();

            try
            {
                DisciplineList = nHibernateSession.Query <DisciplinesNHibernate>()
                                 .Where(x => x.FAC_APPID == facappid && x.FAC_ID_NUM == facidnum && x.SCHOOL_CDE == discipline).ToList();

                using (var transaction = nHibernateSession.BeginTransaction())
                {
                    foreach (DisciplinesNHibernate dspln in DisciplineList)
                    {
                        nHibernateSession.Delete(dspln);
                    }
                    transaction.Commit();
                }
            }
            catch (Exception e)
            {
                ExceptionManager.Publish(e);
            }
            finally
            {
                nHibernateSession.Close();
            }
        }
        public int UpdateNote(Guid id)
        {
            NotesArchiveNHibernate Note = GetNote(id);
            int status = 1;

            if (Note == null)
            {
                return(0);
            }

            //Note.Name = name;
            //Note.Description = description;

            var nHibernateSession = new NHibernateFactory().GetSessionFactory().OpenSession();

            try
            {
                using (var transaction = nHibernateSession.BeginTransaction())
                {
                    nHibernateSession.SaveOrUpdate(Note);
                    transaction.Commit();
                }
            }
            catch (Exception e)
            {
                ExceptionManager.Publish(e);
                status = 0;
            }
            finally
            {
                nHibernateSession.Close();
            }

            return(status);
        }
Exemple #6
0
        public void DeleteDiscipline(Guid ID)
        {
            DisciplinesNHibernate disc = GetDiscipline(ID);

            if (disc == null)
            {
                return;
            }
            var nHibernateSession = new NHibernateFactory().GetSessionFactory().OpenSession();

            try
            {
                using (var transaction = nHibernateSession.BeginTransaction())
                {
                    nHibernateSession.Delete(disc);
                    transaction.Commit();
                }
            }
            catch (Exception e)
            {
                ExceptionManager.Publish(e);
            }
            finally
            {
                nHibernateSession.Close();
            }
        }
        public void DeleteNote(Guid NOTE_ID)
        {
            NotesArchiveNHibernate Note = GetNote(NOTE_ID);

            if (Note == null)
            {
                return;
            }
            var nHibernateSession = new NHibernateFactory().GetSessionFactory().OpenSession();

            try
            {
                using (var transaction = nHibernateSession.BeginTransaction())
                {
                    nHibernateSession.Delete(Note);
                    transaction.Commit();
                }
            }
            catch (Exception e)
            {
                ExceptionManager.Publish(e);
            }
            finally
            {
                nHibernateSession.Close();
            }
        }
        public IList <NotesArchiveNHibernate> GetFacultyYTDDFNotes(string FACidnum, string termcode, string yearcode, string schoolcde, string instdiv)
        {
            var nHibernateSession = new NHibernateFactory().GetSessionFactory().OpenSession();
            IList <NotesArchiveNHibernate> noteList = new List <NotesArchiveNHibernate>();

            try
            {
                noteList = nHibernateSession.Query <NotesArchiveNHibernate>()
                           .Where(x => x.FAC_ID_NUM == FACidnum && (x.TERMCODE == termcode || x.TERMCODE == "") &&
                                  (x.YEARCODE == yearcode || x.YEARCODE == "") &&
                                  (x.SCHOOL_CDE == schoolcde || x.SCHOOL_CDE == "") &&
                                  (x.INSTIT_DIV_CDE == instdiv || x.INSTIT_DIV_CDE == ""))
                           .OrderByDescending(x => x.UPDATE_DATE).ToList();
            }
            catch (Exception e)
            {
                ExceptionManager.Publish(e);
            }
            finally
            {
                nHibernateSession.Close();
            }

            return(noteList);
        }
        public IList <NotesArchiveNHibernate> GetFacultyNotes(string FAC_NUM_ID)
        {
            var nHibernateSession = new NHibernateFactory().GetSessionFactory().OpenSession();
            IList <NotesArchiveNHibernate> NoteList = new List <NotesArchiveNHibernate>();

            try
            {
                //NoteList = nHibernateSession.Query<NotesArchiveNHibernate>()
                //    .Where(x => x.PortletID == portletId && x.UserID == userId)
                //    .OrderBy(x => x.Name).ToList();

                NoteList = nHibernateSession.Query <NotesArchiveNHibernate>()
                           .Where(x => x.FAC_ID_NUM == FAC_NUM_ID && x.NOTE_LEVEL == "FACULTY")
                           .OrderBy(x => x.NOTE_TYPE).ToList();
            }
            catch (Exception e)
            {
                ExceptionManager.Publish(e);
            }
            finally
            {
                nHibernateSession.Close();
            }

            return(NoteList);
        }
        public IList <NotesArchiveNHibernate> GetAllNotes()
        {
            var nHibernateSession = new NHibernateFactory().GetSessionFactory().OpenSession();
            IList <NotesArchiveNHibernate> NoteList = new List <NotesArchiveNHibernate>();

            try
            {
                //NoteList = nHibernateSession.Query<NotesArchiveNHibernate>()
                //    .Where(x => x.PortletID == portletId && x.UserID == userId)
                //    .OrderBy(x => x.Name).ToList();

                NoteList = nHibernateSession.Query <NotesArchiveNHibernate>()
                           .OrderBy(x => x.CREATE_DATE).ToList().OrderBy(x => x.NOTE_TYPE).ToList();
            }
            catch (Exception e)
            {
                ExceptionManager.Publish(e);
            }
            finally
            {
                nHibernateSession.Close();
            }

            return(NoteList);
        }
Exemple #11
0
        public DisciplinesNHibernate GetDiscipline(Guid ID)
        {
            var nHibernateSession            = new NHibernateFactory().GetSessionFactory().OpenSession();
            DisciplinesNHibernate Discipline = new DisciplinesNHibernate();

            try
            {
                Discipline = nHibernateSession.Query <DisciplinesNHibernate>().FirstOrDefault(x => x.ID == ID);
            }
            catch (Exception e)
            {
                ExceptionManager.Publish(e);
            }
            finally
            {
                nHibernateSession.Close();
            }
            return(Discipline);
        }
Exemple #12
0
        public UserAccessNHibernate GetUserAccessID(Guid ID)
        {
            var nHibernateSession           = new NHibernateFactory().GetSessionFactory().OpenSession();
            UserAccessNHibernate userAccess = new UserAccessNHibernate();

            try
            {
                userAccess = nHibernateSession.Query <UserAccessNHibernate>().FirstOrDefault(x => x.ID == ID);
            }
            catch (Exception e)
            {
                ExceptionManager.Publish(e);
            }
            finally
            {
                nHibernateSession.Close();
            }
            return(userAccess);
        }
        public NotesArchiveNHibernate GetNote(Guid NOTE_ID)
        {
            var nHibernateSession       = new NHibernateFactory().GetSessionFactory().OpenSession();
            NotesArchiveNHibernate Note = new NotesArchiveNHibernate();

            try
            {
                Note = nHibernateSession.Query <NotesArchiveNHibernate>().FirstOrDefault(x => x.NOTE_ID == NOTE_ID);
            }
            catch (Exception e)
            {
                ExceptionManager.Publish(e);
            }
            finally
            {
                nHibernateSession.Close();
            }
            return(Note);
        }
Exemple #14
0
        public IList <UserAccessNHibernate> GetOneUserAccess(string userId, string firstName, string lastName)
        {
            var nHibernateSession = new NHibernateFactory().GetSessionFactory().OpenSession();
            IList <UserAccessNHibernate> UserAccessList = new List <UserAccessNHibernate>();

            try
            {
                UserAccessList = nHibernateSession.Query <UserAccessNHibernate>()
                                 .Where(x => x.FIRST_NAME == firstName && x.LAST_NAME == lastName && x.USER_ID == userId).ToList();
            }
            catch (Exception e)
            {
                ExceptionManager.Publish(e);
            }
            finally
            {
                nHibernateSession.Close();
            }

            return(UserAccessList);
        }
Exemple #15
0
        public IList <UserAccessNHibernate> GetAllUserAccess()
        {
            var nHibernateSession = new NHibernateFactory().GetSessionFactory().OpenSession();
            IList <UserAccessNHibernate> UserAccessList = new List <UserAccessNHibernate>();

            try
            {
                UserAccessList = nHibernateSession.Query <UserAccessNHibernate>()
                                 .OrderBy(x => x.LAST_NAME).ToList();
            }
            catch (Exception e)
            {
                ExceptionManager.Publish(e);
            }
            finally
            {
                nHibernateSession.Close();
            }

            return(UserAccessList);
        }
        public IList <NotesArchiveNHibernate> GetFacultyYTNotes(string FACidnum, string termcode, string yearcode, string schoolcde)
        {
            var nHibernateSession = new NHibernateFactory().GetSessionFactory().OpenSession();
            IList <NotesArchiveNHibernate> noteList = new List <NotesArchiveNHibernate>();

            try
            {
                noteList = nHibernateSession.Query <NotesArchiveNHibernate>()
                           .Where(x => x.FAC_ID_NUM == FACidnum && x.TERMCODE == termcode && x.YEARCODE == yearcode && x.SCHOOL_CDE == schoolcde)
                           .OrderBy(x => x.NOTE_TYPE).ToList();
            }
            catch (Exception e)
            {
                ExceptionManager.Publish(e);
            }
            finally
            {
                nHibernateSession.Close();
            }

            return(noteList);
        }
Exemple #17
0
        public IList <DisciplinesNHibernate> GetFacultyDisciplines(string facappid, string facidnum)
        {
            var nHibernateSession = new NHibernateFactory().GetSessionFactory().OpenSession();
            IList <DisciplinesNHibernate> DisciplineList = new List <DisciplinesNHibernate>();

            try
            {
                DisciplineList = nHibernateSession.Query <DisciplinesNHibernate>()

                                 .Where(x => x.FAC_ID_NUM == facidnum)
                                 //           .Select(x => x.INSTIT_DIV_CDE).Distinct().ToList()
                                 .OrderBy(x => x.SCHOOL_CDE).Distinct().ToList();
            }
            catch (Exception e)
            {
                ExceptionManager.Publish(e);
            }
            finally
            {
                nHibernateSession.Close();
            }

            return(DisciplineList);
        }