Beispiel #1
0
        public void Start()
        {
            _handle.Start();
            var show = new ShowForm(_formWait.ShowDialog);

            show.BeginInvoke(null, new object());
        }
Beispiel #2
0
 private void массивОбобщенныхЧиселБеллаToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (!((ShowForm != null) && (ShowForm.Disposing) && (ShowForm.IsDisposed)))
     {
         ShowForm = new Form3();
     }
     ShowForm.Show();
 }
Beispiel #3
0
        /// <summary>
        /// Main execution function for NewPawnLoanFlowExecutor
        /// </summary>
        /// <param name="inputData"></param>
        /// <returns></returns>
        private object executorFxn(object inputData)
        {
            ShowForm ProductServicesBlk = CommonAppBlocks.Instance.CreateProductServicesBlock(this.parentForm, this.productServicesFormNavAction);

            if (!ProductServicesBlk.execute())
            {
                throw new ApplicationException("Cannot execute Product Services block");
            }
            return(true);
        }
Beispiel #4
0
        /// <summary>
        /// Main execution function for NewPawnLoanFlowExecutor
        /// </summary>
        /// <param name="inputData"></param>
        /// <returns></returns>
        private object executorFxn(object inputData)
        {
            if (inputData == null)
            {
                return(false);
            }

            LookupReceiptFlowState curState = (LookupReceiptFlowState)inputData;

            switch (curState)
            {
            case LookupReceiptFlowState.LookupReceipt:
                ShowForm lookupReceiptBlk =
                    CommonAppBlocks.Instance.CreateLookupReceiptBlock(
                        this.parentForm, this.lookupReceiptFormNavAction);
                if (!lookupReceiptBlk.execute())
                {
                    throw new ApplicationException("Cannot execute lookup receipt block");
                }
                break;

            case LookupReceiptFlowState.ViewReceipt:
                ShowForm viewReceiptBlk =
                    CommonAppBlocks.Instance.CreateViewReceiptBlock(
                        this.parentForm, this.viewReceiptFormNavAction);
                if (!viewReceiptBlk.execute())
                {
                    throw new ApplicationException("Cannot execute view receipt block");
                }

                break;

            case LookupReceiptFlowState.CancelFlow:
                if (this.endStateNotifier != null)
                {
                    this.endStateNotifier.execute();
                }
                break;

            case LookupReceiptFlowState.Error:
                break;

            case LookupReceiptFlowState.ExitFlow:
                if (this.endStateNotifier != null)
                {
                    this.endStateNotifier.execute();
                }
                break;

            default:
                throw new ApplicationException("Invalid flow state for LookupReceiptFlowExecutor");
            }

            return(true);
        }
Beispiel #5
0
        /// <summary>
        /// Main execution function for RetailReturnFlowexecutor
        /// </summary>
        /// <param name="inputData"></param>
        /// <returns></returns>
        private object executorFxn(object inputData)
        {
            if (inputData == null)
            {
                return(false);
            }
            LayawayReturnFlowState inputState = (LayawayReturnFlowState)inputData;

            switch (inputState)
            {
            case LayawayReturnFlowState.LayawaySearch:
                ShowForm buyReturnFrmBlk = CommonAppBlocks.Instance.LayawaySearchFormBlock(this.parentForm, this.layawaySearchFormNavAction);
                if (!buyReturnFrmBlk.execute())
                {
                    throw new ApplicationException("Cannot show layaway search form");
                }
                break;

            case LayawayReturnFlowState.LayawayRefund:
                ShowForm buyReturnItemBlk = CommonAppBlocks.Instance.LayawayRefundFormBlock(this.parentForm, this.layRefundFormNavAction);
                if (!buyReturnItemBlk.execute())
                {
                    throw new ApplicationException("Cannot show layaway refund form");
                }

                break;

            case LayawayReturnFlowState.TenderOut:
                if (GlobalDataAccessor.Instance.DesktopSession.HistorySession.Lookup("TenderOut"))
                {
                    GlobalDataAccessor.Instance.DesktopSession.HistorySession.VisibleForm("TenderOut");
                }
                else
                {
                    ShowForm tenderBlk = CommonAppBlocks.Instance.TenderOutExistingRefundShowBlock(this.parentForm, this.TenderOutFormAction);
                    if (!tenderBlk.execute())
                    {
                        throw new ApplicationException("Cannot execute Tender Out Block");
                    }
                }
                break;

            case LayawayReturnFlowState.CancelFlow:
                GlobalDataAccessor.Instance.DesktopSession.ClearCustomerList();
                GlobalDataAccessor.Instance.DesktopSession.ClearSessionData();
                if (this.endStateNotifier != null)
                {
                    this.endStateNotifier.execute();
                }
                break;
            }


            return(true);
        }
Beispiel #6
0
        public IActionResult EditShow(ShowForm form)
        {
            //Rewriting values from old record to eliminate bugs with bad value setting in fields in Razor
            Show oldShow = Show.getOneById(form.ID);

            form.Name      = form.Name == null ? oldShow.Name : form.Name;
            form.Character = form.Character == null ? oldShow.Character : form.Character;
            form.Episodes  = form.Episodes <= 0 ? oldShow.Episodes : form.Episodes;
            form.Series    = form.Series <= 0 ? oldShow.Series : form.Series;
            Show.updateShow(form);
            return(RedirectToAction("Data", "Home"));
        }
Beispiel #7
0
 public static void ShowRecognizeForm(MainForm parent, RecognizeForm rform)
 {
     if (parent.InvokeRequired)
     {
         ShowForm sf = new ShowForm(ShowRecognizeForm);
         parent.Invoke(sf, new object[] { parent, rform });
     }
     else
     {
         rform.Show(parent);
     }
 }
 private void ShowForm2(object sender, MessageEventArgs e)
 {
     if (this.InvokeRequired)
     {
         ShowForm f = new ShowForm(ShowForm2);
         this.Invoke(f, new object[] { sender, e });
     }
     else
     {
         Form2 f2 = new Form2();
         f2.Show();
     }
 }
        /// <summary>
        /// Main execution function for SecurityFlowExecutor
        /// </summary>
        /// <param name="inputData"></param>
        /// <returns></returns>
        private object executorFxn(object inputData)
        {
            if (inputData == null)
            {
                return(false);
            }
            SecurityFlowState inputState = (SecurityFlowState)inputData;

            switch (inputState)
            {
            case SecurityFlowState.SelectEmployee:
                ShowForm selEmployeeBlk = CommonAppBlocks.Instance.SelectEmployeeFormBlock(this.parentForm, this.selectEmployeeFormNavAction);
                if (!selEmployeeBlk.execute())
                {
                    throw new ApplicationException("Cannot execute SelectEmployee block");
                }

                break;

            case SecurityFlowState.SecurityProfile:
                ShowForm secProfileBlk = CommonAppBlocks.Instance.SecurityProfileFormBlock(this.parentForm, this.securityProfileFormNavAction);
                if (!secProfileBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Security Profile block");
                }
                break;

            case SecurityFlowState.AddEmployee:
                ShowForm addEmpBlk = CommonAppBlocks.Instance.AddEmployeeFormBlock(this.parentForm, this.addEmployeeFormNavAction);
                if (!addEmpBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Add Employee block");
                }
                break;


            case SecurityFlowState.Cancel:

                if (this.endStateNotifier != null)
                {
                    this.endStateNotifier.execute();
                }
                break;


            default:
                throw new ApplicationException("Invalid Security flow state");
            }

            return(true);
        }
        private ShowForm createShowFormBlock(
            ValidFormBlockTypes nm,
            Form pFm,
            Form fm)
        {
            if (fm == null)
            {
                return(null);
            }

            var sFm = new ShowForm(AuditDesktopSession.Instance, pFm, fm);

            return(sFm);
        }
        private ShowForm createShowFormBlock(
            ValidFormBlockTypes nm,
            Form pFm,
            Form fm,
            NavBox nvBox,
            NavBox.NavBoxActionFired nvBoxDeleg)
        {
            if (fm == null)
            {
                return(null);
            }

            var sFm = new ShowForm(AuditDesktopSession.Instance, pFm, fm, nvBox, nvBoxDeleg);

            return(sFm);
        }
