internal void Update(IAcreedor 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; ValidationRules.CheckRules(); if (!IsValid) { throw new iQValidationException(moleQule.Resources.Messages.GENERIC_VALIDATION_ERROR); } PayrollBatchRecord obj = parent.Session().Get <PayrollBatchRecord>(Oid); obj.CopyValues(Base.Record); parent.Session().Update(obj); UpdateAssociatedExpenses(); MarkOld(); }
private void DataPortal_Delete(CriteriaCs criteria) { try { // Iniciamos la conexion y la transaccion SessionCode = OpenSession(); BeginTransaction(); CriteriaEx criterio = GetCriteria(); criterio.AddOidSearch(criteria.Oid); PayrollBatchRecord obj = (PayrollBatchRecord)(criterio.UniqueResult()); Session().Delete(obj); Transaction().Commit(); Expenses.DeleteItems(obj.Oid); } catch (Exception ex) { if (Transaction() != null) { Transaction().Rollback(); } throw new iQPersistentException(iQExceptionHandler.GetAllMessages(ex)); } finally { CloseSession(); } }
internal void Update(PayrollBatchs parent) { // if we're not dirty then don't update the database if (!this.IsDirty) { return; } ValidationRules.CheckRules(); if (!IsValid) { throw new iQValidationException(moleQule.Resources.Messages.GENERIC_VALIDATION_ERROR); } SessionCode = parent.SessionCode; PayrollBatchRecord obj = Session().Get <PayrollBatchRecord>(Oid); obj.CopyValues(Base.Record); Session().Update(obj); UpdateAssociatedExpenses(); MarkOld(); }
protected override void DataPortal_Update() { if (!IsDirty) { return; } PayrollBatchRecord obj = Session().Get <PayrollBatchRecord>(Oid); obj.CopyValues(this.Base.Record); Session().Update(obj); UpdateAssociatedExpenses(); MarkOld(); }
public void Update(Registro parent) { // if we're not dirty then don't update the database if (!this.IsDirty) { return; } ValidationRules.CheckRules(); SessionCode = parent.SessionCode; PayrollBatchRecord obj = Session().Get <PayrollBatchRecord>(Oid); obj.CopyValues(Base.Record); Session().Update(obj); MarkOld(); }
internal void DeleteSelf(IAcreedor parent) { // if we're not dirty then don't update the database if (!this.IsDirty) { return; } // if we're new then don't update the database if (this.IsNew) { return; } PayrollBatchRecord obj = parent.Session().Get <PayrollBatchRecord>(Oid); obj.CopyValues(Base.Record); parent.Session().Update(obj); Expenses.DeleteItems(obj.Oid); MarkNew(); }