//Author:    Mandy Ossana
        //Purpose:   Handles the notification that the form wants to terminate
        //Written:   3-22-2000
        //Modifications:
        //000        Mandy Ossana        Initial Release

        internal int lReleaseForm()
        {
            //initializes the error handler
            int result = ProFitData.PFT_FAILURE;

            try
            {
                ProFitData.gFRWKSVC.SysLog("CCollectionView::lReleaseForm - Entrance", LogLevel.logAudit2);

                //local variables
                int lStatus = 0;

                //determine if parent reference is good
                if (mParent != null)
                {
                    //request that the view be release
                    lStatus = mParent.ReleaseView();
                    //check the status
                    if (lStatus != ProFitData.PFT_SUCCESS)
                    {
                        //log the shut down problem
                        ProFitData.gFRWKSVC.SysLog("CCollectionView::lReleaseForm - Parent.lReleaseView failed", LogLevel.logDebug3);
                        ProFitData.gFRWKSVC.SysLog("CCollectionView::lReleaseForm - lStatus:  " + lStatus.ToString(), LogLevel.logDebug3);
                    }
                }

                //log a success
                ProFitData.gFRWKSVC.SysLog("CCollectionView::lReleaseForm - Normal Termination", LogLevel.logAudit2);
                //return success
                //normal termination
                return(ProFitData.PFT_SUCCESS);
            }
            catch (System.Exception _exception_)
            {
                Cerner.Foundations.Logging.ExceptionReporting.ReportException(_exception_);

                //abnormal termination
                if (result == ProFitData.PFT_SUCCESS)
                {
                    result = ProFitData.PFT_FAILURE;
                }
                ProFitData.gFRWKSVC.SysLog("CCollectionView::lReleaseForm - Abnormal Termination", LogLevel.logAudit2);

                return(result);
            }
            finally
            {
                //cleanup code
                if (mParent != null)
                {
                    mParent.Dispose();
                    mParent = null;
                }
                if (mData != null)
                {
                    mData.Dispose();
                    mData = null;
                }
                if (mCurForm != null)
                {
                    mCurForm.Dispose();
                    mCurForm = null;
                }
            }
        }