public ActionResult OrderConfirmation(ConfirmOrderViewModel viewModel, int nextStep) { var nextTab = OrderCreationWizardTabOrder.FeeConfirmation; var isSavePressed = IsSavePressed((OrderCreationWizardTabOrder)nextStep, OrderCreationWizardTabOrder.OrderConfirmation); var isSubmitPressed = (OrderCreationWizardTabOrder)nextStep == OrderCreationWizardTabOrder.FeeConfirmation; CommitProviderInstance.Commit(); return isSavePressed ? RedirectToClientPipeline() : RedirectToStep(nextTab, viewModel.OrderId); }
public ConfirmationResult GetOrderConfirmation(int orderId) { var result = new ConfirmationResult(); var order = _orderManager.GetOrderById(orderId); CheckOrderAccessForClients(order); var state = _referenceManager.FindState(order.GeneralInfo.PropertyAddress.State); var orderConfirmation = new ConfirmOrderViewModel(order, state); orderConfirmation.PropertyType = _referenceManager.GetReference(ReferenceType.PropertyTypes, false)[order.AppraisalInfo.PropertyTypeId.Value]; orderConfirmation.OccupancyType = _referenceManager.GetReference(ReferenceType.OccupancyTypes, false)[order.AppraisalInfo.OccupancyTypeId.Value]; orderConfirmation.LoanPurpose = _referenceManager.GetReference(ReferenceType.LoanPurposeTypes, false)[order.LoanAndContactInfo.LoanPurposeTypeId.Value]; orderConfirmation.IsPurchaseContractVisible = order.LoanAndContactInfo.LoanPurpose == LoanPurpose.Purchase; orderConfirmation.Form = GetApprasalFormString(order.AppraisalInfo); orderConfirmation.IsLenderSectionVisible = order.CreatedByClientUser.Company.Profile.IsBroker; orderConfirmation.IsCancelPopupNeeded = IsOrderDraft(order); orderConfirmation.OrderNumber = GetOrderNumber(order); orderConfirmation.GeoCodingCounty = string.IsNullOrEmpty(order.GeocodingCounty) ? order.GeneralInfo.PropertyAddress.County : order.GeocodingCounty; if (orderConfirmation.IsLenderSectionVisible) { if (order.ClientCompany != null || order.ClientCompanyBranche != null) { orderConfirmation.LenderName = order.ClientCompany.CompanyName; orderConfirmation.LenderBranch = order.ClientCompanyBranche.Name; } else { result.IsValid = false; } } result.ViewModel = orderConfirmation; return result; }