Beispiel #12
0
 private void SetTabsInForm(ShowForm blockName)
 {
     if (GlobalDataAccessor.Instance.DesktopSession.HistorySession.FormsInTree() > 1)
     {
         if (parentFlow.Name.Equals("NewPawnLoanFlowExecutor", StringComparison.OrdinalIgnoreCase))
         {
             CommonAppBlocks.Instance.ShowFlowTabController(this.parentForm, blockName.ClassForm,
                                                            FlowTabController.State.ProductsAndServices);
         }
         else
         {
             CommonAppBlocks.Instance.ShowFlowTabController(this.parentForm, blockName.ClassForm,
                                                            FlowTabController.State.Customer);
         }
         if (GlobalDataAccessor.Instance.DesktopSession.ShowOnlyHistoryTabs)
         {
             CommonAppBlocks.Instance.SetFlowTabEnabled(FlowTabController.State.Customer, false);
             CommonAppBlocks.Instance.SetFlowTabEnabled(FlowTabController.State.ProductsAndServices,
                                                        false);
             CommonAppBlocks.Instance.SetFlowTabEnabled(FlowTabController.State.Stats, false);
             CommonAppBlocks.Instance.SetFlowTabEnabled(FlowTabController.State.ItemHistory, true);
             CommonAppBlocks.Instance.SetFlowTabEnabled(FlowTabController.State.ProductHistory, true);
         }
         else
         {
             CommonAppBlocks.Instance.SetFlowTabEnabled(FlowTabController.State.Customer, true);
             CommonAppBlocks.Instance.SetFlowTabEnabled(FlowTabController.State.ProductsAndServices,
                                                        true);
             CommonAppBlocks.Instance.SetFlowTabEnabled(FlowTabController.State.Stats, true);
             CommonAppBlocks.Instance.SetFlowTabEnabled(FlowTabController.State.ItemHistory, true);
             CommonAppBlocks.Instance.SetFlowTabEnabled(FlowTabController.State.ProductHistory, true);
         }
         if (parentFlow.Name.Equals("NewPawnLoanFlowExecutor", StringComparison.OrdinalIgnoreCase))
         {
             CommonAppBlocks.Instance.SetFlowTabEnabled(FlowTabController.State.Customer, true);
             CommonAppBlocks.Instance.SetFlowTabEnabled(FlowTabController.State.ProductsAndServices,
                                                        false);
             //Get the loan keys for the selected customer
             //
             LoadCustomerLoanKeys loanKeysDataBlk = new LoadCustomerLoanKeys();
             if (!loanKeysDataBlk.execute())
             {
                 throw new ApplicationException("Cannot get Loan keys for selected customer");
             }
         }
     }
 }
        /// <summary>
        /// Main execution function for NewPawnLoanFlowExecutor
        /// </summary>
        /// <param name="inputData"></param>
        /// <returns></returns>
        private object executorFxn(object inputData)
        {
            if (inputData == null)
            {
                return(false);
            }
            ShopCashManagementFlowState inputState = (ShopCashManagementFlowState)inputData;

            switch (inputState)
            {
            case ShopCashManagementFlowState.ViewCashDrawerAssignments:
                ShowForm viewCashDrawerFmBlk = CommonAppBlocks.Instance.CreateViewCashDrawerAssignmentsBlock(this.parentForm, this.viewCashDrawerNavFunction);
                if (!viewCashDrawerFmBlk.execute())
                {
                    throw new ApplicationException("Cannot show View Cash Drawer Assignment form");
                }
                break;

            case ShopCashManagementFlowState.ShopCashManagement:
                ShowForm shopCashFmBlk = CommonAppBlocks.Instance.CreateShopCashManagementForm(this.parentForm, this.shopCashManagementNavFunction);
                if (!shopCashFmBlk.execute())
                {
                    throw new ApplicationException("Cannot show ShopCashMgr form");
                }

                break;

            case ShopCashManagementFlowState.AddCashDrawer:
                ShowForm addCashDrawerFrmBlk = CommonAppBlocks.Instance.CreateAddCashDrawerShowBlock(this.parentForm, this.addCashDrawerNavFunction);
                if (!addCashDrawerFrmBlk.execute())
                {
                    throw new ApplicationException("Cannot show Add Cash Drawer form");
                }
                break;

            case ShopCashManagementFlowState.CancelFlow:
                if (this.endStateNotifier != null)
                {
                    this.endStateNotifier.execute();
                }
                break;
            }


            return(true);
        }
Beispiel #14
0
 private void ShowScoreForm(ScoreBox frm)
 {
     if (this.InvokeRequired)
     {
         ShowForm updaterdelegate = new ShowForm(ShowScoreForm);
         this.Invoke(updaterdelegate, new object[] { frm });
     }
     else
     {
         frm.Location = new Point(this.Left + (this.Width / 2 - frm.Width / 2), this.Top + (this.Height / 2 - frm.Height / 2));
         frm.SetScores(userScore.AsReadOnly(), computerPlayers[0].Score, computerPlayers[1].Score, computerPlayers[2].Score,
                       playState.UserName, computerPlayers[0].Name, computerPlayers[1].Name, computerPlayers[2].Name, true);
         showingScores = true;
         frm.ShowForm(this);
         showingScores = false;
     }
 }
        public ShowForm DescribeItemBlock(
            Form parentForm,
            NavBox.NavBoxActionFired fxn,
            DesktopSession desktopSession)
        {
            var descItemFrm = new DescribeItem(desktopSession, AuditDesktopSession.Instance.DescribeItemContext,
                                               AuditDesktopSession.Instance.DescribeItemPawnItemIndex);
            ShowForm describeItemBlk =
                this.createShowFormBlock(
                    ValidFormBlockTypes.None,
                    parentForm,
                    descItemFrm,
                    descItemFrm.NavControlBox,
                    fxn);

            return(describeItemBlk);
        }
Beispiel #16
0
        /// <summary>
        /// Opens a dictionary window for the specified dictionary, using an
        /// existing window if possible.
        /// </summary>
        /// <param name="dict">The dictionary to open.</param>
        public static void OpenDictionary(DictionaryInfo dict)
        {
            if (dict == null)
            {
                return;
            }

            try {
                ShowForm.Show(
                    form => form.Dictionary.Path == dict.Path,
                    () => new LookupForm(dict));
            } catch (System.IO.IOException e) {
                Errors.CouldNotLoadDictionary(dict.Name, dict.Path, e);
            } catch (DictionaryLoadException e) {
                Errors.CouldNotLoadDictionary(dict.Name, dict.Path, e);
            }
        }
        /// <summary>
        /// Main execution function for ReleaseFingerprintsFlowExecutor
        /// </summary>
        /// <param name="inputData"></param>
        /// <returns></returns>
        private object executorFxn(object inputData)
        {
            if (inputData == null)
            {
                return(false);
            }
            ReleaseFingerprintsFlowExecutorFlowState inputState = (ReleaseFingerprintsFlowExecutorFlowState)inputData;

            switch (inputState)
            {
            case ReleaseFingerprintsFlowExecutorFlowState.BuyLoanLookup:
                ShowForm lookupLoanBuyBlk = CommonAppBlocks.Instance.CreateLookupLoanBuyShowBlock(this.parentForm, this.lookupLoanBuyFormNavAction);
                if (!lookupLoanBuyBlk.execute())
                {
                    throw new ApplicationException("Cannot execute BuyLoanLookup block");
                }
                break;

            case ReleaseFingerprintsFlowExecutorFlowState.ShowBuyLoanLookupResults:
                ShowForm lookupLoanBuyResultsBlk = CommonAppBlocks.Instance.CreateReleaseFingerprintsAuthorizationBlock(this.parentForm, this.lookupLoanBuyFormNavAction);
                if (!lookupLoanBuyResultsBlk.execute())
                {
                    throw new ApplicationException("Cannot execute BuyLoanLookupResults block");
                }
                break;

            case ReleaseFingerprintsFlowExecutorFlowState.Cancel:
                //Clear the customer from session
                GlobalDataAccessor.Instance.DesktopSession.ClearCustomerList();

                if (this.endStateNotifier != null)
                {
                    this.endStateNotifier.execute();
                }
                break;


            default:
                throw new ApplicationException("Invalid Release Fingerprints flow state");
            }

            return(true);
        }
Beispiel #18
0
        /// <summary>
        /// Main execution function for LookupCustomerFlowExecutor
        /// </summary>
        /// <param name="inputData"></param>
        /// <returns></returns>
        private object executorFxn(object inputData)
        {
            if (inputData == null)
            {
                inputData = LoanInquiryFlowState.LoanInquiry;
            }
            LoanInquiryFlowState inputState = (LoanInquiryFlowState)inputData;

            switch (inputState)
            {
            case LoanInquiryFlowState.LoanInquiry:
                ShowForm loanInquiry = CommonAppBlocks.Instance.LoanInquiryShowBlock(this.parentForm, this.inquiryFormNavAction);
                if (!loanInquiry.execute())
                {
                    throw new ApplicationException("Cannot execute LoanInquiry block");
                }

                break;

            case LoanInquiryFlowState.LoanInquiryResults:
                ////ShowForm loanInquiryResults = CommonAppBlocks.Instance.LoanInquiryResultsShowBlock(this.parentForm, this.inquiryResultsFormNavAction);
                //if (!loanInquiryResults.execute())
                //{
                //    throw new ApplicationException("Cannot execute LoanInquiry Results block");
                //}
                break;

            case LoanInquiryFlowState.LoanInquiryDetails:
                break;

            case LoanInquiryFlowState.Cancel:
                CommonAppBlocks.Instance.HideFlowTabController();

                if (this.endStateNotifier != null)
                {
                    this.endStateNotifier.execute();
                }
                break;
            }

            return(true);
        }
