Exemplo n.º 1
0
		/// <summary>
		///A test for ValidateAciXml
		///</summary>

		private int CreateOrder(int formId)
		{
			base.InitDbContext();
			IOrderRepository orderRepository = new OrderRepository(this.DbFactory);
			ICommitProvider commitProvider = new CommitProvider(this.DbFactory);
			int rand = new Random().Next(0, 100000);
			var loanAndContactInfo = new OrderLoanAndContactInfo
			{
				Contacts = new List<OrderContact>() { new OrderContact { ContactRoleId = 2, Email = String.Format("mial{0}@mail.com", rand), Name = "Name" + rand, Phone = "123" + rand } },
				LoanPurposeTypeId = 4,
				GFEDate = DateTime.Now.AddDays(100),
				GFEAmount = 9999.99,
			};

			var generalInfo = new OrderGeneralInfo
			{
				BorrowerFirstName = "Test" + rand,
				BorrowerLastName = "Test" + rand,
				LoanNumber = "100" + rand,
				PropertyAddress = new Address { City = "New York", County = "Test", State = "NY", ZIP = "12345", Street = "Wallstreet" }
			};

			var appraisalInfo = new OrderAppraisalInfo
			{
				PropertyTypeId = 3,
				OccupancyTypeId = 1,
				AppraisalTypeId = 1,
				Rush = true,
				SecondDuplicateAppraisal = true,
				LoanType = LoanType.Conventional,
				NumberUnits = 7,
				AppraisalType = AppraisalType.Appraisal,
				AppraisalForm = formId,
				ReviewForm = 0
			};

			Order order = new Order
			{
				OrderPublicId = "000" + rand,
				AppraiserOrderDeliveryType = 3,
				CreationDate = DateTime.Now,
				LoanAndContactInfo = loanAndContactInfo,
				AppraisalInfo = appraisalInfo,
				CreatedByClientUserId = 1,
				OrderStatusId = OrderStatus.PendingAssignment.ToString(),
				DueDate = DateTime.Now.AddDays(10),
				Latitude = 43,
				Longitude = -73,
				GeneralInfo = generalInfo
			};
			orderRepository.Add(order);
			commitProvider.Commit();
			return order.Id;
		}
Exemplo n.º 2
0
		public OrderLoanAndContactInfoViewModel(OrderLoanAndContactInfo model)
			: this()
		{
			if (model != null)
			{
				this.Instructions = model.Instructions != null ? model.Instructions.ToList().Select(s => s.Id) : new List<int>();
				this.LoanPurpose = model.LoanPurposeTypeId ?? 0;
				this.PurchasePrice = model.PurchasePrice;
				this.ContactInfo = new ContactInfoViewModel(model.Contacts, model.Id);
				ContactFileId = model.PurchaseContractFileGuid;
			}
			this.ContactInfo = ContactInfo ?? new ContactInfoViewModel();

		}