Example #1
0
        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();
        }
Example #2
0
        internal void Insert(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;

            GetNewCode();
            UpdateAssociatedExpenses();

            ValidationRules.CheckRules();

            if (!IsValid)
            {
                throw new iQValidationException(moleQule.Resources.Messages.GENERIC_VALIDATION_ERROR);
            }

            parent.Session().Save(Base.Record);

            MarkOld();
        }
Example #3
0
        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();
        }
        internal void Insert(IAcreedor parent)
        {
            // if we're not dirty then don't update the database
            if (!this.IsDirty)
            {
                return;
            }

            this.OidAcreedor = parent.Oid;

            try
            {
                parent.Session().Save(_base.Record);
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkOld();
        }