public List <Acusado> Lista()
 {
     using (ISession session = NHibernateHelperCcg2009.AbreSessao())
     {
         return(session.Query <Acusado>().OrderBy(o => o.IdAcusado).ToList());
     }
 }
 public Acusado Ler(int id)
 {
     using (ISession session = NHibernateHelperCcg2009.AbreSessao())
     {
         return(session.Get <Acusado>(id));
     }
 }
 public void Remove(Acusado obj)
 {
     using (ISession session = NHibernateHelperCcg2009.AbreSessao())
     {
         ITransaction tx = session.BeginTransaction();
         session.Delete(obj);
         tx.Commit();
     }
 }
        public int Gravar(Acusado obj)
        {
            using (ISession session = NHibernateHelperCcg2009.AbreSessao())
            {
                ITransaction tx = session.BeginTransaction();

                session.Merge(obj);

                tx.Commit();
                return(obj.IdAcusado);
            }
        }