コード例 #1
0
        //private void Validity()
        //{
        //    _claimRepo.ClaimValidity();
        //}

        private void EnterNewClaim()
        {
            Console.WriteLine("Please enter the claim ID");
            int claimID = ParseInput();

            Console.WriteLine("Please select your claim type:\n" +
                              "1. Car\n" +
                              "2. Home\n" +
                              "3. Theft");
            int claimType = ParseInput();

            ClaimType type;

            switch (claimType)
            {
            default:
            case 1:
                type = ClaimType.Car;
                break;

            case 2:
                type = ClaimType.Home;
                break;

            case 3:
                type = ClaimType.Theft;
                break;
            }

            Console.WriteLine("Please enter a claim description");
            string description = Console.ReadLine();

            Console.WriteLine("Please enter the claim amount");
            decimal claimAmount = decimal.Parse(Console.ReadLine());

            Console.WriteLine("Please enter the date of the accident (dd/mm/yy)");
            DateTime dateOfIncident = DateTime.Parse(Console.ReadLine());

            Console.WriteLine("Please enter the date of the claim (dd/mm/yy)");
            DateTime dateOfClaim = DateTime.Parse(Console.ReadLine());

            ClaimInformation claim = new ClaimInformation(claimID, type, description, claimAmount, dateOfIncident, dateOfClaim);

            _claimRepo.AddClaimToQueue(claim);

            Console.WriteLine($"\"Claim ID#{claim.ClaimID}\" has been added to the list.");
            Console.ReadKey();
        }
コード例 #2
0
        private void ShowNextClaim()
        {
            ClaimInformation claim = _claimRepo.PeekAtClaimQueue();

            Console.WriteLine($"Claim ID:{claim.ClaimID}\n + ClaimType:{claim.ClaimType}\n + Description:{claim.Description}\n + Amount of Damage: {claim.ClaimAmount}\n + Date Of Incident:{claim.DateOfIncident}\n + Date of Claim:{claim.DateOfClaim}\n + This claim is valid:{claim.IsValid}");
            Console.WriteLine("Do you want to deal with this claim now? (y/n)");
            string response = Console.ReadLine().ToLower();

            if (response == "y")
            {
                _claimRepo.RemoveClaimFromQueue();
            }
            else
            {
            }
        }
コード例 #3
0
 public void AddClaimToQueue(ClaimInformation claimInfo)
 {
     _claimInfo.Enqueue(claimInfo);
 }