private void SetLastCompletedStepAndStatus(OrderCreationWizardTabOrder currentTab, int nextStep, int orderId, bool isSavedPressed) { var nextTab = SafeConvert.ToEnum<OrderCreationWizardTabOrder>(nextStep).Value; SaveLastCompletedStep(currentTab, orderId, nextStep); if (isSavedPressed) SetDraftStatus(orderId); }
private bool IsTabAvailable(OrderCreationWizardTabOrder currentTab, int orderId) { OrderCreationWizardTabOrder lastCompletedStep = GetOrderCreationLastCompletedStep(orderId); return (currentTab <= lastCompletedStep); }
private ActionResult RedirectToStep(OrderCreationWizardTabOrder nextTab, int? orderId = null) { switch (nextTab) { case OrderCreationWizardTabOrder.GeneralInfo: return RedirectToAction(NameHelper.OrderCreationWizard.GeneralInfo, new { orderId = orderId }); case OrderCreationWizardTabOrder.AppraisalInfo: return RedirectToAction(NameHelper.OrderCreationWizard.AppraisalInfo, new { orderId = orderId }); case OrderCreationWizardTabOrder.LoanAndContactInfo: return RedirectToAction(NameHelper.OrderCreationWizard.LoanAndContactInfo, new { orderId = orderId }); case OrderCreationWizardTabOrder.FeeConfirmation: return RedirectToAction(NameHelper.OrderCreationWizard.FeeConfirmation, new { orderId = orderId }); case OrderCreationWizardTabOrder.ProcessCreditCard: return RedirectToAction(NameHelper.OrderCreationWizard.ProcessCreditCard, new { orderId = orderId }); case OrderCreationWizardTabOrder.OrderConfirmation: return RedirectToAction(NameHelper.OrderCreationWizard.OrderConfirmation, new { orderId = orderId }); case OrderCreationWizardTabOrder.RequestConfirmation: return RedirectToAction(NameHelper.OrderCreationWizard.RequestConfirmation, new { orderId = orderId }); default: throw new IndexOutOfRangeException("Unknow nextTab: " + nextTab.ToString()); } }
private void SaveLastCompletedStep(OrderCreationWizardTabOrder currentStep, int orderId, int? nextStep) { if (!nextStep.HasValue) { _orderService.SetCreationOrderLastStep((int)currentStep, orderId); } else if (nextStep.Value > (int)currentStep) { _orderService.SetCreationOrderLastStep((int)currentStep + 1, orderId); } else if (nextStep.Value < (int)currentStep) { _orderService.SetCreationOrderLastStep((int)currentStep - 1, orderId); } }
private bool IsSavePressed(OrderCreationWizardTabOrder nextTab, OrderCreationWizardTabOrder currentTab) { return nextTab == currentTab; }
private ActionResult RedirectToStep(OrderCreationWizardTabOrder nextTab, int? orderId = null) { switch (nextTab) { case OrderCreationWizardTabOrder.OrderConfirmation: return RedirectToAction(NameHelper.DeclinedOrderProcessing.OrderConfirmation, new { orderId = orderId }); case OrderCreationWizardTabOrder.FeeConfirmation: return RedirectToAction(NameHelper.DeclinedOrderProcessing.FeeConfirmation, new { orderId = orderId }); case OrderCreationWizardTabOrder.ProcessCreditCard: return RedirectToAction(NameHelper.DeclinedOrderProcessing.ProcessCreditCard, new { orderId = orderId }); case OrderCreationWizardTabOrder.RequestConfirmation: return RedirectToAction(NameHelper.DeclinedOrderProcessing.RequestConfirmation, new { orderId = orderId }); default: throw new IndexOutOfRangeException("Tab is not avalilable: " + nextTab.ToString()); } }