Пример #1
0
        private void TakeCareOfClaim()
        {
            Console.Clear();
            KomodoClaim claim = _claimRepo.ViewNextClaim();

            string tableHeaders = String.Format("{0,-20} {1,-20} {2,-80} {3,-20} {4,-20} {5,-20} {6,-20}\n\n", "ID:", "Type:", "Description:", "Amount ($):", "Date of Incident:", "Date of Claim:", "Claim is Valid:");

            Console.WriteLine(tableHeaders);

            string tableBody = String.Format("{0,-20} {1,-20} {2,-80} {3,-20} {4,-20} {5,-20} {6,-20}\n\n", claim.ClaimID, claim.ClaimType, claim.Description, claim.ClaimAmount.ToString("C"), claim.DateOfIncident.ToShortDateString(), claim.DateOfClaim.ToShortDateString(), claim.IsValid);

            Console.WriteLine(tableBody);
            Console.WriteLine("\n\nDo you want to take care of this claim? Type y for yes and n for no");
            string input = Console.ReadLine().ToLower();

            switch (input)
            {
            case "y":
                _claimRepo.TakeCareOfNextClaim();
                Console.WriteLine("This claim will be removed from the queue.");
                break;

            case "n":
                Console.WriteLine("This claim will not be removed from the queue. However, you will always have to complete the queue in the order it was added. You cannot skip items in the queue.");
                break;

            default:
                Console.WriteLine("I did not understand your response.");
                break;
            }
        }
Пример #2
0
        private void AddNewClaim()
        {
            Console.Clear();
            KomodoClaim newClaim = new KomodoClaim();

            Console.WriteLine("Enter the number associated with the claim type from the following:\n" +
                              "1.Car\n" +
                              "2.Home\n" +
                              "3.Theft.");
            int claimType = int.Parse(Console.ReadLine());

            newClaim.ClaimType = (ClaimTypeEnum)claimType;

            Console.WriteLine("Enter a description of the claim.");
            newClaim.Description = Console.ReadLine();

            Console.WriteLine("Enter the amount requested for the claim using numbers and decimals only to represent the value.");
            newClaim.ClaimAmount = decimal.Parse(Console.ReadLine());

            Console.WriteLine("Enter the date of the incident using the following format: MM / DD / YYYY");
            newClaim.DateOfIncident = DateTime.Parse(Console.ReadLine());

            Console.WriteLine("Enter the date of the claim using the following format: MM / DD / YYYY");
            newClaim.DateOfClaim = DateTime.Parse(Console.ReadLine());

            _claimRepo.AddClaim(newClaim);
        }
Пример #3
0
        private void SeedClaimsList()
        {
            var car1   = new KomodoClaim(ClaimTypeEnum.Car, "Bear jumped onto my car.", 2600, new DateTime(2020, 12, 1), new DateTime(2020, 12, 2));
            var home1  = new KomodoClaim(ClaimTypeEnum.Home, "Bear jumped off my car and onto my home.", 5000, new DateTime(2020, 12, 1), new DateTime(2020, 12, 3));
            var theft1 = new KomodoClaim(ClaimTypeEnum.Theft, "I later realized bear stole my prized posessions when on my home.", 15000, new DateTime(2020, 12, 1), new DateTime(2021, 1, 4));

            _claimRepo.AddClaim(car1);
            _claimRepo.AddClaim(home1);
            _claimRepo.AddClaim(theft1);
        }
 public void Arrange()
 {
     _repo  = new KomodoClaimRepo();
     _claim = new KomodoClaim(ClaimTypeEnum.Home, "My house caught on fire.", 5000, new DateTime(2020, 12, 14), new DateTime(2020, 12, 15));
     _repo.AddClaim(_claim);
 }