コード例 #1
0
        public Admin getAdminByAccount(User a)
        {
            Admin adminNou = new Admin();

            try
            {
                helper.OpenConnection();
                adminNou = helper.Session.QueryOver <Admin>().Where(x => x.Username == a.Username && x.Password == encrypt(a.Password)).SingleOrDefault();
                helper.Commit();
            }
            catch (Exception ex)
            {
                System.Windows.MessageBox.Show(ex.ToString());
            }
            finally
            {
                helper.CloseConnection();
            }

            return(adminNou);
        }
コード例 #2
0
        public List <Spectacol> getSpectacole()
        {
            List <Spectacol> ls = new List <Spectacol>();

            try
            {
                helper.OpenConnection();
                ls = helper.Session.Query <Spectacol>().OrderBy(x => x.Titlu).ToList();
                helper.Commit();
            }
            catch (Exception ex)
            {
                System.Windows.MessageBox.Show(ex.ToString());
            }
            finally
            {
                helper.CloseConnection();
            }

            return(ls);
        }