/// <summary>
        /// Action handler for ManagePawnApplication
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="data"></param>
        private void managePawnAppFormNavAction(object sender, object data)
        {
            if (sender == null || data == null)
            {
                throw new ApplicationException("Manage pawn app form navigation action handler received invalid data");
            }

            NavBox managePawnAppNavBox = (NavBox)sender;
            ManagePawnApplication managePawnAppForm = (ManagePawnApplication)data;

            NavBox.NavAction action = managePawnAppNavBox.Action;
            if (action == NavBox.NavAction.BACKANDSUBMIT)
            {
                GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back();
                action = NavBox.NavAction.SUBMIT;
            }

            switch (action)
            {
            case NavBox.NavAction.SUBMIT:
                string custDet = managePawnAppNavBox.CustomDetail;
                if (custDet.Equals("ExistingCustomer"))
                {
                    this.nextState = NewPawnLoanFlowState.ExistingCustomer;
                }
                else if (custDet.Equals("DescribeMerchandise"))
                {
                    LoadCustomerLoanKeys loanKeysDataBlk = new LoadCustomerLoanKeys();
                    if (!loanKeysDataBlk.execute())
                    {
                        //throw new ApplicationException("Cannot get Loan keys for selected customer");
                        MessageBox.Show("An error occurred in getting loan details for the selected customer");
                        this.nextState = NewPawnLoanFlowState.CancelFlow;
                    }

                    this.nextState = NewPawnLoanFlowState.InvokeMMPIChildFlow;
                }
                else
                {
                    this.nextState = NewPawnLoanFlowState.ExitFlow;
                }
                break;

            case NavBox.NavAction.CANCEL:
                this.nextState = NewPawnLoanFlowState.CancelFlow;
                break;

            case NavBox.NavAction.BACK:
                GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back();
                this.nextState = NewPawnLoanFlowState.LookupCustomerResults;
                break;

            default:
                throw new ApplicationException("" + action.ToString() + " is not a valid state for ManagePawnApplication");
            }
            this.executeNextState();
        }
        /// <summary>
        /// Action handler for ManagePawnApplication
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="data"></param>
        private void managePawnAppFormNavAction(object sender, object data)
        {
            if (sender == null || data == null)
            {
                throw new ApplicationException("Manage pawn app form navigation action handler received invalid data");
            }

            NavBox managePawnAppNavBox = (NavBox)sender;
            ManagePawnApplication managePawnAppForm = (ManagePawnApplication)data;

            NavBox.NavAction action = managePawnAppNavBox.Action;
            if (action == NavBox.NavAction.BACKANDSUBMIT)
            {
                GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back();
                action = NavBox.NavAction.SUBMIT;
            }

            switch (action)
            {
            case NavBox.NavAction.SUBMIT:
                string custDet = managePawnAppNavBox.CustomDetail;
                if (custDet.Equals("ExistingCustomer"))
                {
                    this.nextState = PawnCustInformationFlowState.ExistingCustomer;
                }
                else if (custDet.Equals("ViewPawnCustomerProductDetails"))
                {
                    this.nextState = PawnCustInformationFlowState.ViewPawnCustomerProductDetails;
                }
                else
                {
                    this.nextState = PawnCustInformationFlowState.CancelFlow;
                }
                break;

            case NavBox.NavAction.CANCEL:
                this.nextState = PawnCustInformationFlowState.CancelFlow;
                break;

            case NavBox.NavAction.BACK:
                GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back();
                this.nextState = PawnCustInformationFlowState.ViewPawnCustomerProductDetails;
                break;

            default:
                throw new ApplicationException("" + action.ToString() + " is not a valid state for ManagePawnApplication");
            }
            this.executeNextState();
        }
Пример #3
0
        /// <summary>
        /// Action handler for ManagePawnApplication
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="data"></param>
        private void managePawnAppFormNavAction(object sender, object data)
        {
            if (sender == null || data == null)
            {
                throw new ApplicationException("Manage pawn app form navigation action handler received invalid data");
            }

            NavBox managePawnAppNavBox = (NavBox)sender;
            ManagePawnApplication managePawnAppForm = (ManagePawnApplication)data;

            NavBox.NavAction action = managePawnAppNavBox.Action;
            if (action == NavBox.NavAction.BACKANDSUBMIT)
            {
                GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back();
                action = NavBox.NavAction.SUBMIT;
            }

            switch (action)
            {
            case NavBox.NavAction.SUBMIT:
                string custDet = managePawnAppNavBox.CustomDetail;
                if (custDet.Equals(Commons.TriggerTypes.EXISTINGCUSTOMER))
                {
                    this.nextState = LookupCustomerFlowState.ExistingCustomer;
                }
                else
                {
                    this.nextState = LookupCustomerFlowState.Cancel;
                }
                break;

            case NavBox.NavAction.CANCEL:
                this.nextState = LookupCustomerFlowState.Cancel;
                break;

            case NavBox.NavAction.BACK:
                GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back();
                this.nextState = LookupCustomerFlowState.LookupCustomerResults;
                break;
            }
            this.executeNextState();
        }