Beispiel #19
0
 public IActionResult Data(ShowForm form)
 {
     if (form.Name == null || form.Name.Length <= 0)
     {
         ModelState.AddModelError("NameError", GlobalizationResources.Resources.NameError);
     }
     if (form.Episodes <= 0 || form.Series <= 0)
     {
         ModelState.AddModelError("EpisodesSeriesError", GlobalizationResources.Resources.EpisodesSeriesError);
     }
     if (form.Character == null || form.Character.Length <= 0)
     {
         ModelState.AddModelError("CharacterError", GlobalizationResources.Resources.CharacterError);
     }
     if (ModelState.IsValid)
     {
         Show dummy = new Show(form.Name, form.Episodes, form.Series, form.Character);
     }
     return(this.Data());
 }
Beispiel #20
0
        /// <summary>
        /// In order for Visual Studio to use our debugger visualizer, we must drop the DLL in @Visual Studio Install Dir@\Common7\Packages\Debugger\Visualizers.
        /// </summary>
        /// <param name="windowService"></param>
        /// <param name="objectProvider"></param>
        protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
        {
            XmlDocument doc = objectProvider.GetObject() as XmlDocument;

            if (doc != null)
            {
                ShowForm form = new ShowForm();
                form.Text = "XmlDocument";
                form.xmlEditorControl1.Text = doc.toString();
                windowService.ShowDialog(form);
            }
            else
            {
                XDocument xdoc = objectProvider.GetObject() as XDocument;
                if (xdoc != null)
                {
                    ShowForm form = new ShowForm();
                    form.Text = "XDocument";
                    form.xmlEditorControl1.Text = string.Concat(xdoc.Declaration.ToString(), xdoc.ToString());
                    windowService.ShowDialog(form);
                }
            }
        }
        /// <summary>
        /// Main execution function for PFIVerify Flow Executor
        /// </summary>
        /// <param name="inputData"></param>
        /// <returns></returns>
        private object executorFxn(object inputData)
        {
            if (inputData == null)
            {
                return(false);
            }
            PFIVerifyFlowState inputState = (PFIVerifyFlowState)inputData;

            switch (inputState)
            {
            case PFIVerifyFlowState.PfiVerify:

                if (GlobalDataAccessor.Instance.DesktopSession.HistorySession.Lookup("PFI_Verify"))
                {
                    GlobalDataAccessor.Instance.DesktopSession.HistorySession.VisibleForm("PFI_Verify");
                }
                else
                {
                    ShowForm pfiVerifyBlk = CommonAppBlocks.Instance.PFIVerifyBlock(this.parentForm, this.PFIVerifyFormNavFunction);
                    if (!pfiVerifyBlk.execute())
                    {
                        throw new ApplicationException("Cannot execute PFI Verify block");
                    }
                }
                break;

            case PFIVerifyFlowState.DescribeMerchandise:
                ShowForm describeMerchBlk = CommonAppBlocks.Instance.DescribeMerchandiseBlock(this.parentForm, this.describeMerchFormAction);
                if (!describeMerchBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Describe Merchandise block");
                }

                break;

            case PFIVerifyFlowState.DescribeMerchandisePFIMerge:
                ShowForm describeMerchandiseBlk = CommonAppBlocks.Instance.DescribeMerchandisePFIMergeBlock(this.parentForm, this.describeMerchFormAction);
                if (!describeMerchandiseBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Describe Merchandise PFI Merge block");
                }

                break;

            case PFIVerifyFlowState.DescribeMerchandisePFIAdd:
                ShowForm describeMerchandiseAddBlk = CommonAppBlocks.Instance.DescribeMerchandisePFIAddBlock(this.parentForm, this.describeMerchFormAction);
                if (!describeMerchandiseAddBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Describe Merchandise PFI Add block");
                }

                break;

            case PFIVerifyFlowState.DescribeMerchandisePFIReplace:
                ShowForm describeMerchandiseReplaceBlk = CommonAppBlocks.Instance.DescribeMerchandisePFIReplaceBlock(this.parentForm, this.describeMerchFormAction);
                if (!describeMerchandiseReplaceBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Describe Merchandise PFI Replace block");
                }

                break;

            case PFIVerifyFlowState.DescribeItem:
                ShowForm describeItemBlk = CommonAppBlocks.Instance.DescribeItemBlock(this.parentForm, this.describeItemFormAction);
                if (!describeItemBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Describe Item Block");
                }
                break;

            case PFIVerifyFlowState.DescribeItemPFI:
                ShowForm describeItemPFIBlk = CommonAppBlocks.Instance.DescribeItemPFIBlock(this.parentForm, this.describeItemFormAction);
                if (!describeItemPFIBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Describe Item PFI Block");
                }
                break;

            case PFIVerifyFlowState.CancelFlow:
                if (this.endStateNotifier != null)
                {
                    this.endStateNotifier.execute();
                }
                break;
            }


            return(true);
        }
        /// <summary>
        /// Main execution function for PoliceHoldReleaseFlowExecutor
        /// </summary>
        /// <param name="inputData"></param>
        /// <returns></returns>
        private object executorFxn(object inputData)
        {
            if (inputData == null)
            {
                return(false);
            }
            PoliceSeizeFlowState inputState = (PoliceSeizeFlowState)inputData;

            switch (inputState)
            {
            case PoliceSeizeFlowState.LookupCustomer:
                ShowForm lookupCustBlk = CommonAppBlocks.Instance.CreateLookupCustomerShowBlock(this.parentForm, this.lookupCustFormNavAction);
                if (!lookupCustBlk.execute())
                {
                    throw new ApplicationException("Cannot execute LookupCustomer block");
                }

                break;

            case PoliceSeizeFlowState.LookupCustomerResults:
                ShowForm lookupCustResBlk = CommonAppBlocks.Instance.CreateLookupCustomerResultsBlock(this.parentForm, this.lookupCustResultsFormNavAction);
                if (!lookupCustResBlk.execute())
                {
                    throw new ApplicationException("Cannot execute LookupCustomerResults block");
                }
                break;

            case PoliceSeizeFlowState.PoliceHoldList:
                ShowForm loansListBlk = CommonAppBlocks.Instance.CreatePoliceHoldListShowBlock(this.parentForm, this.policeHoldListFormNavAction);
                ((PoliceHoldsList)loansListBlk.ClassForm).PoliceSeize = true;
                if (!loansListBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Loan List block");
                }

                break;

            case PoliceSeizeFlowState.PoliceSeize:
                ShowForm policeSeizeBlk = CommonAppBlocks.Instance.CreatePoliceHoldReleaseInfoShowBlock(this.parentForm, this.policeHoldReleaseInfoFormNavAction);
                //Set the police seize property to true
                ((PoliceHoldRelease)policeSeizeBlk.ClassForm).PoliceSeize = true;
                if (!policeSeizeBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Police Seize block");
                }


                break;

            case PoliceSeizeFlowState.Cancel:
                //Clear the customer from session
                GlobalDataAccessor.Instance.DesktopSession.ClearCustomerList();

                if (this.endStateNotifier != null)
                {
                    this.endStateNotifier.execute();
                }
                break;


            default:
                throw new ApplicationException("Invalid Police Seize flow state");
            }

            return(true);
        }
