コード例 #1
0
ファイル: OrderService.cs プロジェクト: evkap/DVS
		public OrderAppraisalInfoViewModel GetAppraisalInfo(int orderId)
		{
			var order = _orderManager.GetOrderById(orderId);
			CheckOrderAccessForClients(order);
			var viewModel = new OrderAppraisalInfoViewModel(order.AppraisalInfo);
			viewModel.IsCancelPopupNeeded = !IsOrderDraft(order);
			viewModel.OrderNumber = GetOrderNumber(order);

			return viewModel;
		}
コード例 #2
0
		public ActionResult AppraisalInfo(OrderAppraisalInfoViewModel viewModel, int nextStep)
		{
			if (nextStep <= (int)OrderCreationWizardTabOrder.AppraisalInfo || ModelState.IsValid)
			{
				_orderService.SaveAppraisalInfo(viewModel);

				var nextTab = SafeConvert.ToEnum<OrderCreationWizardTabOrder>(nextStep).Value;
				bool isSavePressed = IsSavePressed(nextTab, OrderCreationWizardTabOrder.AppraisalInfo);
				SetLastCompletedStepAndStatus(OrderCreationWizardTabOrder.AppraisalInfo, nextStep, viewModel.OrderId, isSavePressed);

				CommitProviderInstance.Commit();

				return isSavePressed ? RedirectToClientPipeline() : RedirectToStep(nextTab, viewModel.OrderId);
			}
			else
			{
				TempData[_appraisalInfoKey] = viewModel;
				return RedirectToStep(OrderCreationWizardTabOrder.AppraisalInfo, viewModel.OrderId);
			}
		}
コード例 #3
0
ファイル: OrderService.cs プロジェクト: evkap/DVS
		public void SaveAppraisalInfo(OrderAppraisalInfoViewModel viewModel)
		{
			var order = _orderManager.GetOrderById(viewModel.OrderId);
			CheckOrderAccessForClients(order);
			order.AppraisalInfo = order.AppraisalInfo ?? new OrderAppraisalInfo();
			viewModel.FillModel(order.AppraisalInfo);

			if (viewModel.FileId != null)
			{
				OrderDocumentInfo orderDocumentInfo = new OrderDocumentInfo() { DocumentDescription = "Original Appraisal", DocumentTypeId = (int)DocumentType.Other, FileId = viewModel.FileId, UserType = DocumentUserType.Lender, OrderId = viewModel.OrderId };
				_orderDocumentsRepository.Add(orderDocumentInfo);
			}
		}