private void DataPortal_Delete(CriteriaCs criterio) { try { //Iniciamos la conexion y la transaccion SessionCode = OpenSession(); BeginTransaction(); CriteriaEx criteria = GetCriteria(); criteria.AddOidSearch(criterio.Oid); // Obtenemos el objeto AlumnoExamenRecord obj = (AlumnoExamenRecord)(criteria.UniqueResult()); Session().Delete(Session().Get <AlumnoExamenRecord>(obj.Oid)); Transaction().Commit(); } catch (Exception ex) { if (Transaction() != null) { Transaction().Rollback(); } iQExceptionHandler.TreatException(ex); } finally { CloseSession(); } }
internal void Update(Examen parent) { // if we're not dirty then don't update the database if (!this.IsDirty) { return; } OidExamen = parent.Oid; try { ValidationRules.CheckRules(); if (!IsValid) { throw new iQValidationException(moleQule.Library.Resources.Messages.GENERIC_VALIDATION_ERROR); } AlumnoExamenRecord obj = parent.Session().Get <AlumnoExamenRecord>(Oid); obj.CopyValues(this.Base.Record); parent.Session().Update(obj); _respuestas.Update(this, parent.Session()); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkOld(); }
public virtual void CopyValues(AlumnoExamenRecord source) { if (source == null) { return; } Oid = source.Oid; _oid_alumno = source.OidAlumno; _oid_examen = source.OidExamen; _observaciones = source.Observaciones; _presentado = source.Presentado; _calificacion = source.Calificacion; }
protected override void DataPortal_Update() { if (IsDirty) { try { AlumnoExamenRecord obj = Session().Get <AlumnoExamenRecord>(Oid); obj.CopyValues(this.Base.Record); Session().Update(obj); _respuestas.Update(this, Session()); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } } }