Exemple #1
0
        private void DataPortal_Delete(CriteriaCs criteria)
        {
            try
            {
                Traspaso obj = Traspaso.Get(Oid);

                //Nunca se borran, se anulan
                obj.EEstado = EEstado.Anulado;

                //Anulamos el Movimiento de Banco asociado
                BankLine.AnulaItem(obj, SessionCode);

                obj.Save();
                obj.CloseSession();
            }
            catch (Exception ex)
            {
                if (!SharedTransaction && Transaction() != null)
                {
                    Transaction().Rollback();
                }
                iQExceptionHandler.TreatException(ex);
            }
            finally
            {
                CloseSession();
            }
        }
Exemple #2
0
        /// <summary>
        /// Borra el registro de la base de datos
        /// </summary>
        /// <param name="parent">Lista padre</param>
        /// <remarks>La utiliza la BusinessListBaseEx correspondiente para borrar elementos<remarks/>
        internal void DeleteSelf(Traspasos 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;
            }

            SessionCode = parent.SessionCode;
            Session().Delete(Session().Get <BankTransferRecord>(Oid));

            //Anulamos el Movimiento de Banco asociado
            BankLine.AnulaItem(this, SessionCode);

            MarkNew();
        }