public static Zanimanje GetSpecific(int Id) { using (var session2 = SessionFactory.OpenSession()) { ISQLQuery query = session2.CreateSQLQuery("SELECT * FROM Zanimanje WHERE Id = " + Id.ToString()); Zanimanje p = query.SetResultTransformer(Transformers.AliasToBean <Zanimanje>()).UniqueResult <Zanimanje>(); return(p); } }
public static void Update(Zanimanje inZanimanje) { using (ISession session = SessionFactory.OpenSession()) { using (ITransaction transaction = session.BeginTransaction()) { session.Update(inZanimanje); transaction.Commit(); } } }
public static void Delete(Zanimanje forDelete) { using (ISession session = SessionFactory.OpenSession()) { using (ITransaction transaction = session.BeginTransaction()) { session.Delete(forDelete); transaction.Commit(); } } }