Ejemplo n.º 1
0
		public ActionResult UpdateLenderResponse(int orderId, Guid conditionId, OrderConditionLenderResponse lenderResponse)
		{
			var result = _conditionsService.UpdateLenderResponse(orderId, conditionId, lenderResponse);
			CommitProviderInstance.Commit();

			return Json(new { status = result.Status, conditionStatus = (int)result.ConditionStatus });
		}
Ejemplo n.º 2
0
		public LenderResponseUpdateResultViewModel UpdateLenderResponse(int orderId, Guid conditionId, OrderConditionLenderResponse lenderResponse)
		{
			var order = _orderManager.GetOrderById(orderId);
			var orderCondition = order.Conditions.First(e => e.Identity == conditionId);
			if (AllowEditResponse(orderCondition))
			{
				orderCondition.LenderResponse = lenderResponse;

				if (lenderResponse == OrderConditionLenderResponse.Accepted)
				{
					orderCondition.Status = OrderConditionStatus.Closed;
				}
				if (lenderResponse == OrderConditionLenderResponse.Rejected)
				{
					orderCondition.Status = OrderConditionStatus.Created;
				}
				SetConditionResolvedStatus(order);
				_orderHistoryManager.AddLenderResponseNote(orderId, lenderResponse.ToString(), orderCondition.Description);
				return new LenderResponseUpdateResultViewModel { ConditionStatus = orderCondition.Status, Status = true };
			}

			return new LenderResponseUpdateResultViewModel { ConditionStatus = orderCondition.Status, Status = false };
		}