internal void Update(Submodulo parent) { // if we're not dirty then don't update the database if (!this.IsDirty) { return; } //Debe obtener la sesion del padre pq el objeto es padre a su vez SessionCode = parent.SessionCode; OidSubmodulo = parent.Oid; try { ValidationRules.CheckRules(); if (!IsValid) { throw new iQValidationException(moleQule.Library.Resources.Messages.GENERIC_VALIDATION_ERROR); } ClaseTeoricaRecord obj = parent.Session().Get <ClaseTeoricaRecord>(Oid); obj.CopyValues(this.Base.Record); parent.Session().Update(obj); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkOld(); }
internal void CopyValues(IDataReader source) { if (source == null) { return; } _record.CopyValues(source); _modulo = Format.DataReader.GetString(source, "MODULO"); _submodulo = Format.DataReader.GetString(source, "SUBMODULO"); _codigo_orden = Format.DataReader.GetString(source, "CODIGO_ORDEN") + "." + _record.OrdenTerciario.ToString("000"); _estado = Format.DataReader.GetInt32(source, "ESTADO"); _instructor = Format.DataReader.GetString(source, "INSTRUCTOR"); _fecha = Format.DataReader.GetDateTime(source, "FECHA"); _hora = Format.DataReader.GetDateTime(source, "HORA"); _total_modulo = Format.DataReader.GetInt64(source, "COUNT_MODULO"); _total_submodulo = Format.DataReader.GetInt64(source, "COUNT_SUBMODULO"); }
protected override void DataPortal_Update() { if (IsDirty) { try { ClaseTeoricaRecord obj = Session().Get <ClaseTeoricaRecord>(Oid); obj.CopyValues(this.Base.Record); Session().Update(obj); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } } }