public ValidarEN ReadOIDDefault(int id) { ValidarEN validarEN = null; try { SessionInitializeTransaction(); validarEN = (ValidarEN)session.Get(typeof(ValidarEN), id); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is BalumaProjectGenNHibernate.Exceptions.ModelException) { throw ex; } throw new BalumaProjectGenNHibernate.Exceptions.DataLayerException("Error in ValidarCAD.", ex); } finally { SessionClose(); } return(validarEN); }
public int Crear(ValidarEN validar) { try { SessionInitializeTransaction(); if (validar.Usuario != null) { validar.Usuario = (BalumaProjectGenNHibernate.EN.BalumaProject.UsuarioEN)session.Load(typeof(BalumaProjectGenNHibernate.EN.BalumaProject.UsuarioEN), validar.Usuario.NIF); validar.Usuario.Validar = validar; } session.Save(validar); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is BalumaProjectGenNHibernate.Exceptions.ModelException) { throw ex; } throw new BalumaProjectGenNHibernate.Exceptions.DataLayerException("Error in ValidarCAD.", ex); } finally { SessionClose(); } return(validar.Id); }
public int Crear(string p_usuario) { ValidarEN validarEN = null; int oid; //Initialized ValidarEN validarEN = new ValidarEN(); if (p_usuario != null) { validarEN.Usuario = new BalumaProjectGenNHibernate.EN.BalumaProject.UsuarioEN(); validarEN.Usuario.NIF = p_usuario; } //Call to ValidarCAD oid = _IValidarCAD.Crear(validarEN); return(oid); }