Beispiel #23
0
 public void OnShowForm(object sender, RibbonEventArgs e) =>
 ShowForm?.Invoke(sender, e);
        /// <summary>
        /// Main execution function for PoliceHoldReleaseFlowExecutor
        /// </summary>
        /// <param name="inputData"></param>
        /// <returns></returns>
        private object executorFxn(object inputData)
        {
            if (inputData == null)
            {
                return(false);
            }
            PoliceHoldReleaseFlowState inputState = (PoliceHoldReleaseFlowState)inputData;

            switch (inputState)
            {
            case PoliceHoldReleaseFlowState.LookupCustomer:
                ShowForm lookupCustBlk = CommonAppBlocks.Instance.CreateLookupCustomerShowBlock(this.parentForm, this.lookupCustFormNavAction);
                if (!lookupCustBlk.execute())
                {
                    throw new ApplicationException("Cannot execute LookupCustomer block");
                }

                break;

            case PoliceHoldReleaseFlowState.LookupCustomerResults:
                ShowForm lookupCustResBlk = CommonAppBlocks.Instance.CreateLookupCustomerResultsBlock(this.parentForm, this.lookupCustResultsFormNavAction);
                if (!lookupCustResBlk.execute())
                {
                    throw new ApplicationException("Cannot execute LookupCustomerResults block");
                }
                break;

            case PoliceHoldReleaseFlowState.PoliceHoldReleaseList:
                ShowForm custHoldRelListBlk = CommonAppBlocks.Instance.CreatePoliceHoldReleaseListShowBlock(this.parentForm, this.policeHoldReleaseListFormNavAction);
                if (!custHoldRelListBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Police Hold Release List block");
                }
                break;

            case PoliceHoldReleaseFlowState.PoliceHoldReleaseInfo:
                ShowForm custHoldRelInfoBlk = CommonAppBlocks.Instance.CreatePoliceHoldReleaseInfoShowBlock(this.parentForm, this.policeHoldReleaseInfoFormNavAction);
                if (!custHoldRelInfoBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Police Hold Release Info block");
                }
                break;

            case PoliceHoldReleaseFlowState.PoliceHoldReleaseToClaimant:
                //Clear Previous Customer Srch Data DF 0028
                GlobalDataAccessor.Instance.DesktopSession.ActiveLookupCriteria = new LookupCustomerSearchData();
                ShowForm policeHoldRelToClaimantBlk = CommonAppBlocks.Instance.CreatePoliceHoldReleaseInfoShowBlock(this.parentForm, this.policeHoldReleaseInfoFormNavAction);
                if (!policeHoldRelToClaimantBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Police Hold Release Info block");
                }
                //Set the release to claimant property to true
                ((PoliceHoldRelease)policeHoldRelToClaimantBlk.ClassForm).ReleaseToClaimant = true;
                break;

            case PoliceHoldReleaseFlowState.ManageCustomer:
                CreateCustomer createCustFrm = new CreateCustomer();
                Form           currForm      = GlobalDataAccessor.Instance.DesktopSession.HistorySession.Lookup(createCustFrm);
                if (currForm.GetType() == typeof(CreateCustomer))
                {
                    GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back();
                }
                else
                {
                    ShowForm createCustBlk = CommonAppBlocks.Instance.CreateCreateCustomerBlock(this.parentForm, this.createCustFormNavAction);
                    if (!createCustBlk.execute())
                    {
                        throw new ApplicationException("Cannot execute Create Customer block");
                    }
                }
                break;

            case PoliceHoldReleaseFlowState.UpdateAddress:
                UpdateAddress addrFrm        = new UpdateAddress();
                Form          currentaddForm = GlobalDataAccessor.Instance.DesktopSession.HistorySession.Lookup(addrFrm);
                if (currentaddForm.GetType() == typeof(UpdateAddress))
                {
                    GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back();
                }
                else
                {
                    ShowForm updateAddrBlk = CommonAppBlocks.Instance.UpdateAddressShowFormBlock(this.parentForm, this.updateAddressFormNavAction);
                    if (!updateAddrBlk.execute())
                    {
                        throw new ApplicationException("Cannot execute Update Addess Form block");
                    }
                }

                break;

            case PoliceHoldReleaseFlowState.UpdatePhysicalDescription:

                ShowForm updatePhysDescBlk = CommonAppBlocks.Instance.UpdatePhysDescShowFormBlock(this.parentForm, this.updatePhysicalDescFormNavAction);
                if (!updatePhysDescBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Update Physical Description block");
                }


                break;

            case PoliceHoldReleaseFlowState.Cancel:
                //Clear the customer from session
                GlobalDataAccessor.Instance.DesktopSession.ClearCustomerList();

                if (this.endStateNotifier != null)
                {
                    this.endStateNotifier.execute();
                }
                break;


            default:
                throw new ApplicationException("Invalid Police Hold release flow state");
            }

            return(true);
        }
Beispiel #25
0
        private object executorFxn(object inputData)
        {
            if (inputData == null)
            {
                inputData = suspendedState;
            }
            InventoryAuditFlowState inputState = (InventoryAuditFlowState)inputData;

            Form currForm;

            switch (inputState)
            {
            case InventoryAuditFlowState.SelectAudit:
                SelectAudit selectAudit = new SelectAudit();
                currForm = DesktopSession.HistorySession.Lookup(selectAudit);
                if (currForm.GetType() == typeof(SelectAudit))
                {
                    currForm.Show();
                }
                else
                {
                    ShowForm selectAuditBlk = CommonAppBlocks.Instance.CreateSelectAuditShowBlock(this.parentForm, this.selectAuditFormNavAction);
                    if (!selectAuditBlk.execute())
                    {
                        throw new ApplicationException("Cannot execute Select Audit block");
                    }
                }

                break;

            case InventoryAuditFlowState.SelectStore:
                SelectStore selectStore = new SelectStore();
                currForm = DesktopSession.HistorySession.Lookup(selectStore);
                if (currForm.GetType() == typeof(SelectStore))
                {
                    currForm.Show();
                }
                else
                {
                    ShowForm selectStoreBlk = CommonAppBlocks.Instance.CreateSelectStoreShowBlock(this.parentForm, this.selectStoreFormNavAction);
                    if (!selectStoreBlk.execute())
                    {
                        throw new ApplicationException("Cannot execute Select Store block");
                    }
                }

                break;

            case InventoryAuditFlowState.InitiateAudit:
                InitiateAudit initiateAudit = new InitiateAudit();
                currForm = DesktopSession.HistorySession.Lookup(initiateAudit);
                if (currForm.GetType() == typeof(InitiateAudit))
                {
                    currForm.Show();
                }
                else
                {
                    ShowForm initiateAuditBlk = CommonAppBlocks.Instance.CreateInitiateAuditShowBlock(this.parentForm, this.initiateAuditFormNavAction);
                    if (!initiateAuditBlk.execute())
                    {
                        throw new ApplicationException("Cannot execute Initiate Audit block");
                    }
                }

                break;

            case InventoryAuditFlowState.AuditManager:
                AuditManager auditManager = new AuditManager();
                currForm = DesktopSession.HistorySession.Lookup(auditManager);
                if (currForm.GetType() == typeof(AuditManager))
                {
                    currForm.Show();
                }
                else
                {
                    ShowForm auditManagerBlk = CommonAppBlocks.Instance.CreateAuditManagerShowBlock(this.parentForm, this.auditManagerFormNavAction);
                    if (!auditManagerBlk.execute())
                    {
                        throw new ApplicationException("Cannot execute Audit Manager block");
                    }
                }

                break;

            case InventoryAuditFlowState.InventorySummary:
                InventorySummary inventorySummary = new InventorySummary();
                currForm = DesktopSession.HistorySession.Lookup(inventorySummary);

                ShowForm inventorySummaryBlk = CommonAppBlocks.Instance.CreateInventorySummaryShowBlock(this.parentForm, this.inventorySummaryFormNavAction);
                if (!inventorySummaryBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Inventory Summary block");
                }


                break;

            case InventoryAuditFlowState.InventoryQuestions:
                InventoryQuestions inventoryQuestions = new InventoryQuestions();
                currForm = DesktopSession.HistorySession.Lookup(inventoryQuestions);
                if (currForm.GetType() == typeof(InventoryQuestions))
                {
                    currForm.Show();
                }
                else
                {
                    ShowForm inventoryQuestionsBlk = CommonAppBlocks.Instance.CreateInventoryQuestionsShowBlock(this.parentForm, this.inventoryQuestionsFormNavAction);
                    if (!inventoryQuestionsBlk.execute())
                    {
                        throw new ApplicationException("Cannot execute Inventory Questions block");
                    }
                }

                break;

            case InventoryAuditFlowState.DownloadToTrakker:
                //DownloadToTrakker downloadToTrakker = new DownloadToTrakker();
                //currForm = DesktopSession.HistorySession.Lookup(downloadToTrakker);
                //if (currForm.GetType() == typeof(DownloadToTrakker))
                //{
                //    currForm.Show();
                //}
                //else
                //{
                ShowForm downloadToTrakkerBlk = CommonAppBlocks.Instance.CreateDownloadToTrakkerShowBlock(this.parentForm, this.downloadToTrakkerFormNavAction);
                if (!downloadToTrakkerBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Download to Trakker block");
                }
                //}

                break;

            case InventoryAuditFlowState.UploadFromTrakker:
                //UploadFromTrakker uploadFromTrakker = new UploadFromTrakker();
                //currForm = DesktopSession.HistorySession.Lookup(uploadFromTrakker);
                //if (currForm.GetType() == typeof(DownloadToTrakker))
                //{
                //    currForm.Show();
                //}
                //else
                //{
                ShowForm uploadFromTrakkerBlk = CommonAppBlocks.Instance.CreateUploadFromTrakkerShowBlock(this.parentForm, this.uploadFromTrakkerFormNavAction);
                if (!uploadFromTrakkerBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Upload from Trakker block");
                }
                //}

                break;

            case InventoryAuditFlowState.ProcessMissing:
                //ProcessMissingItems processMissingItems = new ProcessMissingItems();
                //currForm = DesktopSession.HistorySession.Lookup(processMissingItems);
                //if (currForm.GetType() == typeof(ProcessMissingItems))
                //{
                //    currForm.Show();
                //}
                //else
                //{
                ShowForm processMissingItemsBlk = CommonAppBlocks.Instance.CreateProcessMissingItemsShowBlock(this.parentForm, this.processMissingItemsFormNavAction);
                if (!processMissingItemsBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Process Missing Items block");
                }
                //}

                break;

            case InventoryAuditFlowState.ProcessUnexpected:
                //ProcessUnexpectedItems processUnexpectedItems = new ProcessUnexpectedItems();
                //currForm = DesktopSession.HistorySession.Lookup(processUnexpectedItems);
                //if (currForm.GetType() == typeof(ProcessUnexpectedItems))
                //{
                //    currForm.Show();
                //}
                //else
                //{
                ShowForm processUnexpectedItemsBlk = CommonAppBlocks.Instance.CreateProcessUnexpectedItemsShowBlock(this.parentForm, this.processUnexpectedItemsFormNavAction);
                if (!processUnexpectedItemsBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Process Unexpected Items block");
                }
                //}

                break;

            case InventoryAuditFlowState.CountCACC:
                EnterCaccItems enterCaccItems = new EnterCaccItems();
                currForm = DesktopSession.HistorySession.Lookup(enterCaccItems);
                if (currForm.GetType() == typeof(EnterCaccItems))
                {
                    currForm.Show();
                }
                else
                {
                    ShowForm enterCaccItemsBlk = CommonAppBlocks.Instance.CreateEnterCaccItemsShowBlock(this.parentForm, this.enterCaccItemsFormNavAction);
                    if (!enterCaccItemsBlk.execute())
                    {
                        throw new ApplicationException("Cannot execute Enter Cacc Items block");
                    }
                }

                break;

            case InventoryAuditFlowState.AuditResults:
                ClosedAudit closedAudit = new ClosedAudit();
                currForm = DesktopSession.HistorySession.Lookup(closedAudit);
                if (currForm.GetType() == typeof(ClosedAudit))
                {
                    currForm.Show();
                }
                else
                {
                    ShowForm closedAuditBlk = CommonAppBlocks.Instance.CreateClosedAuditShowBlock(this.parentForm, this.closedAuditFormNavAction);
                    if (!closedAuditBlk.execute())
                    {
                        throw new ApplicationException("Cannot execute Closed Audit block");
                    }
                }

                break;

            case InventoryAuditFlowState.ChargeOn:
                ShowForm describeMerchBlk = CommonAppBlocks.Instance.DescribeMerchChargeOnBlock(this.parentForm, this.describeMerchFormAction, DesktopSession);
                if (!describeMerchBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Describe Merchandise Block");
                }
                break;

            case InventoryAuditFlowState.DescribeItem:
                ShowForm describeItemBlk = CommonAppBlocks.Instance.DescribeItemBlock(this.parentForm, this.describeItemFormAction, DesktopSession);
                if (!describeItemBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Describe Item Block");
                }
                break;

            case InventoryAuditFlowState.CancelFlow:
                AuditDesktopSession.Instance.ClearLoggedInUser();
                if (this.endStateNotifier != null)
                {
                    this.endStateNotifier.execute();
                }
                break;

            case InventoryAuditFlowState.ExitFlow:
                AuditDesktopSession.Instance.ClearLoggedInUser();
                break;

            default:
                throw new ApplicationException("Invalid inventory audit flow state");
            }

            return(true);
        }
