Esempio n. 1
0
 internal static void SaveUsage(DomainObjecsSalg2.Sales.UserLogg ul)
 {
     using (ISession session = NHibernateHelper.OpenSession())
     {
         using (ITransaction transaction = session.BeginTransaction())
         {
             session.Save(ul);
             transaction.Commit();
         }
     }
 }
Esempio n. 2
0
 internal static void LagrePass(DomainObjecsSalg2.Settings.Settings s)
 {
     using (ISession session = NHibernateHelper.OpenSession())
     {
         using (ITransaction transaction = session.BeginTransaction())
         {
             var res = session.CreateQuery("from Settings where Type like 'Passord'").UniqueResult();
             if (res != null)
             {
                 Settings ss = (Settings)res;
                 ss.Value = s.Value;
                 session.Update(ss);
             }
             else
             {
                 session.Save(s);
             }
             transaction.Commit();
         }
     }
 }
Esempio n. 3
0
 internal static int SaveUser(DomainObjecsSalg2.Sales.Users u)
 {
     using (ISession session = NHibernateHelper.OpenSession())
     {
         using (ITransaction transaction = session.BeginTransaction())
         {
             session.Save(u);
             transaction.Commit();
             return u.Id;
         }
     }
 }