private void itemSearchFormNavAction(object sender, object data) { NavBox itemSearchNavBox = (NavBox)sender; ChangeRetailPriceSearch itemSearchForm = (ChangeRetailPriceSearch)data; NavBox.NavAction action = itemSearchNavBox.Action; if (action == NavBox.NavAction.BACKANDSUBMIT) { GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back(); action = NavBox.NavAction.SUBMIT; } switch (action) { case NavBox.NavAction.SUBMIT: //Default happy path next state this.parentForm = itemSearchForm; this.nextState = ChangeRetailPriceFlowState.DescribeItem; break; case NavBox.NavAction.CANCEL: this.nextState = ChangeRetailPriceFlowState.CancelFlow; break; default: throw new ApplicationException("" + action.ToString() + " is not a valid state for ItemSearch"); } 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; NavBox.NavAction action = managePawnAppNavBox.Action; if (action == NavBox.NavAction.BACKANDSUBMIT) { CashlinxDesktopSession.Instance.HistorySession.Back(); action = NavBox.NavAction.SUBMIT; } switch (action) { case NavBox.NavAction.SUBMIT: this.nextState = PurchaseReturnFlowState.FinalGunSubmit; break; case NavBox.NavAction.CANCEL: case NavBox.NavAction.BACK: this.nextState = PurchaseReturnFlowState.CancelFlow; break; default: throw new ApplicationException("" + action.ToString() + " is not a valid state for ManagePawnApplication"); } this.executeNextState(); }
/// <summary> /// Navigation actions for layaway refund form /// </summary> /// <param name="sender"></param> /// <param name="data"></param> private void layRefundFormNavAction(object sender, object data) { if (sender == null || data == null) { throw new ApplicationException("Layaway Refund Form navigation action handler received invalid data"); } NavBox navBox = (NavBox)sender; NavBox.NavAction action = navBox.Action; if (action == NavBox.NavAction.BACKANDSUBMIT) { GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back(); action = NavBox.NavAction.SUBMIT; } switch (action) { case NavBox.NavAction.SUBMIT: string custDet = navBox.CustomDetail; if (custDet.Equals("Tender", StringComparison.OrdinalIgnoreCase)) { this.nextState = LayawayReturnFlowState.TenderOut; } break; case NavBox.NavAction.CANCEL: this.nextState = LayawayReturnFlowState.CancelFlow; break; } this.executeNextState(); }
/// <summary> /// NavBox OnAction Handler for Add Employee Form /// </summary> /// <param name="sender"></param> /// <param name="data"></param> private void addEmployeeFormNavAction(object sender, object data) { if (sender == null || data == null) { throw new ApplicationException("Add Employee form navigation action handler received invalid data"); } NavBox addEmployeeNavBox = (NavBox)sender; NavBox.NavAction action = addEmployeeNavBox.Action; if (action == NavBox.NavAction.BACKANDSUBMIT) { GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back(); action = NavBox.NavAction.SUBMIT; } switch (action) { case NavBox.NavAction.SUBMIT: this.nextState = SecurityFlowState.SelectEmployee; break; case NavBox.NavAction.CANCEL: this.nextState = SecurityFlowState.Cancel; break; default: throw new ApplicationException("" + action.ToString() + " is not a valid state for Add Employee Form"); } this.executeNextState(); }
private void gunBookUtilityFormNavAction(object sender, object data) { if (sender == null || data == null) { throw new ApplicationException("Gun Book Utility navigation action handler received invalid data"); } NavBox gunBookUtiltiyNavBox = (NavBox)sender; GunBookPrintOptions gunBookPrintOptions = (GunBookPrintOptions)data; NavBox.NavAction gunBookAction = gunBookUtiltiyNavBox.Action; if (gunBookAction == NavBox.NavAction.BACKANDSUBMIT) { GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back(); gunBookAction = NavBox.NavAction.SUBMIT; } switch (gunBookAction) { case NavBox.NavAction.SUBMIT: this.nextState = GunBookUtilityFlowFlowState.PRINT; break; case NavBox.NavAction.CANCEL: this.nextState = GunBookUtilityFlowFlowState.CANCEL; break; default: throw new ApplicationException("" + gunBookAction.ToString() + " is not a valid state for LookupCustomer"); } this.executeNextState(); }
private void selectTransferMethodFormAction(object sender, object data) { NavBox selectTransferMethodNavBox = (NavBox)sender; NavBox.NavAction action = selectTransferMethodNavBox.Action; if (action == NavBox.NavAction.BACKANDSUBMIT) { GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back(); action = NavBox.NavAction.SUBMIT; } switch (action) { case NavBox.NavAction.SUBMIT: //Default happy path next state this.nextState = TransferInFlowState.SelectItems; break; case NavBox.NavAction.CANCEL: this.nextState = TransferInFlowState.CancelFlow; break; default: throw new ApplicationException("" + action + " is not a valid state for SelectTransferInMethod"); } this.executeNextState(); }
private void transferRejectCommentFormAction(object sender, object data) { NavBox transferRejectCommentNavBox = (NavBox)sender; NavBox.NavAction action = transferRejectCommentNavBox.Action; if (action == NavBox.NavAction.BACKANDSUBMIT) { GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back(); action = NavBox.NavAction.SUBMIT; } var dSession = GlobalDataAccessor.Instance.DesktopSession; switch (action) { case NavBox.NavAction.SUBMIT: //Default happy path next state string errorCode, errorText; bool retValue = TransferProcedures.RejectTransfer(dSession, dSession.ActiveTransferIn, out errorCode, out errorText); if (!retValue) { MessageBox.Show("An error occured while rejecting the transfer."); } this.nextState = TransferInFlowState.ManageTransfer; break; case NavBox.NavAction.CANCEL: this.nextState = TransferInFlowState.CancelFlow; break; default: throw new ApplicationException(string.Format("{0} is not a valid state for SelectTransferInItems", action.ToString())); } this.executeNextState(); }
/// <summary> /// Action class for LookupCustomerResults /// </summary> /// <param name="sender"></param> /// <param name="data"></param> private void lookupCustResultsFormNavAction(object sender, object data) { if (sender == null || data == null) { throw new ApplicationException("Lookup customer form navigation action handler received invalid data"); } NavBox lookupCustResNavBox = (NavBox)sender; LookupCustomerResults lookupCustResForm = (LookupCustomerResults)data; NavBox.NavAction action = lookupCustResNavBox.Action; if (action == NavBox.NavAction.BACKANDSUBMIT) { GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back(); action = NavBox.NavAction.SUBMIT; } switch (action) { case NavBox.NavAction.SUBMIT: if (lookupCustResNavBox.IsCustom) { string custDet = lookupCustResNavBox.CustomDetail; //Look for add customer if (custDet.Equals("CreateCustomer") || custDet.Equals("ManagePawnApplication")) { this.nextState = LookupCustomerFlowState.AddCustomer; } else if (custDet.Equals("Complete")) { GlobalDataAccessor.Instance.DesktopSession.TabStateClicked = FlowTabController.State.None; this.nextState = LookupCustomerFlowState.PawnCustInformation; } else if (custDet.Equals("ViewCustomerInformationReadOnly")) { this.nextState = LookupCustomerFlowState.ViewPawnCustomerInfoReadOnly; } } else { this.nextState = LookupCustomerFlowState.ViewPawnCustomerInfo; LoadCustomerLoanKeys loanKeysBlk = new LoadCustomerLoanKeys(); loanKeysBlk.execute(); } break; case NavBox.NavAction.BACK: GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back(); this.nextState = LookupCustomerFlowState.LookupCustomer; break; case NavBox.NavAction.CANCEL: this.nextState = LookupCustomerFlowState.Cancel; break; default: throw new ApplicationException("" + action.ToString() + " is not a valid state for LookupCustomerResults"); } this.executeNextState(); }
/// <summary> /// NavBox OnAction Handler for Lookup Customer /// </summary> /// <param name="sender"></param> /// <param name="data"></param> private void lookupCustFormNavAction(object sender, object data) { if (sender == null || data == null) { throw new ApplicationException("Lookup customer form navigation action handler received invalid data"); } NavBox lookupCustNavBox = (NavBox)sender; LookupCustomer lookupCustForm = (LookupCustomer)data; NavBox.NavAction lookupAction = lookupCustNavBox.Action; if (lookupAction == NavBox.NavAction.BACKANDSUBMIT) { GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back(); lookupAction = NavBox.NavAction.SUBMIT; } switch (lookupAction) { case NavBox.NavAction.SUBMIT: if (lookupCustNavBox.IsCustom) { string custDet = lookupCustNavBox.CustomDetail; //Look for add customer if (custDet.Equals("AddCustomer") || custDet.Equals("CreateCustomer")) { //Execute add customer this.nextState = NewPawnLoanFlowState.ManagePawnApplication; } else if (custDet.Equals("ExistingCustomer")) { this.nextState = NewPawnLoanFlowState.ExistingCustomer; } else if (custDet.Equals("LookupCustomerResults")) { this.nextState = NewPawnLoanFlowState.LookupCustomerResults; } else if (custDet.Equals("ManagePawnApplication")) { this.nextState = NewPawnLoanFlowState.ManagePawnApplication; } } else { //Default happy path next state this.parentForm = lookupCustForm; this.nextState = NewPawnLoanFlowState.LookupCustomerResults; } break; case NavBox.NavAction.CANCEL: this.nextState = NewPawnLoanFlowState.CancelFlow; break; default: throw new ApplicationException("" + lookupAction.ToString() + " is not a valid state for LookupCustomer"); } this.executeNextState(); }
/// <summary> /// NavBox OnAction Handler for Police Holds List Form /// </summary> /// <param name="sender"></param> /// <param name="data"></param> private void gunBookSearchFormNavAction(object sender, object data) { if (sender == null || data == null) { throw new ApplicationException("Gun Book Search form navigation action handler received invalid data"); } NavBox gunBookSearchNavBox = (NavBox)sender; NavBox.NavAction lookupAction = gunBookSearchNavBox.Action; if (lookupAction == NavBox.NavAction.BACKANDSUBMIT) { CashlinxDesktopSession.Instance.HistorySession.Back(); lookupAction = NavBox.NavAction.SUBMIT; } switch (lookupAction) { case NavBox.NavAction.SUBMIT: this.nextState = GunBookEditFlowState.EditGunBookRecord; break; case NavBox.NavAction.CANCEL: this.nextState = GunBookEditFlowState.Cancel; break; default: throw new ApplicationException("" + lookupAction.ToString() + " is not a valid state for Gun book search"); } this.executeNextState(); }
/// <summary> /// NavBox OnAction Handler for View Receipt /// </summary> /// <param name="sender"></param> /// <param name="data"></param> private void viewReceiptFormNavAction(object sender, object data) { if (sender == null || data == null) { throw new ApplicationException("Lookup receipt form navigation action handler received invalid data"); } NavBox viewReceiptNavBox = (NavBox)sender; ViewReceipt viewReceiptForm = (ViewReceipt)data; NavBox.NavAction viewAction = viewReceiptNavBox.Action; switch (viewAction) { case NavBox.NavAction.CANCEL: this.nextState = LookupReceiptFlowState.ExitFlow; break; case NavBox.NavAction.SUBMIT: this.nextState = LookupReceiptFlowState.ExitFlow; break; } this.executeNextState(); }
private void closedAuditFormNavAction(object sender, object data) { NavBox closedAuditNavBox = (NavBox)sender; ClosedAudit closedAuditForm = (ClosedAudit)data; NavBox.NavAction action = closedAuditNavBox.Action; if (action == NavBox.NavAction.BACKANDSUBMIT) { DesktopSession.HistorySession.Back(); action = NavBox.NavAction.SUBMIT; } switch (action) { case NavBox.NavAction.SUBMIT: //Default happy path next state closedAuditForm.Hide(); this.nextState = InventoryAuditFlowState.SelectAudit; break; case NavBox.NavAction.CANCEL: this.nextState = InventoryAuditFlowState.CancelFlow; break; default: throw new ApplicationException("" + action.ToString() + " is not a valid state for ClosedAudit"); } this.executeNextState(); }
/// <summary> /// NavBox OnAction Handler for Create Customer /// </summary> /// <param name="sender"></param> /// <param name="data"></param> private void createCustFormNavAction(object sender, object data) { if (sender == null || data == null) { throw new ApplicationException("Create Customer form navigation action handler received invalid data"); } NavBox createCustNavBox = (NavBox)sender; CreateCustomer createCustForm = (CreateCustomer)data; NavBox.NavAction lookupAction = createCustNavBox.Action; switch (lookupAction) { case NavBox.NavAction.BACKANDSUBMIT: GlobalDataAccessor.Instance.DesktopSession.HistorySession.Desktop(); this.nextState = PoliceHoldReleaseFlowState.PoliceHoldReleaseInfo; break; case NavBox.NavAction.HIDEANDSHOW: createCustForm.Hide(); this.nextState = PoliceHoldReleaseFlowState.UpdateAddress; break; case NavBox.NavAction.CANCEL: this.nextState = PoliceHoldReleaseFlowState.Cancel; break; default: throw new ApplicationException("" + lookupAction.ToString() + " is not a valid state for LookupCustomer"); } this.executeNextState(); }
private void uploadFromTrakkerFormNavAction(object sender, object data) { NavBox uploadFromTrakkerNavBox = (NavBox)sender; UploadFromTrakker uploadFromTrakkerForm = (UploadFromTrakker)data; NavBox.NavAction action = uploadFromTrakkerNavBox.Action; if (action == NavBox.NavAction.BACKANDSUBMIT) { DesktopSession.HistorySession.Back(); action = NavBox.NavAction.SUBMIT; } switch (action) { case NavBox.NavAction.SUBMIT: //Default happy path next state uploadFromTrakkerForm.Hide(); this.nextState = InventoryAuditFlowState.AuditManager; break; case NavBox.NavAction.CANCEL: uploadFromTrakkerForm.Hide(); this.nextState = InventoryAuditFlowState.AuditManager; break; default: throw new ApplicationException("" + action.ToString() + " is not a valid state for UploadFromTrakker"); } this.executeNextState(); }
private void enterCaccItemsFormNavAction(object sender, object data) { NavBox enterCaccItemsNavBox = (NavBox)sender; EnterCaccItems enterCaccItemsForm = (EnterCaccItems)data; NavBox.NavAction action = enterCaccItemsNavBox.Action; if (action == NavBox.NavAction.BACKANDSUBMIT) { DesktopSession.HistorySession.Back(); action = NavBox.NavAction.SUBMIT; } switch (action) { case NavBox.NavAction.SUBMIT: //Default happy path next state enterCaccItemsForm.Hide(); this.nextState = InventoryAuditFlowState.AuditManager; break; case NavBox.NavAction.CANCEL: enterCaccItemsForm.Hide(); this.nextState = InventoryAuditFlowState.AuditManager; break; default: throw new ApplicationException("" + action.ToString() + " is not a valid state for EnterCaccItems"); } this.executeNextState(); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="data"></param> private void createCustomerFormNavAction(object sender, object data) { if (sender == null || data == null) { throw new ApplicationException("Create customer form navigation action handler received invalid data"); } NavBox createCustNavBox = (NavBox)sender; CreateCustomer createCustForm = (CreateCustomer)data; NavBox.NavAction action = createCustNavBox.Action; if (action == NavBox.NavAction.BACKANDSUBMIT) { GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back(); action = NavBox.NavAction.SUBMIT; } switch (action) { case NavBox.NavAction.SUBMIT: this.nextState = NewPawnLoanFlowState.ManagePawnApplication; break; } this.executeNextState(); }
private void inventoryQuestionsFormNavAction(object sender, object data) { NavBox inventoryQuestionsNavBox = (NavBox)sender; InventoryQuestions inventoryQuestionsForm = (InventoryQuestions)data; NavBox.NavAction action = inventoryQuestionsNavBox.Action; if (action == NavBox.NavAction.BACKANDSUBMIT) { DesktopSession.HistorySession.Back(); action = NavBox.NavAction.SUBMIT; } switch (action) { case NavBox.NavAction.SUBMIT: inventoryQuestionsForm.Hide(); this.nextState = InventoryAuditFlowState.AuditResults; break; case NavBox.NavAction.CANCEL: inventoryQuestionsForm.Hide(); this.nextState = InventoryAuditFlowState.AuditManager; break; default: throw new ApplicationException("" + action.ToString() + " is not a valid state for InventoryQuestions"); } this.executeNextState(); }
/// <summary> /// The various form actions for the describe merchandise form in the charge on flow /// </summary> /// <param name="sender"></param> /// <param name="data"></param> private void describeMerchFormAction(object sender, object data) { if (sender == null || data == null) { throw new ApplicationException("Describe Merchandise form navigation action handler received invalid data"); } NavBox descMerchNavBox = (NavBox)sender; NavBox.NavAction action = descMerchNavBox.Action; if (action == NavBox.NavAction.BACKANDSUBMIT) { AuditDesktopSession.Instance.HistorySession.Back(); action = NavBox.NavAction.SUBMIT; } switch (action) { case NavBox.NavAction.SUBMIT: if (AuditDesktopSession.Instance.ActivePawnLoan != null) { if (AuditDesktopSession.Instance.ActivePawnLoan.Items != null && AuditDesktopSession.Instance.ActivePawnLoan.Items.Count > 0 && AuditDesktopSession.Instance.DescribeItemPawnItemIndex > -1) { Item rItem = AuditDesktopSession.Instance.ActivePawnLoan.Items[AuditDesktopSession.Instance.DescribeItemPawnItemIndex]; List <int> caccCatCodes = new List <int> { 3362, 3350, 3362, 3363, 3380 }; if (caccCatCodes.Contains(rItem.CategoryCode)) { MessageBox.Show("Unable to charge on a CACC item in the Audit Application."); AuditDesktopSession.Instance.HistorySession.Back(); this.nextState = InventoryAuditFlowState.ProcessUnexpected; } else { this.nextState = InventoryAuditFlowState.DescribeItem; } } else { this.nextState = InventoryAuditFlowState.DescribeItem; } } else { this.nextState = InventoryAuditFlowState.DescribeItem; } break; case NavBox.NavAction.CANCEL: AuditDesktopSession.Instance.HistorySession.Back(); this.nextState = InventoryAuditFlowState.ProcessUnexpected; break; default: throw new ApplicationException("" + action.ToString() + " is not a valid state for Describe Merchandise"); } this.executeNextState(); }
/// <summary> /// NavBox OnAction Handler for Customer Holds List Form /// </summary> /// <param name="sender"></param> /// <param name="data"></param> private void custHoldListFormNavAction(object sender, object data) { if (sender == null || data == null) { throw new ApplicationException("Customer Hold List form navigation action handler received invalid data"); } NavBox custHoldNavBox = (NavBox)sender; CustomerHoldsList custHoldListForm = (CustomerHoldsList)data; NavBox.NavAction lookupAction = custHoldNavBox.Action; if (lookupAction == NavBox.NavAction.BACKANDSUBMIT) { GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back(); lookupAction = NavBox.NavAction.SUBMIT; } switch (lookupAction) { case NavBox.NavAction.SUBMIT: this.nextState = CustomerHoldFlowState.CustomerHoldInfo; break; case NavBox.NavAction.CANCEL: this.nextState = CustomerHoldFlowState.Cancel; break; default: throw new ApplicationException("" + lookupAction.ToString() + " is not a valid state for Customer Hold List"); } this.executeNextState(); }
/// <summary> /// NavBox OnAction Handler for customer replace Form /// </summary> /// <param name="sender"></param> /// <param name="data"></param> private void customerReplaceFormNavAction(object sender, object data) { if (sender == null || data == null) { throw new ApplicationException("Customer replace form navigation action handler received invalid data"); } NavBox custReplaceNavBox = (NavBox)sender; NavBox.NavAction lookupAction = custReplaceNavBox.Action; switch (lookupAction) { case NavBox.NavAction.SUBMIT: case NavBox.NavAction.BACKANDSUBMIT: case NavBox.NavAction.CANCEL: CashlinxDesktopSession.Instance.HistorySession.Back(); this.nextState = GunBookEditFlowState.EditGunBookRecord; break; default: throw new ApplicationException("" + lookupAction.ToString() + " is not a valid state for customer replace form"); } this.executeNextState(); }
/// <summary> /// The various form actions for the describe merchandise form in the new pawn loan flow /// </summary> /// <param name="sender"></param> /// <param name="data"></param> private void describeMerchFormAction(object sender, object data) { if (sender == null || data == null) { throw new ApplicationException("Describe Merchandise form navigation action handler received invalid data"); } NavBox descMerchNavBox = (NavBox)sender; NavBox.NavAction action = descMerchNavBox.Action; if (action == NavBox.NavAction.BACKANDSUBMIT) { CashlinxDesktopSession.Instance.HistorySession.Back(); action = NavBox.NavAction.SUBMIT; } switch (action) { case NavBox.NavAction.SUBMIT: this.nextState = GunBookEditFlowState.DescribeItem; break; case NavBox.NavAction.CANCEL: CashlinxDesktopSession.Instance.HistorySession.Back(); this.nextState = GunBookEditFlowState.EditGunBookRecord; break; default: throw new ApplicationException("" + action.ToString() + " is not a valid state for Describe Merchandise"); } this.executeNextState(); }
/// <summary> /// NavBox OnAction Handler for Lookup Receipt /// </summary> /// <param name="sender"></param> /// <param name="data"></param> private void lookupReceiptFormNavAction(object sender, object data) { if (sender == null || data == null) { throw new ApplicationException("Lookup receipt form navigation action handler received invalid data"); } NavBox lookupReceiptNavBox = (NavBox)sender; LookupReceipt lookupReceiptForm = (LookupReceipt)data; NavBox.NavAction lookupAction = lookupReceiptNavBox.Action; switch (lookupAction) { case NavBox.NavAction.SUBMIT: this.nextState = LookupReceiptFlowState.ViewReceipt; break; case NavBox.NavAction.CANCEL: this.nextState = LookupReceiptFlowState.ExitFlow; break; default: throw new ApplicationException(string.Format("{0} is not a valid state for LookupReceipt", lookupAction)); } this.executeNextState(); }
private void viewCashDrawerNavFunction(object sender, object data) { if (sender == null || data == null) { throw new ApplicationException("View Cash Drawer navigation action handler received invalid data"); } NavBox navBox = (NavBox)sender; NavBox.NavAction action = navBox.Action; if (action == NavBox.NavAction.BACKANDSUBMIT) { GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back(); action = NavBox.NavAction.SUBMIT; } switch (action) { case NavBox.NavAction.SUBMIT: this.nextState = ShopCashManagementFlowState.ShopCashManagement; break; case NavBox.NavAction.CANCEL: this.nextState = ShopCashManagementFlowState.CancelFlow; break; } this.executeNextState(); }
private void viewCustFormNavAction(object sender, object data) { if (sender == null || data == null) { throw new ApplicationException("View Customer form navigation action handler received invalid data"); } NavBox viewCustNavBox = (NavBox)sender; //ViewCustomerInformation viewCustForm = (ViewCustomerInformation)data; NavBox.NavAction action = viewCustNavBox.Action; switch (action) { case NavBox.NavAction.CANCEL: case NavBox.NavAction.BACK: GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back(); CommonAppBlocks.Instance.HideFlowTabController(); this.nextState = LoanInquiryFlowState.Cancel; break; default: throw new ApplicationException("" + action.ToString() + " is not a valid state for LookupCustomer"); } this.executeNextState(); }
/// <summary> /// NavBox OnAction Handler for Update Physical Description /// </summary> /// <param name="sender"></param> /// <param name="data"></param> private void updatePhysicalDescFormNavAction(object sender, object data) { if (sender == null || data == null) { throw new ApplicationException("Update Physical Desciption navigation action handler received invalid data"); } NavBox physDescNavBox = (NavBox)sender; UpdatePhysicalDesc physDescForm = (UpdatePhysicalDesc)data; NavBox.NavAction lookupAction = physDescNavBox.Action; switch (lookupAction) { case NavBox.NavAction.BACK: this.nextState = PoliceHoldReleaseFlowState.UpdateAddress; break; case NavBox.NavAction.BACKANDSUBMIT: GlobalDataAccessor.Instance.DesktopSession.HistorySession.Desktop(); this.nextState = PoliceHoldReleaseFlowState.PoliceHoldReleaseInfo; break; case NavBox.NavAction.CANCEL: this.nextState = PoliceHoldReleaseFlowState.Cancel; break; default: throw new ApplicationException("" + lookupAction.ToString() + " is not a valid state for Update Physical Description"); } this.executeNextState(); }
/// <summary> /// The various form actions for describe item form /// </summary> /// <param name="sender"></param> /// <param name="data"></param> private void describeItemFormAction(object sender, object data) { if (sender == null || data == null) { throw new ApplicationException("Describe Item form navigation action handler received invalid data"); } NavBox descItemNavBox = (NavBox)sender; NavBox.NavAction action = descItemNavBox.Action; if (action == NavBox.NavAction.BACKANDSUBMIT) { AuditDesktopSession.Instance.HistorySession.Back(); action = NavBox.NavAction.SUBMIT; } switch (action) { case NavBox.NavAction.SUBMIT: if (AuditDesktopSession.Instance.ActivePawnLoan != null) { if (AuditDesktopSession.Instance.ActivePawnLoan.Items != null && AuditDesktopSession.Instance.ActivePawnLoan.Items.Count > 0 && AuditDesktopSession.Instance.DescribeItemPawnItemIndex > -1) { Item rItem = AuditDesktopSession.Instance.ActivePawnLoan.Items[AuditDesktopSession.Instance.DescribeItemPawnItemIndex]; rItem.TempStatus = StateStatus.CON; rItem.ItemStatus = ProductStatus.CON; rItem.mStore = Utilities.GetIntegerValue(AuditDesktopSession.Instance.ActiveAudit.StoreNumber); rItem.Icn = RetailProcedures.GenerateTempICN(AuditDesktopSession.Instance, AuditDesktopSession.Instance.ActiveAudit.StoreNumber, rItem.mStore, rItem.mYear); rItem.mDocNumber = Utilities.GetIntegerValue(rItem.Icn.Substring(6, 6), 0); rItem.mDocType = "8"; rItem.PfiTags = 1; AuditDesktopSession.Instance.ActivePawnLoan.Items.RemoveAt(AuditDesktopSession.Instance.DescribeItemPawnItemIndex); AuditDesktopSession.Instance.ActivePawnLoan.Items.Add(rItem); } } if (AuditDesktopSession.Instance.ActivePawnLoan != null) { AuditProcedures.ProcessChargeonNewItems(AuditDesktopSession.Instance, AuditDesktopSession.Instance.ActivePawnLoan.Items, AuditDesktopSession.Instance.ActiveAudit.StoreNumber); } AuditDesktopSession.Instance.PawnLoans.Clear(); this.nextState = InventoryAuditFlowState.ProcessUnexpected; break; case NavBox.NavAction.CANCEL: AuditDesktopSession.Instance.HistorySession.Back(); this.nextState = InventoryAuditFlowState.ProcessUnexpected; break; case NavBox.NavAction.BACK: AuditDesktopSession.Instance.HistorySession.Back(); this.nextState = InventoryAuditFlowState.ChargeOn; break; default: throw new ApplicationException("" + action.ToString() + " is not a valid state for Describe Item"); } this.executeNextState(); }
/// <summary> /// The various form actions for describe item form /// </summary> /// <param name="sender"></param> /// <param name="data"></param> private void describeItemFormAction(object sender, object data) { if (sender == null || data == null) { throw new ApplicationException("Describe Item form navigation action handler received invalid data"); } NavBox descItemNavBox = (NavBox)sender; DescribeItem descItemForm = (DescribeItem)data; NavBox.NavAction action = descItemNavBox.Action; if (action == NavBox.NavAction.BACKANDSUBMIT) { GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back(); action = NavBox.NavAction.SUBMIT; } switch (action) { case NavBox.NavAction.SUBMIT: if (descItemNavBox.IsCustom) { string custDet = descItemNavBox.CustomDetail; if (custDet.Equals("DescribeMerchandisePFIReplace", StringComparison.OrdinalIgnoreCase)) { this.nextState = PFIVerifyFlowState.DescribeMerchandisePFIReplace; } } break; case NavBox.NavAction.CANCEL: this.nextState = PFIVerifyFlowState.CancelFlow; break; case NavBox.NavAction.BACK: GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back(); if (descItemNavBox.IsCustom) { string custDet = descItemNavBox.CustomDetail; if (custDet.Equals("Back", StringComparison.OrdinalIgnoreCase)) { this.nextState = PFIVerifyFlowState.DescribeMerchandise; } else if (custDet.Equals("BackPFIAdd", StringComparison.OrdinalIgnoreCase)) { this.nextState = PFIVerifyFlowState.DescribeMerchandisePFIAdd; } } else { this.nextState = PFIVerifyFlowState.PfiVerify; } break; default: throw new ApplicationException("" + action.ToString() + " is not a valid state for Describe Item"); } this.executeNextState(); }
/// <summary> /// Action class for LookupVendorResults /// </summary> /// <param name="sender"></param> /// <param name="data"></param> private void lookupVendResultsFormNavAction(object sender, object data) { if (sender == null || data == null) { throw new ApplicationException("Lookup Vendor form navigation action handler received invalid data"); } NavBox lookupVendResNavBox = (NavBox)sender; NavBox.NavAction action = lookupVendResNavBox.Action; if (action == NavBox.NavAction.BACKANDSUBMIT) { GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back(); action = NavBox.NavAction.SUBMIT; } ItemSearch itemSearchFrm = new ItemSearch(); Form currForm = GlobalDataAccessor.Instance.DesktopSession.HistorySession.Lookup(itemSearchFrm); if (currForm.GetType() == typeof(ItemSearch)) { currForm.Hide(); } TenderIn tenderInFrm = new TenderIn(); currForm = GlobalDataAccessor.Instance.DesktopSession.HistorySession.Lookup(tenderInFrm); if (currForm.GetType() == typeof(TenderIn)) { currForm.Hide(); } switch (action) { case NavBox.NavAction.SUBMIT: if (lookupVendResNavBox.IsCustom) { string custDet = lookupVendResNavBox.CustomDetail; //Look for add customer if (custDet.Equals("CreateVendor")) { this.nextState = SaleFlowState.AddVendor; } } break; case NavBox.NavAction.BACK: GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back(); this.nextState = SaleFlowState.LookupCustomer; break; case NavBox.NavAction.CANCEL: this.nextState = SaleFlowState.CancelFlow; break; default: throw new ApplicationException("" + action.ToString() + " is not a valid state for LookupVendorResults"); } this.executeNextState(); }
private void auditManagerFormNavAction(object sender, object data) { NavBox auditManagerNavBox = (NavBox)sender; AuditManager auditManagerForm = (AuditManager)data; NavBox.NavAction action = auditManagerNavBox.Action; if (action == NavBox.NavAction.BACKANDSUBMIT) { DesktopSession.HistorySession.Back(); action = NavBox.NavAction.SUBMIT; } switch (action) { case NavBox.NavAction.SUBMIT: //Default happy path next state this.parentForm = auditManagerForm; if (auditManagerNavBox.IsCustom) { auditManagerForm.Hide(); if (auditManagerNavBox.CustomDetail.Equals("DOWNLOAD")) { this.nextState = InventoryAuditFlowState.DownloadToTrakker; } else if (auditManagerNavBox.CustomDetail.Equals("UPLOAD")) { this.nextState = InventoryAuditFlowState.UploadFromTrakker; } else if (auditManagerNavBox.CustomDetail.Equals("PROCESSMISSING")) { this.nextState = InventoryAuditFlowState.ProcessMissing; } else if (auditManagerNavBox.CustomDetail.Equals("PROCESSUNEXPECTED")) { this.nextState = InventoryAuditFlowState.ProcessUnexpected; } else if (auditManagerNavBox.CustomDetail.Equals("COUNTCACC")) { this.nextState = InventoryAuditFlowState.CountCACC; } } else { auditManagerForm.Hide(); this.nextState = InventoryAuditFlowState.InventorySummary; } break; case NavBox.NavAction.CANCEL: this.nextState = InventoryAuditFlowState.CancelFlow; break; default: throw new ApplicationException("" + action.ToString() + " is not a valid state for InitiateAudit"); } 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 = 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(); }