Beispiel #26
0
        /// <summary>
        /// Main execution function for CustomerHoldFlowExecutor
        /// </summary>
        /// <param name="inputData"></param>
        /// <returns></returns>
        private object executorFxn(object inputData)
        {
            if (inputData == null)
            {
                return(false);
            }
            GunBookEditFlowState inputState = (GunBookEditFlowState)inputData;

            switch (inputState)
            {
            case GunBookEditFlowState.LookupCustomer:
                ShowForm lookupCustBlk = CommonAppBlocks.Instance.CreateLookupCustomerShowBlock(this.parentForm, this.lookupCustFormNavAction);
                if (!lookupCustBlk.execute())
                {
                    throw new ApplicationException("Cannot execute LookupCustomer block");
                }

                break;

            case GunBookEditFlowState.LookupCustomerResults:
                ShowForm lookupCustResBlk = CommonAppBlocks.Instance.CreateLookupCustomerResultsBlock(this.parentForm, this.lookupCustResultsFormNavAction);
                if (!lookupCustResBlk.execute())
                {
                    throw new ApplicationException("Cannot execute LookupCustomerResults block");
                }
                break;

            case GunBookEditFlowState.DescribeMerchandise:

                ShowForm descMdseBlk = CommonAppBlocks.Instance.DescribeMerchandiseGunEditBlock(this.parentForm, this.describeMerchFormAction);
                if (!descMdseBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Describe Merchandise block");
                }

                break;

            case GunBookEditFlowState.DescribeItem:
                ShowForm descItemBlk = CommonAppBlocks.Instance.DescribeItemBlock(this.parentForm, this.describeItemFormAction);
                if (!descItemBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Describe Item block");
                }

                break;

            case GunBookEditFlowState.DescribeItemEdit:
                ShowForm describeItemEditBlk = CommonAppBlocks.Instance.DescribeItemGunEditBlock(this.parentForm, this.describeItemFormAction);
                if (!describeItemEditBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Describe Item PFI Block");
                }
                break;

            case GunBookEditFlowState.GunBookSearch:
                ShowForm gunBookSearchBlk = CommonAppBlocks.Instance.GunBookSearchFormBlock(this.parentForm, this.gunBookSearchFormNavAction);
                if (!gunBookSearchBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Gun Book Edit Search block");
                }
                break;

            case GunBookEditFlowState.EditGunBookRecord:
                ShowForm editGunBookrecordBlk = CommonAppBlocks.Instance.GunBookEditFormBlock(this.parentForm, this.gunBookEditFormNavAction);
                if (!editGunBookrecordBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Gun Book Edit block");
                }
                break;

            case GunBookEditFlowState.CustomerReplace:
                ShowForm custReplaceBlk = CommonAppBlocks.Instance.CustomerReplaceBlock(this.parentForm, this.customerReplaceFormNavAction);
                if (!custReplaceBlk.execute())
                {
                    throw new ApplicationException("Cannot execute customer replace block");
                }
                break;


            case GunBookEditFlowState.Cancel:
                //Clear the customer from session
                CashlinxDesktopSession.Instance.ClearCustomerList();

                if (this.endStateNotifier != null)
                {
                    this.endStateNotifier.execute();
                }
                break;


            default:
                throw new ApplicationException("Invalid Gun Book Edit flow state");
            }

            return(true);
        }
        /// <summary>
        /// Main execution function for CustomerHoldFlowExecutor
        /// </summary>
        /// <param name="inputData"></param>
        /// <returns></returns>
        private object executorFxn(object inputData)
        {
            if (inputData == null)
            {
                return(false);
            }
            CustomerHoldFlowState inputState = (CustomerHoldFlowState)inputData;

            switch (inputState)
            {
            case CustomerHoldFlowState.LookupCustomer:
                ShowForm lookupCustBlk = CommonAppBlocks.Instance.CreateLookupCustomerShowBlock(this.parentForm, this.lookupCustFormNavAction);
                if (!lookupCustBlk.execute())
                {
                    throw new ApplicationException("Cannot execute LookupCustomer block");
                }

                break;

            case CustomerHoldFlowState.LookupCustomerResults:
                ShowForm lookupCustResBlk = CommonAppBlocks.Instance.CreateLookupCustomerResultsBlock(this.parentForm, this.lookupCustResultsFormNavAction);
                if (!lookupCustResBlk.execute())
                {
                    throw new ApplicationException("Cannot execute LookupCustomerResults block");
                }
                break;

            case CustomerHoldFlowState.CustomerHoldList:
                ShowForm custHoldListBlk = CommonAppBlocks.Instance.CreateCustomerHoldListShowBlock(this.parentForm, this.custHoldListFormNavAction);
                if (!custHoldListBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Customer Hold List block");
                }
                break;

            case CustomerHoldFlowState.CustomerHoldInfo:
                ShowForm custHoldInfoBlk = CommonAppBlocks.Instance.CreateCustomerHoldInfoShowBlock(this.parentForm, this.custHoldInfoFormNavAction);
                if (!custHoldInfoBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Customer Hold List block");
                }
                break;


            case CustomerHoldFlowState.Cancel:

                //Clear the customer from session
                GlobalDataAccessor.Instance.DesktopSession.ClearCustomerList();

                if (this.endStateNotifier != null)
                {
                    this.endStateNotifier.execute();
                }
                break;


            default:
                throw new ApplicationException("Invalid Customer Hold flow state");
            }

            return(true);
        }
        /// <summary>
        /// Main execution function for NewPawnLoanFlowExecutor
        /// </summary>
        /// <param name="inputData"></param>
        /// <returns></returns>
        private object executorFxn(object inputData)
        {
            var inputState = NewPawnLoanFlowState.LookupCustomer;

            if (inputData == null && !GlobalDataAccessor.Instance.DesktopSession.HistorySession.Trigger.Equals(Commons.TriggerTypes.DESCRIBEMERCHANDISE))
            {
                if (GlobalDataAccessor.Instance.DesktopSession.TabStateClicked != FlowTabController.State.None)
                {
                    inputState = NewPawnLoanFlowState.InvokePawnCustInformationFlow;
                }
                else if (GlobalDataAccessor.Instance.DesktopSession.ActiveCustomer != null && !string.IsNullOrEmpty(GlobalDataAccessor.Instance.DesktopSession.ActiveCustomer.CustomerNumber) &&
                         GlobalDataAccessor.Instance.DesktopSession.TabStateClicked == FlowTabController.State.None)
                {
                    IsGunMerchandiseLookedUp lookupGunMdseFxn = CommonAppBlocks.Instance.IsGunMerchandiseLookedUpBlock;
                    lookupGunMdseFxn.execute();
                    inputState = lookupGunMdseFxn.Value ? NewPawnLoanFlowState.ManagePawnApplication : NewPawnLoanFlowState.InvokeMMPIChildFlow;
                }
            }
            else if (inputData != null)
            {
                inputState = (NewPawnLoanFlowState)inputData;
                if (GlobalDataAccessor.Instance.DesktopSession.ActiveCustomer != null && !string.IsNullOrEmpty(GlobalDataAccessor.Instance.DesktopSession.ActiveCustomer.CustomerNumber) &&
                    GlobalDataAccessor.Instance.DesktopSession.TabStateClicked == FlowTabController.State.None && GlobalDataAccessor.Instance.DesktopSession.StartNewPawnLoan)
                {
                    inputState = NewPawnLoanFlowState.InvokeMMPIChildFlow;
                }
            }
            //If the trigger is describe merchandise for a new pawn loan invoke mmpi flow
            if (GlobalDataAccessor.Instance.DesktopSession.HistorySession.Trigger.Equals(Commons.TriggerTypes.DESCRIBEMERCHANDISE))
            {
                if (inputState == NewPawnLoanFlowState.LookupCustomer)
                {
                    //If merchandise is already looked up then we are looking to lookup customer
                    IsLoanMerchandiseLookedUp lookupMdseFxn = CommonAppBlocks.Instance.IsLoanMerchandiseLookedUpBlock;
                    lookupMdseFxn.execute();
                    //Check if tab state is null..if it is not null then pawncustinfo flow should be invoked
                    if (GlobalDataAccessor.Instance.DesktopSession.TabStateClicked != FlowTabController.State.None)
                    {
                        inputState = NewPawnLoanFlowState.InvokePawnCustInformationFlow;
                    }
                    else if (lookupMdseFxn.Value && (GlobalDataAccessor.Instance.DesktopSession.ActiveCustomer == null || string.IsNullOrEmpty(GlobalDataAccessor.Instance.DesktopSession.ActiveCustomer.CustomerNumber)))
                    {
                        inputState = NewPawnLoanFlowState.LookupCustomer;
                    }
                    else
                    {
                        IsGunMerchandiseLookedUp lookupGunMdseFxn = CommonAppBlocks.Instance.IsGunMerchandiseLookedUpBlock;
                        lookupGunMdseFxn.execute();
                        if (lookupGunMdseFxn.Value)
                        {
                            inputState = NewPawnLoanFlowState.ManagePawnApplication;
                        }
                        else
                        {
                            inputState = NewPawnLoanFlowState.InvokeMMPIChildFlow;
                        }
                    }
                }
            }
            else
            {
                //If the customer is already looked up go straight to manage pawn application
                IsCustomerLookedUp lookupFxn = CommonAppBlocks.Instance.IsCustomerLookedUpBlock;
                lookupFxn.execute();

                if (lookupFxn.Value == true && inputState == NewPawnLoanFlowState.LookupCustomer)
                {
                    inputState = NewPawnLoanFlowState.ManagePawnApplication;
                }
            }

            switch (inputState)
            {
            case NewPawnLoanFlowState.LookupCustomer:

                ShowForm lookupCustBlk = CommonAppBlocks.Instance.CreateLookupCustomerShowBlock(this.parentForm, this.lookupCustFormNavAction);
                if (!lookupCustBlk.execute())
                {
                    throw new ApplicationException("Cannot execute LookupCustomer block");
                }

                break;

            case NewPawnLoanFlowState.LookupCustomerResults:
                ShowForm lookupCustResBlk = CommonAppBlocks.Instance.CreateLookupCustomerResultsBlock(this.parentForm, this.lookupCustResultsFormNavAction);
                if (!lookupCustResBlk.execute())
                {
                    throw new ApplicationException("Cannot execute LookupCustomerResults block");
                }
                break;

            case NewPawnLoanFlowState.AddCustomer:
                if (GlobalDataAccessor.Instance.DesktopSession.HistorySession.Trigger.Equals(Commons.TriggerTypes.NEWPAWNLOAN, StringComparison.OrdinalIgnoreCase))
                {
                    ShowForm manageCustBlk = CommonAppBlocks.Instance.CreateManagePawnApplicationBlock(this.parentForm, this.managePawnAppFormNavAction);
                    if (!manageCustBlk.execute())
                    {
                        throw new ApplicationException("Cannot execute Manage Pawn Application block");
                    }
                }
                else
                {
                    ShowForm createCustBlk = CommonAppBlocks.Instance.CreateCreateCustomerBlock(this.parentForm, this.createCustomerFormNavAction);
                    if (!createCustBlk.execute())
                    {
                        throw new ApplicationException("Cannot execute CreateCustomer block");
                    }
                }
                break;

            case NewPawnLoanFlowState.ExistingCustomer:
                ShowForm existCustBlk = CommonAppBlocks.Instance.CreateExistingCustomerBlock(this.parentForm, this.existCustomerFormNavAction);
                if (!existCustBlk.execute())
                {
                    throw new ApplicationException("Cannot execute ExistingCustomer block");
                }
                break;

            case NewPawnLoanFlowState.ManagePawnApplication:
                ShowForm managePawnAppBlk = CommonAppBlocks.Instance.CreateManagePawnApplicationBlock(this.parentForm, this.managePawnAppFormNavAction);
                if (!managePawnAppBlk.execute())
                {
                    throw new ApplicationException("Cannot execute ManagePawnApplication block");
                }
                break;

            case NewPawnLoanFlowState.ViewCustomerInformation:
                ShowForm viewCustInfoBlk = CommonAppBlocks.Instance.ViewCustomerInfoShowBlock(this.parentForm, this.viewCustInfoFormNavAction);
                if (!viewCustInfoBlk.execute())
                {
                    throw new ApplicationException("Cannot execute View Customer Information block");
                }

                break;

            case NewPawnLoanFlowState.ViewReadOnlyCustomerInformation:
                ShowForm viewCustInfoReadOnlyBlk = CommonAppBlocks.Instance.ViewCustomerInfoShowBlock(this.parentForm, this.viewCustInfoFormNavAction);
                if (!viewCustInfoReadOnlyBlk.execute())
                {
                    throw new ApplicationException("Cannot execute View customer information Read Only block");
                }
                ((ViewCustomerInformation)viewCustInfoReadOnlyBlk.ClassForm).ShowReadOnly = true;
                break;

            case NewPawnLoanFlowState.InvokeMMPIChildFlow:
                //Initiate the child workflow
                if (GlobalDataAccessor.Instance.DesktopSession.PawnLoans.Count == 0)
                {
                    GlobalDataAccessor.Instance.DesktopSession.PawnLoans.Add(new PawnLoan());
                }
                GlobalDataAccessor.Instance.DesktopSession.AppController.invokeWorkflow(MMPIFUNCTIONALITYNAME,
                                                                                        this.parentForm, this.endStateNotifier, this);
                break;

            case NewPawnLoanFlowState.InvokePawnCustInformationFlow:

                GlobalDataAccessor.Instance.DesktopSession.AppController.invokeWorkflow(PAWNCUSTINFOFLOW,
                                                                                        this.parentForm, this.endStateNotifier, this);
                break;

            case NewPawnLoanFlowState.CancelFlow:
                CommonAppBlocks.Instance.HideFlowTabController();
                if (this.endStateNotifier != null)
                {
                    this.endStateNotifier.execute();
                }
                break;

            case NewPawnLoanFlowState.ExitFlow:
                break;

            default:
                throw new ApplicationException("Invalid new pawn loan flow state");
            }

            return(true);
        }
        /// <summary>
        /// Main execution function for SaleFlowExecutor
        /// </summary>
        /// <param name="inputData"></param>
        /// <returns></returns>
        private object executorFxn(object inputData)
        {
            if (inputData == null)
            {
                inputData = suspendedState;
            }
            SaleFlowState inputState = (SaleFlowState)inputData;

            switch (inputState)
            {
            case SaleFlowState.ItemSearch:
                if (GlobalDataAccessor.Instance.DesktopSession.ActiveRetail == null)
                {
                    GlobalDataAccessor.Instance.DesktopSession.Sales.Add(new SaleVO());
                    GlobalDataAccessor.Instance.DesktopSession.DescribeItemPawnItemIndex = -1;
                }
                //ItemSearch itemSearchFrm = new ItemSearch();
                if (GlobalDataAccessor.Instance.DesktopSession.HistorySession.HasFormName("ItemSearch"))
                {
                    GlobalDataAccessor.Instance.DesktopSession.HistorySession.VisibleForm("ItemSearch");
                }
                else
                {
                    ShowForm itemSearchBlk = CommonAppBlocks.Instance.CreateItemSearchShowBlock(this.parentForm, this.itemSearchFormNavAction);
                    if (!itemSearchBlk.execute())
                    {
                        throw new ApplicationException("Cannot execute Item Search block");
                    }
                }

                break;

            case SaleFlowState.DescribeMerchandise:
                ShowForm describeMerchBlk = CommonAppBlocks.Instance.DescribeMerchandiseBlock(this.parentForm, this.describeMerchFormAction);
                if (!describeMerchBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Describe Merchandise block");
                }

                break;

            case SaleFlowState.DescribeItem:
                ShowForm describeItemBlk = CommonAppBlocks.Instance.DescribeItemBlock(this.parentForm, this.describeItemFormAction);
                if (!describeItemBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Describe Item Block");
                }
                break;

            case SaleFlowState.LookupCustomer:

                ShowForm lookupCustBlk = CommonAppBlocks.Instance.CreateLookupCustomerShowBlock(this.parentForm, this.lookupCustFormNavAction);
                if (!lookupCustBlk.execute())
                {
                    throw new ApplicationException("Cannot execute LookupCustomer block");
                }

                break;

            case SaleFlowState.LookupCustomerResults:
                ShowForm lookupCustResBlk = CommonAppBlocks.Instance.CreateLookupCustomerResultsBlock(this.parentForm, this.lookupCustResultsFormNavAction);
                if (!lookupCustResBlk.execute())
                {
                    throw new ApplicationException("Cannot execute LookupCustomerResults block");
                }
                break;

            case SaleFlowState.LookupVendorResults:
                ShowForm lookupVendResBlk = CommonAppBlocks.Instance.CreateLookupVendorResultsBlock(this.parentForm, this.lookupVendResultsFormNavAction);
                if (!lookupVendResBlk.execute())
                {
                    throw new ApplicationException("Cannot execute LookupVendorResults block");
                }
                break;

            case SaleFlowState.AddCustomer:
                if (GlobalDataAccessor.Instance.DesktopSession.HistorySession.Trigger.Equals(Commons.TriggerTypes.NEWPAWNLOAN, StringComparison.OrdinalIgnoreCase))
                {
                    ShowForm manageCustBlk = CommonAppBlocks.Instance.CreateManagePawnApplicationBlock(this.parentForm, this.managePawnAppFormNavAction);
                    if (!manageCustBlk.execute())
                    {
                        throw new ApplicationException("Cannot execute Manage Pawn Application block");
                    }
                }
                else
                {
                    ShowForm createCustBlk = CommonAppBlocks.Instance.CreateCreateCustomerBlock(this.parentForm, this.createCustomerFormNavAction);
                    if (!createCustBlk.execute())
                    {
                        throw new ApplicationException("Cannot execute CreateCustomer block");
                    }
                }
                break;

            case SaleFlowState.AddVendor:

                ShowForm createVendBlk = CommonAppBlocks.Instance.CreateCreateVendorBlock(this.parentForm, this.createVendFormNavAction);
                if (!createVendBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Create Vendor block");
                }
                break;

            case SaleFlowState.ExistingCustomer:
                ShowForm existCustBlk = CommonAppBlocks.Instance.CreateExistingCustomerBlock(this.parentForm, this.existCustomerFormNavAction);
                if (!existCustBlk.execute())
                {
                    throw new ApplicationException("Cannot execute ExistingCustomer block");
                }
                break;

            case SaleFlowState.ManagePawnApplication:
                ShowForm managePawnAppBlk = CommonAppBlocks.Instance.CreateManagePawnApplicationBlock(this.parentForm, this.managePawnAppFormNavAction);
                if (!managePawnAppBlk.execute())
                {
                    throw new ApplicationException("Cannot execute ManagePawnApplication block");
                }
                break;

            case SaleFlowState.ViewCustomerInformation:
                ShowForm viewCustInfoBlk = CommonAppBlocks.Instance.ViewCustomerInfoShowBlock(this.parentForm, this.viewCustInfoFormNavAction);
                if (!viewCustInfoBlk.execute())
                {
                    throw new ApplicationException("Cannot execute View Customer Information block");
                }

                break;

            case SaleFlowState.ViewReadOnlyCustomerInformation:
                ShowForm viewCustInfoReadOnlyBlk = CommonAppBlocks.Instance.ViewCustomerInfoShowBlock(this.parentForm, this.viewCustInfoFormNavAction);
                if (!viewCustInfoReadOnlyBlk.execute())
                {
                    throw new ApplicationException("Cannot execute View customer information Read Only block");
                }
                ((ViewCustomerInformation)viewCustInfoReadOnlyBlk.ClassForm).ShowReadOnly = true;
                break;

            case SaleFlowState.TenderIn:
                if (this.tenderInComplete)
                {
                    GlobalDataAccessor.Instance.DesktopSession.HistorySession.Desktop();
                    if (GlobalDataAccessor.Instance.DesktopSession.ActiveRetail.LoanStatus == ProductStatus.LAY)
                    {
                        GlobalDataAccessor.Instance.DesktopSession.showProcessTender(ProcessTenderProcedures.ProcessTenderMode.LAYAWAY);
                    }
                    else
                    {
                        ProcessTenderController pCntrl = ProcessTenderController.Instance;
                        //Perform the process tender process
                        bool success = pCntrl.ExecuteProcessTender(ProcessTenderProcedures.ProcessTenderMode.RETAILSALE);
                        if (success)
                        {
                            ReceiptConfirmation rcptConf = new ReceiptConfirmation();
                            rcptConf.ShowDialog();
                        }
                        else
                        {
                            goto case SaleFlowState.CancelFlow;
                        }
                    }

                    goto case SaleFlowState.CancelFlow;
                }
                else
                {
                    if (GlobalDataAccessor.Instance.DesktopSession.HistorySession.Lookup("TenderIn"))
                    {
                        GlobalDataAccessor.Instance.DesktopSession.HistorySession.VisibleForm("TenderIn");
                    }
                    else
                    {
                        ShowForm tenderInBlk = CommonAppBlocks.Instance.TenderInShowBlock(this.parentForm, this.TenderInFormAction);
                        if (!tenderInBlk.execute())
                        {
                            throw new ApplicationException("Cannot execute Tender In block");
                        }
                    }
                }

                break;

            case SaleFlowState.CancelFlow:
                GlobalDataAccessor.Instance.DesktopSession.ClearCustomerList();
                GlobalDataAccessor.Instance.DesktopSession.ClearLoggedInUser();
                GlobalDataAccessor.Instance.DesktopSession.ClearSessionData();
                if (this.endStateNotifier != null)
                {
                    this.endStateNotifier.execute();
                }
                break;

            case SaleFlowState.ExitFlow:
                break;

            default:
                throw new ApplicationException("Invalid sale flow state");
            }

            return(true);
        }
