public void AddNewClaim()
        {
            Console.Clear();
            var newClaim = new Claim();

            Console.WriteLine("welcome, this is where you will add the new claim from our customer");
            Console.WriteLine("please enter the claim Id");
            newClaim.ClaimID = int.Parse(Console.ReadLine());
            Console.WriteLine("now enter the description of the claim");
            newClaim.Description = Console.ReadLine();
            Console.WriteLine("please choose the claimtype \n" + "1.car \n" + "2.Home \n" + "3.Theft\n" + "4.Other");
            var claimType = int.Parse(Console.ReadLine());

            newClaim.TypeofClaim = (ClaimType)claimType;
            Console.WriteLine("please enter the claim amount");
            newClaim.ClaimAmount = double.Parse(Console.ReadLine());
            Console.WriteLine("please enter the date of the accident");
            var dateOfInc = Console.ReadLine();

            newClaim.DateOfIncident = DateTime.Parse(dateOfInc);
            Console.WriteLine("please enter the date of the claim being filed, please make sure it is under 30 days otherwise the claim will be invalid");
            var dateOfEntry = Console.ReadLine();

            newClaim.DateOfClaim = DateTime.Parse(dateOfEntry);
            _repo.addNewClaim(newClaim);
            Console.WriteLine("please make sure that you have entered all the information correctly, when you are finished you can press enter to return to the main screen");
            Console.ReadLine();
        }
        public void SeedMyQueue()
        {
            var ClaimOne   = new Claim(1, ClaimType.Car, "car accident on 465", 400.00, new DateTime(04 / 25 / 2018), new DateTime(04 / 27 / 18));
            var ClaimTow   = new Claim(2, ClaimType.Home, "house fire in kitchen", 4000.00, new DateTime(04 / 11 / 2018), new DateTime(04 / 11 / 18));
            var ClaimThree = new Claim(3, ClaimType.Theft, "stolen pancakes", 4.00, new DateTime(04 / 27 / 18), new DateTime(06 / 01 / 18));

            _repo.addNewClaim(ClaimOne);
            _repo.addNewClaim(ClaimTow);
            _repo.addNewClaim(ClaimThree);
        }
        public void ShowNextClaim()
        {
            Console.WriteLine("here is the next claim for you to take a peek at \n");
            Queue <Claim> newList   = _repo.ShowAllClaims();
            Claim         nextClaim = newList.Peek();

            Console.WriteLine($"ClaimID:{nextClaim.ClaimID}\n" +
                              $"Type:{nextClaim.TypeofClaim}/n" +
                              $"Amount:{nextClaim.ClaimAmount}\n" +
                              $"description:{nextClaim.Description}\n" +
                              $"date of incident:{nextClaim.DateOfIncident}\n" +
                              $"date filed:{nextClaim.DateOfClaim} \n" +
                              $"do you want to take care of this claim (y/n)");



            string userInput = Console.ReadLine();

            switch (userInput)
            {
            case "y":
                newList.Dequeue();
                break;

            case "n":

            {
                break;
            }

            default:
            {
                break;
            }
            }
        }
Esempio n. 4
0
 private void DisplayContentID(Claim claim)
 {
     Console.WriteLine($"{claim.ClaimID,-8} {claim.ClaimValid}");
 }
Esempio n. 5
0
 private void DisplayContent(Claim claim)
 {
     Console.WriteLine($"{claim.ClaimID,-8} {claim.ClaimType,-11} {claim.ClaimDescribe,-25} {claim.ClaimAmount,-7} {claim.ClaimAccident.ToString("MM/dd/yyyy"),-17} {claim.ClaimDate.ToString("MM/dd/yyyy"),-15} {claim.ClaimValid}");
 }
Esempio n. 6
0
 //create
 public bool Add(Claim claim)
 {
     _claims.Enqueue(claim);
     return(true);
 }