private void DisplayClaimQueue() { Console.WriteLine($"\n{"ClaimId", -7} {"Type", -7} {"Description", -20} {"Amount", -12} {"DateOfAccident", -15} {"DateOfClaim", -15} {"IsValid"}"); int i = 0; foreach (Claim claim in _claimRepository.GetClaimsQueue()) { i++; Console.WriteLine($"{claim.ClaimId, -7} {claim.ClaimType, -7} {claim.Description, -20} {claim.ClaimAmount, -12:C} {claim.DateOfIncident.ToShortDateString(), -15} {claim.DateOfClaim.ToShortDateString(), -15} {claim.IsValid}"); } Console.WriteLine("\nPress any key to return to menu..."); Console.ReadKey(); }
public void Run() { Claim firstClaim = new Claim(1, "Car", "Car accident on 465.", 400.00m, new DateTime(2018, 04, 25), new DateTime(2018, 04, 27), true); Claim secondClaim = new Claim(2, "House", "House fire in kitchen.", 4000.00m, new DateTime(2018, 04, 26), new DateTime(2018, 04, 28), true); Claim thirdClaim = new Claim(3, "Theft", "Stolen pancakes.\t", 4.00m, new DateTime(2018, 04, 27), new DateTime(2018, 06, 01), false); _contentClaim.AddContentToQueue(firstClaim); _contentClaim.AddContentToQueue(secondClaim); _contentClaim.AddContentToQueue(thirdClaim); queItems = _contentClaim.GetClaimsQueue(); bool isRunning = true; while (isRunning) { Console.WriteLine("Choose a menu item:" + "\n1. See all claims" + "\n2. Take care of next claim" + "\n3. Enter a new claim" + "\n4. Exit"); int input = int.Parse(Console.ReadLine()); switch (input) { case 1: //see all claims ViewClaimQueue(); break; case 2: //take care of next claim TakeCareOfNextClaim(); break; case 3: //enter a new claim EnterNewClaim(); break; case 4: //exit isRunning = false; break; default: Console.WriteLine("Invalid response. (1-4)"); Console.ReadLine(); break; } } }