Пример #1
0
		public HotListViewModel(HotList hotList)
		{
			if (hotList != null)
			{
				OrderNumber = hotList.OrderNumber;
				Borrower = DashboardExtensions.GetBorrowerName(hotList.BorrowerLastName, hotList.BorrowerFirstName);
				PropertyAddress = hotList.PropertyAddress;
				OrderCreated = hotList.OrderCreated;
				Type = (HotListType)hotList.HotListType;
				AppraiserOrderId = hotList.AppraiserOrderId;
				DueDate = hotList.DueDate;
				OrderId = hotList.OrderId;

				AppraisalEmail = DashboardExtensions.GetAppraiserEmail(hotList.UserEmail);
				AppraisalFullName = DashboardExtensions.GetAppraiserFullName(hotList.UserFirstName, hotList.UserLastName);

				{
					OrderStatus defaultStatus;
					if (!Enum.TryParse(hotList.OrderStatus, out defaultStatus))
					{
						defaultStatus = OrderStatus.PendingAssignment;
					}

					Status = defaultStatus;
				}
			}
		}
Пример #2
0
		private IEnumerable<HotList> GenerateCurrentAppraiserWithinOrder(User user, params AppraiserOrder[] orders)
		{
			var result = new List<HotList>();

			InitCurrentUser(user, new AppraiserUser { Id = 123 });

			foreach (var appraiserOrder in orders)
			{
				var resultItem = new HotList();

				resultItem.AppraiserOrder = appraiserOrder;
				resultItem.AppraiserUser = CurrentAppraiser.CurrentAppraiser;
				resultItem.AppraiserId = CurrentAppraiser.CurrentAppraiser.Id;
				resultItem.Order = appraiserOrder.Order ?? new Order { PropertyAddress = new Address() };
				resultItem.OrderCreated = resultItem.AppraiserOrder.CreatedDate;
				resultItem.OrderNumber = resultItem.Order.OrderPublicId;
				resultItem.OrderStatus = resultItem.AppraiserOrder.AppraiserOrderStatusId;
				resultItem.PropertyAddress = resultItem.Order.PropertyAddress;

				result.Add(resultItem);
			}

			return result;
		}