コード例 #1
0
        /// <summary>
        /// Get the solution for this case
        /// </summary>
        /// <param name="solutionId"></param>
        /// <returns></returns>
        Solution ICaseRepository.GetSolution(Guid solutionId)
        {
            var hpSolution = new Guid("1F86D309-EAE1-47CD-BE03-1064E3CC5AE8");
              var btlSolution = new Guid("2386D309-EAE1-47CD-BE03-1064E3CC5AE8");
              var rateSwitchSolution = new Guid("4486D309-EAE1-47CD-BE03-1064E3CC5AE8");

              MortgageRequirement requirement = null;

              if (solutionId == hpSolution)
              {
            // we would go to a database and get all these, ensuring user and the owner match
            requirement = new HousePurchaseRequirement(Guid.NewGuid(), 250000, 90, 400000, false,
                                                   DateTime.Now.AddDays(-45));
              }
              else if (solutionId == btlSolution)
              {
            requirement = new BuyToLetRequirement(Guid.NewGuid(), 1000, DateTime.Now.AddDays(-3));
              }
              else if (solutionId == rateSwitchSolution)
              {
            requirement = new RateSwitchRequirement(Guid.NewGuid(), "122222", DateTime.Now.AddDays(-5));
              }

              var product = _ProductService.GetProductDetails(Guid.NewGuid());

              var productList = new List<Product> { product };

              var solution = new MortgageSolution(productList, requirement);

              return solution;
        }
コード例 #2
0
        List<ProductSummary> IMortgageProductService.ListSuitableProduct(BuyToLetRequirement requirement)
        {
            var summaries = new List<ProductSummary>();

            for (int x = 0; x < 10; x++) {
              var productSummary = new MortgageProductSummary((x % 2) == 0, x, Guid.NewGuid(), string.Format("ShoeSize {0}", requirement.MonthlyRental),
                                                          string.Format("Description for product {0}", x));
              summaries.Add(productSummary);
            }

            return summaries;
        }
コード例 #3
0
        public List<ProductSummary> ListSuitableProduct(BuyToLetRequirement requirement)
        {
            var summaries = new List<ProductSummary>();

            for (int x = 0; x < 10; x++) {
              var productSummary = new MortgageProductSummary((x % 2) == 0, x, Guid.NewGuid(), string.Format("Name {0}", x),
                                                          string.Format("Description for buy to let product {0}", x));
              summaries.Add(productSummary);
            }

            return summaries;
        }
コード例 #4
0
        /// <summary>
        /// return a requirement based on BTL
        /// </summary>
        /// <param name="domainRequirement"></param>
        /// <returns></returns>
        RequirementDto IMortgageAdaptor.AdaptRequirement(BuyToLetRequirement domainRequirement)
        {
            var mortgageRequirement = domainRequirement;

              var dtoRequirement = new MortgageRequirementDto(mortgageRequirement.MonthlyRental,mortgageRequirement.Id, mortgageRequirement.CreatedDate);

              return dtoRequirement;
        }