Beispiel #30
0
        /// <summary>
        /// Main execution function for NewPawnLoanFlowExecutor
        /// </summary>
        /// <param name="inputData"></param>
        /// <returns></returns>
        private object executorFxn(object inputData)
        {
            if (inputData == null)
            {
                return(false);
            }
            MMPIFlowState inputState = (MMPIFlowState)inputData;

            if (parentFlow != null)
            {
                parentFlowName = parentFlow.Name;
            }
            if (inputState == MMPIFlowState.DescribeItem)
            {
                //check if activepawnloan is null or activepurchase is null
                if (parentFlowName.Equals("CustomerPurchaseFlowExecutor", StringComparison.OrdinalIgnoreCase))
                {
                    IsBuyMerchandiseLookedUp lookupFxn = CommonAppBlocks.Instance.IsBuyMerchandiseLookedUpBlock;
                    lookupFxn.execute();

                    //check if customer is looked up
                    IsCustomerLookedUp lookupCustFxn = CommonAppBlocks.Instance.IsCustomerLookedUpBlock;
                    lookupCustFxn.execute();

                    if (lookupFxn.Value == false)
                    {
                        inputState = MMPIFlowState.DescribeMerchandise;
                    }
                    //both merchandise and customer looked up and its describe item flow in customer purchase
                    else if (lookupFxn.Value && lookupCustFxn.Value &&
                             GlobalDataAccessor.Instance.DesktopSession.HistorySession.Trigger.Equals(Commons.TriggerTypes.DESCRIBEITEMCUSTOMERPURCHASE, StringComparison.OrdinalIgnoreCase) &&
                             GlobalDataAccessor.Instance.DesktopSession.DescribeItemContext != CurrentContext.EDIT_MMP)
                    {
                        if (GlobalDataAccessor.Instance.DesktopSession.DescribeItemContext == CurrentContext.NEW &&
                            (GlobalDataAccessor.Instance.DesktopSession.DescribeItemPawnItemIndex >= 0 || GlobalDataAccessor.Instance.DesktopSession.ActivePurchase.ProductDataComplete))
                        {
                            List <Item> items = GlobalDataAccessor.Instance.DesktopSession.ActivePurchase.Items;
                            if (!(string.IsNullOrEmpty(items[items.Count - 1].TicketDescription)))
                            {
                                inputState = MMPIFlowState.ManageMultiplePawnItems;
                            }
                        }
                    }
                }
                else if (parentFlowName.Equals("VendorPurchaseFlowExecutor", StringComparison.OrdinalIgnoreCase))
                {
                    IsBuyMerchandiseLookedUp lookupFxn = CommonAppBlocks.Instance.IsBuyMerchandiseLookedUpBlock;
                    lookupFxn.execute();

                    if (lookupFxn.Value == false)
                    {
                        inputState = MMPIFlowState.DescribeMerchandise;
                    }
                    else if (!string.IsNullOrEmpty(CashlinxDesktopSession.Instance.ActivePurchase.PurchaseOrderNumber))
                    {
                        inputState = MMPIFlowState.ManageMultiplePawnItems;
                    }
                }
                else if (parentFlowName.Equals("NewPawnLoanFlowExecutor", StringComparison.OrdinalIgnoreCase) ||
                         GlobalDataAccessor.Instance.DesktopSession.HistorySession.Trigger.Equals(Commons.TriggerTypes.DESCRIBEMERCHANDISE, StringComparison.OrdinalIgnoreCase))
                {
                    IsLoanMerchandiseLookedUp lookupFxn = CommonAppBlocks.Instance.IsLoanMerchandiseLookedUpBlock;
                    lookupFxn.execute();

                    if (lookupFxn.Value == false)
                    {
                        inputState = MMPIFlowState.DescribeMerchandise;
                    }
                    else if (GlobalDataAccessor.Instance.DesktopSession.ActivePawnLoan.Items[0].mStore == 0)
                    {
                        GlobalDataAccessor.Instance.DesktopSession.DescribeItemPawnItemIndex = 0;
                        inputState = MMPIFlowState.DescribeItem;
                    }
                    else
                    {
                        //check if customer is looked up
                        IsCustomerLookedUp lookupCustFxn = CommonAppBlocks.Instance.IsCustomerLookedUpBlock;
                        lookupCustFxn.execute();

                        if (lookupFxn.Value && lookupCustFxn.Value &&
                            GlobalDataAccessor.Instance.DesktopSession.DescribeItemContext != CurrentContext.EDIT_MMP)
                        {
                            if (GlobalDataAccessor.Instance.DesktopSession.DescribeItemContext == CurrentContext.NEW && GlobalDataAccessor.Instance.DesktopSession.DescribeItemPawnItemIndex == -1 || GlobalDataAccessor.Instance.DesktopSession.ActivePawnLoan.ProductDataComplete)
                            {
                                List <Item> items = GlobalDataAccessor.Instance.DesktopSession.ActivePawnLoan.Items;
                                if (!(string.IsNullOrEmpty(items[items.Count - 1].TicketDescription)))
                                {
                                    inputState = MMPIFlowState.ManageMultiplePawnItems;
                                }
                            }
                            else if (GlobalDataAccessor.Instance.DesktopSession.DescribeItemContext == CurrentContext.NEW &&
                                     (GlobalDataAccessor.Instance.DesktopSession.DescribeItemPawnItemIndex >= 0))
                            {
                                inputState = MMPIFlowState.DescribeItem;
                            }
                        }
                    }
                }
                else
                {
                    if (GlobalDataAccessor.Instance.DesktopSession.ActivePawnLoan == null ||
                        GlobalDataAccessor.Instance.DesktopSession.ActivePawnLoan.Items == null ||
                        GlobalDataAccessor.Instance.DesktopSession.ActivePawnLoan.Items.Count == 0)
                    {
                        inputState = MMPIFlowState.DescribeMerchandise;
                    }
                }
            }


            switch (inputState)
            {
            case MMPIFlowState.DescribeMerchandise:
                ShowForm describeMerchBlk = CommonAppBlocks.Instance.DescribeMerchandiseBlock(this.parentForm, this.describeMerchFormAction);
                if (!describeMerchBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Describe Merchandise block");
                }

                if (!(parentFlowName.Equals("CustomerPurchaseFlowExecutor", StringComparison.OrdinalIgnoreCase)) &&
                    !(parentFlowName.Equals("VendorPurchaseFlowExecutor", StringComparison.OrdinalIgnoreCase)) &&
                    (GlobalDataAccessor.Instance.DesktopSession.ActiveCustomer != null && !String.IsNullOrEmpty(GlobalDataAccessor.Instance.DesktopSession.ActiveCustomer.CustomerNumber)))
                {
                    SetTabsInForm(describeMerchBlk);
                }
                break;

            case MMPIFlowState.DescribeItem:
                ShowForm describeItemBlk = CommonAppBlocks.Instance.DescribeItemBlock(this.parentForm, this.describeItemFormAction);
                if (!describeItemBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Describe Item Block");
                }
                //show tabs only if its not new pawn loan flow that called this child flow
                if (!(parentFlowName.Equals("CustomerPurchaseFlowExecutor", StringComparison.OrdinalIgnoreCase)) &&
                    !(parentFlowName.Equals("VendorPurchaseFlowExecutor", StringComparison.OrdinalIgnoreCase)) &&
                    (GlobalDataAccessor.Instance.DesktopSession.ActiveCustomer != null && !String.IsNullOrEmpty(GlobalDataAccessor.Instance.DesktopSession.ActiveCustomer.CustomerNumber)))
                {
                    //Check if Manage multiple pawn items form is still there
                    //If it is, no need to show the tabs
                    if (!(GlobalDataAccessor.Instance.DesktopSession.HistorySession.Lookup("ManageMultiplePawnItems")))
                    {
                        SetTabsInForm(describeItemBlk);
                    }
                }
                break;

            case MMPIFlowState.ManageMultiplePawnItems:
                if (GlobalDataAccessor.Instance.DesktopSession.HistorySession.Lookup("ManageMultiplePawnItems"))
                {
                    //Remove the MMPI form and reload
                    GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back();
                }

                ShowForm mmpiBlk = CommonAppBlocks.Instance.ManageMultiplePawnItemsBlock(this.parentForm, this.multiplePawnItemsFormAction);
                if (!mmpiBlk.execute())
                {
                    throw new ApplicationException("Cannot execute Manage Multiple Pawn Items Block");
                }
                if (!(parentFlowName.Equals("CustomerPurchaseFlowExecutor", StringComparison.OrdinalIgnoreCase)) &&
                    !(parentFlowName.Equals("VendorPurchaseFlowExecutor", StringComparison.OrdinalIgnoreCase)) &&
                    (GlobalDataAccessor.Instance.DesktopSession.ActiveCustomer != null && !String.IsNullOrEmpty(GlobalDataAccessor.Instance.DesktopSession.ActiveCustomer.CustomerNumber)))
                {
                    SetTabsInForm(mmpiBlk);
                }
                break;

            case MMPIFlowState.CancelFlow:
                CommonAppBlocks.Instance.HideFlowTabController();
                if (this.endStateNotifier != null)
                {
                    this.endStateNotifier.execute();
                }
                break;

            case MMPIFlowState.ExitFlowToItemHistory:
                if (parentFlow != null)
                {
                    GlobalDataAccessor.Instance.DesktopSession.TabStateClicked = FlowTabController.State.ItemHistory;
                    this.parentFlow.execute();
                }
                break;

            case MMPIFlowState.ExitFlowToProductHistory:
                if (parentFlow != null)
                {
                    GlobalDataAccessor.Instance.DesktopSession.TabStateClicked = FlowTabController.State.ProductHistory;
                    this.parentFlow.execute();
                }
                break;

            case MMPIFlowState.ExitFlowToViewCustomer:
                if (parentFlow != null)
                {
                    GlobalDataAccessor.Instance.DesktopSession.TabStateClicked = FlowTabController.State.Customer;
                    this.parentFlow.execute();
                }
                break;

            case MMPIFlowState.ExitFlowToLookupCustomer:
                GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back();
                if (parentFlow != null)
                {
                    this.parentFlow.execute();
                }

                break;

            case MMPIFlowState.ExitFlowToVendor:
                CashlinxDesktopSession.Instance.HistorySession.Back();
                if (parentFlow != null)
                {
                    this.parentFlow.execute();
                }
                break;

            case MMPIFlowState.ExitFlowToStats:
                if (parentFlow != null)
                {
                    GlobalDataAccessor.Instance.DesktopSession.TabStateClicked = FlowTabController.State.Stats;
                    this.parentFlow.execute();
                }
                break;

            default:
                throw new ApplicationException("Invalid MMPI flow state");
            }

            return(true);
        }