/// <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(Agentes parent) { // if we're not dirty then don't update the database if (!this.IsDirty) { return; } try { ValidationRules.CheckRules(); if (!IsValid) { throw new iQValidationException(moleQule.Library.Resources.Messages.GENERIC_VALIDATION_ERROR); } SessionCode = parent.SessionCode; AgentRecord obj = Session().Get <AgentRecord>(Oid); obj.CopyValues(Base.Record); Session().Update(obj); } catch (Exception ex) { throw new iQPersistentException(iQExceptionHandler.GetAllMessages(ex)); } MarkOld(); }
/// <summary> /// Actualiza un registro en la base de datos /// </summary> /// <param name="parent">Objeto padre</param> internal void Update(Entidad 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; OidEntidad = parent.Oid; try { ValidationRules.CheckRules(); if (!IsValid) { throw new iQValidationException(moleQule.Library.Resources.Messages.GENERIC_VALIDATION_ERROR); } AgentRecord obj = parent.Session().Get <AgentRecord>(Oid); obj.CopyValues(Base.Record); parent.Session().Update(obj); } catch (Exception ex) { throw new iQPersistentException(iQExceptionHandler.GetAllMessages(ex)); } MarkOld(); }
public virtual void CopyValues(AgentRecord source) { if (source == null) { return; } Oid = source.Oid; _oid_entidad = source.OidEntidad; _oid_agente_ext = source.OidAgenteExt; _codigo = source.Codigo; _serial = source.Serial; _nombre = source.Nombre; _fecha = source.Fecha; _observaciones = source.Observaciones; }
protected override void DataPortal_Update() { if (IsDirty) { try { AgentRecord obj = Session().Get <AgentRecord>(Oid); obj.CopyValues(Base.Record); Session().Update(obj); } catch (Exception ex) { throw new iQPersistentException(iQExceptionHandler.GetAllMessages(ex)); } } }