Exemple #1
0
        /// <summary>
        /// Delect recordes from allocation
        /// </summary>
        /// <param name="hdr"></param>
        /// <returns>Bool type</returns>
        private Boolean Delete(MAllocationHdr hdr)
        {
            //	_m_trx.start();
            Boolean success = false;

            String msg = null;

            //	Std Period open?
            msg = DocumentEngine.IsPeriodOpen(hdr);
            if (msg != null)
            {
                msg = "@DeleteError@" + hdr.GetDocumentNo() + ": " + msg;
                log.Warning(msg);
                return(false);
            }

            if (hdr.Delete(true, _m_trx))
            {
                log.Fine(hdr.ToString());
                success = true;
            }
            if (success)
            {
                _m_trx.Commit();
            }
            else
            {
                _m_trx.Rollback();
            }
            return(success);
        }