示例#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();
        }
示例#2
0
        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();
            }
        }
示例#3
0
        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();
        }
示例#4
0
        protected override void DataPortal_Update()
        {
            if (!IsDirty)
            {
                return;
            }

            PayrollBatchRecord obj = Session().Get <PayrollBatchRecord>(Oid);

            obj.CopyValues(this.Base.Record);
            Session().Update(obj);

            UpdateAssociatedExpenses();

            MarkOld();
        }
示例#5
0
        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();
        }
示例#6
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();
        }