public void Grabar(TipoMoneda instance) { new TipoMonedaDA().SaveOrUpdate(instance); }
public void SaveOrUpdate(TipoMoneda instance) { ISession hisession = null; try { hisession = NHibernateHelper.GetCurrentSession(); hisession.BeginTransaction(); if (instance.Id == 0) { hisession.Save(instance); } else { hisession.Update(instance); } hisession.Transaction.Commit(); hisession.Close(); } catch (Exception ex) { if (hisession != null) { if (hisession.IsOpen) { hisession.Close(); } } } }