コード例 #1
0
        //Refer to the CMessage class for details about receiving
        //messages. This function is vital for receiving special
        //instructions from the Framework and other classes. It
        //receives a CMessage object, and optionally returns
        //a CMessage object.
        public int Message(PFTFramework.CMessage oMsg)
        {
            int result = ProFitData.PFT_FAILURE;

            //initialize the error handler
            try
            {
                //logs the entry into this method
                ProFitData.gFRWKSVC.SysLog("CCollection::Message - Entry", LogLevel.logAudit2);
                int lStatus = 0;

                //determines what action is required based on the type of message
                //being sent to this object from the frameworks message services
                switch (oMsg.MessageType)
                {
                case eMessageType.MSG_CREATE:
                    //We can set up any additional info here
                    //if we need too. In this case, we set up
                    //our IconText and PanelText properties.
                    ClassInfo.IconText  = ResourceHandler.Resources.GetString("1475");    //i18n
                    ClassInfo.PanelText = ResourceHandler.Resources.GetString("1475");    //i18n

                    //Now we add our icon to the Navigation bar
                    //(optional)
                    ClassInfo.AddIconToNavBar();
                    lStatus = Convert.ToInt32(Cerner.ApplicationFramework.ConversionSupport.Utils.ReflectionHelper.Invoke(Parent, "lAddIconToTvw", new object[] { mClassInfo }));

                    //This message is sent from the Framework, telling
                    //us that the Framework is being shut down, and we
                    //need to clean up our resources.
                    break;

                case eMessageType.MSG_DESTROY:
                    if (mView != null)
                    {
                        //we don't have a view, so don't worry about it
                        mView.lShutDownFromParent();
                        //we can release our view reference
                        mView      = null;
                        mClassInfo = null;
                    }
                    //message is sent to tell us that we have been clicked
                    break;

                case eMessageType.MSG_CLICK:

                    if (mView == null)
                    {
                        //we don't have a view, so make one
                        lStatus = lShowView();

                        if (lStatus != ProFitData.PFT_SUCCESS)
                        {
                            //Message the user that there has been a problem in creating the form.
                        }
                    }

                    //Activate the form associated with the view
                    mView.lActivateForm();
                    break;

                case eMessageType.MSG_NOTIFY:
                    //figure out who is notifying us
                    //TL4790
                    if (string.Compare(Convert.ToString(oMsg.Variable2), "BESEARCH", true) == 0)
                    {
                        lStatus = mView.lMessageReply(oMsg);
                        if (lStatus != ProFitData.PFT_SUCCESS)
                        {
                            ProFitData.gFRWKSVC.SysLog("Error returned from mView:lMessageReply", LogLevel.logDebug3);
                            ProFitData.gFRWKSVC.SysLog("lRet: " + lStatus.ToString(), LogLevel.logDebug3);
                        }
                    }
                    else
                    {
                    }
                    //End TL4790
                    break;

                default:
                    break;
                }
                //normal termination
                ProFitData.gFRWKSVC.SysLog("CCollection::Message - Normal Termination", LogLevel.logAudit2);

                //returns the normal termination of this method
                return(ProFitData.PFT_SUCCESS);
            }
            catch (System.Exception _exception_)
            {
                Cerner.Foundations.Logging.ExceptionReporting.ReportException(_exception_);

                //ensures the function returns an error status
                if (result == ProFitData.PFT_SUCCESS)
                {
                    result = ProFitData.PFT_FAILURE;
                }

                //abnormal termination
                ProFitData.gFRWKSVC.SysLog("CCollection::Message - Abnormal Termination", LogLevel.logAudit2);

                return(result);
            }
        }
