internal static void SaveUsage(DomainObjecsSalg2.Sales.UserLogg ul) { using (ISession session = NHibernateHelper.OpenSession()) { using (ITransaction transaction = session.BeginTransaction()) { session.Save(ul); transaction.Commit(); } } }
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(); } } }
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; } } }