public void CopyValues(IDataReader source) { if (source == null) { return; } int tipo_query = Format.DataReader.GetInt32(source, "TIPO_QUERY"); _record.CopyValues(source); _record.Fecha = Format.DataReader.GetDateTime(source, "FECHA_REGISTRO"); _codigo_registro = Format.DataReader.GetString(source, "CODIGO_REGISTRO"); _tipo_registro = Format.DataReader.GetInt64(source, "TIPO_REGISTRO"); _estado_entidad = Format.DataReader.GetInt64(source, "ESTADO_ENTIDAD"); _codigo_entidad = Format.DataReader.GetString(source, "CODIGO_ENTIDAD"); switch ((ETipoQuery)tipo_query) { case ETipoQuery.FOMENTO: { _expediente = Format.DataReader.GetString(source, "EXPEDIENTE"); _producto = Format.DataReader.GetString(source, "PRODUCTO"); _linea_fomento = Format.DataReader.GetString(source, "LINEA_FOMENTO"); _fecha_conocimiento = Format.DataReader.GetDateTime(source, "CONOCIMIENTO"); _subvencion = Format.DataReader.GetDecimal(source, "SUBVENCION"); } break; } }
/// <summary> /// Actualiza un registro en la base de datos /// </summary> /// <param name="parent">Objeto padre</param> internal void Update(Registro parent, List <TEntidadRegistroList> lists) { // 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; OidRegistro = parent.Oid; ValidationRules.CheckRules(); if (!IsValid) { throw new iQValidationException(Library.Resources.Messages.GENERIC_VALIDATION_ERROR); } RegistryLineRecord obj = parent.Session().Get <RegistryLineRecord>(Oid); obj.CopyValues(this._base.Record); parent.Session().Update(obj); SaveEntidad(parent, lists); MarkOld(); }
/// <summary> /// Actualiza el registro en la base de datos /// </summary> /// <param name="parent">Lista padre</param> /// <remarks>La utiliza la BusinessListBaseEx correspondiente para actualizar elementos<remarks/> internal void Update(RegistryLines parent) { // if we're not dirty then don't update the database if (!this.IsDirty) { return; } ValidationRules.CheckRules(); if (!IsValid) { throw new iQValidationException(Library.Resources.Messages.GENERIC_VALIDATION_ERROR); } SessionCode = parent.SessionCode; RegistryLineRecord obj = Session().Get <RegistryLineRecord>(Oid); obj.CopyValues(this._base.Record); Session().Update(obj); MarkOld(); }