//DELETE public bool RemoveDataFromDir(double claimID) { ClaimLibrary data = GetDataByClaimID(claimID); if (data == null) { return(false); } int intialCount = _claimsDir.Count; _claimsDir.Dequeue(); if (intialCount > _claimsDir.Count) { return(true); } else { return(false); } }
//UPDATE public bool UpdateDataFromDir(int existingClaimID, ClaimLibrary newData) { //Find the original content ClaimLibrary existingData = GetDataByClaimID(existingClaimID); //Update the content if (existingData != null) { existingData.ClaimID = newData.ClaimID; existingData.ClaimType = newData.ClaimType; existingData.Description = newData.Description; existingData.Settlement = newData.Settlement; existingData.IncidentDate = newData.IncidentDate; existingData.ClaimDate = newData.ClaimDate; existingData.Valid = newData.Valid; return(true); } else { return(false); } }
//CRUD //CREATE public void AddDataToList(ClaimLibrary data) { _claimsDir.Enqueue(data); }