protected virtual void Dispose(bool isDisposing) { if (isDisposing) { ProFitData.gFRWKSVC.SysLog("CTemplateView::Terminate", LogLevel.logDebug3); // ///template if (mCurForm != null) { mCurForm.Dispose(); mCurForm = null; } if (mParent != null) { mParent.Dispose(); mParent = null; } if (mData != null) { mData.Dispose(); mData = null; } } }
//Author: Mandy Ossana //Purpose: Controlling method for loading frmApplication //Written: 3-22-2000 //Modifications: //000 MV4772 Initial release internal int lShowForm() { //initialize error handler int result = ProFitData.PFT_FAILURE; try { //logs the entrance into this method ProFitData.gFRWKSVC.SysLog("CCollectionView::lShowForm - Entrnace", LogLevel.logAudit2); //local variables int lStatus = 0; //determines if the form already exists if (mCurForm == null) { //instantiate the form mCurForm = new frmCollectionLetter(); //set the form's parent reference to this class mCurForm.Parent_Renamed = this; //validate the call if (lStatus != ProFitData.PFT_SUCCESS) { //log the failure of the lGetConds call ProFitData.gFRWKSVC.SysLog("CCollectionView::lShowForm - lGetConds failed", LogLevel.logDebug3); ProFitData.gFRWKSVC.SysLog("CCollectionView::lShowForm - lStatus: " + lStatus.ToString(), LogLevel.logDebug3); //send control to error handler return(ProFitData.PFT_FAILURE); } //Show it mCurForm.Show(); } else { //One's already been created, so just Activate it (see below). lStatus = lActivateForm(); if (lStatus != ProFitData.PFT_SUCCESS) { //log the failure of the ActivateForm call ProFitData.gFRWKSVC.SysLog("CCollectionView::lShowForm - ActivateForm failed", LogLevel.logDebug3); ProFitData.gFRWKSVC.SysLog("CCollection::lShowForm - lStatus: " + lStatus.ToString(), LogLevel.logDebug3); //set return value to failure result = ProFitData.PFT_FAILURE; //send control to error handler return(result); } else { //log the success of the ActivateForm call ProFitData.gFRWKSVC.SysLog("CCollectionView::lShowForm - ActivateForm succeeded", LogLevel.logDebug3); } } //change pointer back to normal Cursor.Current = Cursors.Default; //log a normal termination ProFitData.gFRWKSVC.SysLog("CCollectionView::lShowForm - Normal Termination", LogLevel.logAudit2); //return a normal termination state return(ProFitData.PFT_SUCCESS); } catch (System.Exception _exception_) { Cerner.Foundations.Logging.ExceptionReporting.ReportException(_exception_); //change pointer back to normal Cursor.Current = Cursors.Default; //ensure the function returns error status if (result == ProFitData.PFT_SUCCESS) { result = ProFitData.PFT_FAILURE; } //log abnormal termination ProFitData.gFRWKSVC.SysLog("CCollectionView::lShowForm - Abnormal Termination", LogLevel.logAudit2); return(result); } }
//Author: Mandy Ossana //Purpose: Handles the notification that the implementation class wants to teminate //Written: 3-22-2000 //Modifications: //000 MV4772 Initial release internal int lShutDownFromParent() { //init error handler int result = ProFitData.PFT_FAILURE; try { //log entrance ProFitData.gFRWKSVC.SysLog("CCollectionView::lShutDownFromParent - Entrance", LogLevel.logAudit2); //local variables int lStatus = 0; //determine if mcurForm's reference is good if (mCurForm != null) { //request that the view be release lStatus = mCurForm.ShutDownFromView(); //check the status if (lStatus != ProFitData.PFT_SUCCESS) { //log the shut down problem ProFitData.gFRWKSVC.SysLog("CCollectionView::lShutDownFromParent - mcurForm.ShutDownFromView failed", LogLevel.logDebug3); ProFitData.gFRWKSVC.SysLog("CCollectionView::lShutDownFromParent - lStatus: " + lStatus.ToString(), LogLevel.logDebug3); } } //log a success ProFitData.gFRWKSVC.SysLog("CCollectionView::lShutDownFromParent - 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::lShutDownFromParent - 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; } } }