Exemple #1
0
        private void NextClaim()
        {
            Console.Clear();
            if (_repo.ClaimsCount() > 0)
            {
                Claims nextClaim = _repo.ClaimsPeek();
                Console.WriteLine($"\n\t ClaimID: #{nextClaim.ClaimID}\n" +
                                  $"\t Type: \t\t\t{nextClaim.Type}\n" +
                                  $"\t Description: \t\t{nextClaim.Description}\n" +
                                  $"\t Amount: \t\t${nextClaim.Amount}\n" +
                                  $"\t Date of Accident: \t{nextClaim.DateOfAccident}\n" +
                                  $"\t Date of Claim: \t{nextClaim.DateOfClaim}\n" +
                                  $"\t IsValid: \t\t{nextClaim.IsValid}");

                Console.Write("\n\t Would you like to take care of this claim? y/n ");
                string input = Console.ReadLine();
                switch (input.ToLower())
                {
                case "y":
                case "yes":
                    _repo.DequeueClaims();
                    Console.WriteLine("\n\t Queue has been updated");
                    Console.ReadKey();
                    Console.Clear();
                    break;

                case "n":
                case "no":
                    Console.WriteLine("\n\t Returning to main menu");
                    Console.ReadKey();
                    Console.Clear();
                    //MenuAccess();
                    break;

                default:
                    Console.WriteLine("\n\t Please enter a valid option");
                    Console.ReadKey();
                    NextClaim();
                    break;
                }
            }
            else
            {
                Console.WriteLine("\n\t There are no more claims to take care of. \n");
            }
        }