private void DisplayContentByID()
        {
            Console.Clear();

            Console.WriteLine("Please enter claim ID.");

            int claimID = int.Parse(Console.ReadLine());

            ClaimContent claimContent = _claimsRepository.GetClaimByClaimID(claimID);

            if (claimContent != null)
            {
                Console.WriteLine($"Claim ID: {claimContent.ClaimID}\n" +
                                  $"Claim Type: {claimContent.ClaimType}\n" +
                                  $"Description: {claimContent.Description}\n" +
                                  $"Claim Amount: {claimContent.ClaimAmount}\n" +
                                  $"Date of the Incident: {claimContent.DateOfIncident.ToShortDateString()}\n" +
                                  $"Date of the Claim: {claimContent.DateOfClaim.ToShortDateString()}\n" +
                                  $"Valid? {claimContent.IsValid}");
            }
            else
            {
                Console.WriteLine("No claims by that ID exist.");
            }
        }
 private void DisplayClaim(ClaimContent claimContent)
 {
     Console.WriteLine($"Claim ID: {claimContent.ClaimID}\n" +
                       $"Type: {claimContent.ClaimType}.\n" +
                       $"Description: {claimContent.Description}\n" +
                       $"Amount: {claimContent.ClaimAmount}\n" +
                       $"Date of Accident: {claimContent.DateOfIncident}\n" +
                       $"Date of Claim: {claimContent.DateOfClaim}\n" +
                       $"Is the claim valid: {claimContent.IsValid}\n");
 }
Beispiel #3
0
        //Delete                       ----------------Having a difficult time trying to delete.
        public bool RemoveClaimFromList(int claimID)
        {
            ClaimContent claim = GetClaimByClaimID(claimID);

            if (claim == null)
            {
                return(false);
            }

            int initialCount = _listOfClaims.Count;

            if (initialCount > _listOfClaims.Count)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #4
0
        //Update
        public bool UpdateClaim(int originalID, ClaimContent newClaim)
        {
            // Find the claim
            ClaimContent oldClaim = GetClaimByClaimID(originalID);

            // Update the claim
            if (oldClaim != null)
            {
                oldClaim.ClaimID        = newClaim.ClaimID;
                oldClaim.ClaimType      = newClaim.ClaimType;
                oldClaim.Description    = newClaim.Description;
                oldClaim.ClaimAmount    = newClaim.ClaimAmount;
                oldClaim.DateOfIncident = newClaim.DateOfIncident;
                oldClaim.DateOfClaim    = newClaim.DateOfClaim;
                //Deleted the bool from if statement
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #5
0
        private Queue <ClaimContent> _listOfClaims = new Queue <ClaimContent>();  //Switched to Queue instead of List due to difficulty making the UI work.

        //Create
        public void AddClaimToList(ClaimContent claim)
        {
            _listOfClaims.Enqueue(claim);
        }