Пример #1
0
 public ICollection<Account> GetAllAccount(Account acc)
 {
     ICollection<Account> iCol = null;
     try
     {
         using (NHibernate.ISession session = SessionFactory.GetNewSession())
         {
             iCol= session.CreateCriteria(typeof(Account)).List<Account>();
         }
     }
     catch (Exception ex)
     {
         GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
     }
     return iCol;
 }
Пример #2
0
 public void Delete(Account acc)
 {
     try
     {
         using (NHibernate.ISession session = SessionFactory.GetNewSession())
         {
             using (NHibernate.ITransaction transaction = session.BeginTransaction())
             {
                 session.Delete(acc.UserName);
                 transaction.Commit();
             }
         }
     }
     catch (Exception ex)
     {
         GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
     }
 }