コード例 #2
0
        internal int lMessageReply(PFTFramework.CMessage roMsg)
        {
            int result  = 0;
            int lStatus = 0;

            ProFitData.gFRWKSVC.SysLog("CCollectionViewEnter", LogLevel.logAudit2);

            result = ProFitData.PFT_FAILURE;

            try
            {
                if (mCurForm != null)
                {
                    switch (Convert.ToString(roMsg.Variable2))
                    {
                    case "GETFOCUS":
                        if (mCurForm != null)
                        {
                            lStatus = lActivateForm();
                            if (lStatus != ProFitData.PFT_SUCCESS)
                            {
                                ProFitData.gFRWKSVC.SysLog("Error returned from lActivateForm", LogLevel.logDebug3);
                                ProFitData.gFRWKSVC.SysLog("lStatus: " + lStatus.ToString(), LogLevel.logDebug3);
                            }
                        }
                        break;

                    case "BESEARCH":
                        switch (Convert.ToString(roMsg.Variable1))
                        {
                        case "CANCEL":
                            //the user closed the form
                            mCurForm.cmdBESearch.Enabled = true;
                            break;

                        case "COMPLETE":
                            //we are ready to go get the data
                            lStatus = mCurForm.lGetSearchData(Convert.ToString(roMsg.Variable2));
                            if (lStatus != ProFitData.PFT_SUCCESS)
                            {
                                ProFitData.gFRWKSVC.SysLog("Error returned from mCurForm.lGetSearchData", LogLevel.logDebug3);
                                ProFitData.gFRWKSVC.SysLog("lStatus: " + lStatus.ToString(), LogLevel.logDebug3);
                            }
                            break;

                        case "ERROR":
                            //there was an error returned from the search
                            mCurForm.cmdBESearch.Enabled = true;
                            break;

                        default:
                            break;
                        }
                        break;

                    default:
                        break;
                    }
                }

                //if we get here, we have succeeded
                result = ProFitData.PFT_SUCCESS;
                //mParent.lPopulateStatementInfo (abeid)
                ProFitData.gFRWKSVC.SysLog("CCollectionViewExit", LogLevel.logAudit2);
                return(result);
            }
            catch (System.Exception _exception_)
            {
                Cerner.Foundations.Logging.ExceptionReporting.ReportException(_exception_);

                ProFitData.gFRWKSVC.SysLog("CCollectionViewError", LogLevel.logAudit2);
                //    MsgBox i18nGetMessage(msModule_Name, "108", gino_index, "Invalid Script Status"), vbCritical 'i18n
                Cursor.Current = Cursors.Default;
                result         = ProFitData.PFT_FAILURE;

                return(result);
            }
        }
コード例 #3
0
 //This Event is raised from the mClassInfo object.  As other objects
 //send message, this event will receive the event and then pass the oMsg object
 //to the Message function
 private void mClassInfo_EvntMessage(ref PFTFramework.CMessage oMsg)
 {
     Message(oMsg);
 }
コード例 #4
0
        //get the data from the referenced searches
        internal int lGetSearchData(string rsFrom)
        {
            int result = 0;

            ProFitData.gFRWKSVC.SysLog("frmCollectionLetter::lGetSearchData", LogLevel.logAudit2);

            try
            {
                int lSeaStatus             = 0;    //status result from search
                PFTFramework.CMessage oMsg = null; //Message object

                if (string.Compare(rsFrom, "BESEARCH", true) == 0)
                {
                    aBE_id      = new double[3];
                    aBE_display = new string[] { String.Empty, String.Empty, String.Empty };
                    //Get the search data from account search
                    lSeaStatus = oBESearch.lGetBEData(ref aBE_id, ref aBE_display, ref lCount);

                    this.Cursor = Cursors.WaitCursor;

                    if (lSeaStatus == ProFitData.PFT_SUCCESS)
                    {
                        if (lCount > 0)
                        {
                            mParent.Data.BillingEntityID = aBE_id[0];
                            txtBillingEntity.Text        = aBE_display[0];
                        }
                    }
                    else
                    {
                        ProFitData.gFRWKSVC.SysLog("We got back a failure from lGetBEData", LogLevel.logDebug3);
                        result = lSeaStatus;
                        return(result);
                    }

                    //send a message to the AcctSearch to destroy itself
                    oMsg             = new PFTFramework.CMessage();
                    oMsg.MessageType = eMessageType.MSG_DESTROY;
                    oBESearch.Message(ref oMsg);
                    oBESearch = null;
                    oMsg      = null;

                    cmdBESearch.Enabled  = true;
                    cmbDunningCd.Text    = System.String.Empty;
                    cmbDunningCd.Enabled = true;
                    for (int n = 1; n <= 15; n++)
                    {
                        txtLetter[n].Text = System.String.Empty;
                    }

                    result = ProFitData.PFT_SUCCESS;
                    ProFitData.gFRWKSVC.SysLog("frmCollectionLetter::lGetSearchData:Normal termination", LogLevel.logAudit2);
                    return(result);
                }
            }
            catch (System.Exception _exception_)
            {
                Cerner.Foundations.Logging.ExceptionReporting.ReportException(_exception_);
                ProFitData.gFRWKSVC.SysLog("frmCollectionLetter::lGetSearchData:Error", LogLevel.logAudit2);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
            return(result);
        }