Beispiel #1
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();
            }
        }
Beispiel #2
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();
        }