// returns a list of how many publications a researcher has published for a given start year finish public static List <int[]> CumulativeCount(DateTime startDate, DateTime finishDate, int Id) { int count = 0; // how many publications for a particular year int year = startDate.Year; // the year being counted List <Publication> publications = DbAdaptor.fetchPublicaionCount(Id); List <int[]> PubCount = new List <int[]>(); while (year <= finishDate.Year) { count = 0; for (int i = 0; i < publications.Count; i++) { if (publications[i].Year == year) { count++; } } int[] yearCount = { year, count }; PubCount.Add(yearCount); year++; } return(PubCount); }
public static List <Publication> loadPublications(Researcher researcher) { String name = researcher.GivenName + " " + researcher.FamilyName; List <Publication> publications; publications = DbAdaptor.fetchBasicPublicationDetails(name); publications.Sort((p1, p2) => p1.Year.CompareTo(p2.Year)); publications.Reverse(); return(publications); }
//used to add the level variable to the basic information in the list of researchers public static List <Researcher> addLevel(List <Researcher> researchers) { int length = researchers.Count; char level; for (int i = 0; i < length; i++) { researchers[i].level = DbAdaptor.getLevel(researchers[i].Id); } return(researchers); }
public static Publication loadPublicationDetails(Publication publication) { return(DbAdaptor.completePublicationDetails(publication)); }
// loads the details for one spesific researcher given an Id public static Researcher loadResearcherDetails(int Id) { return(DbAdaptor.fetchFullResearcherDetails(Id)); }
// loads all basic researcher details into a list public static List <Researcher> loadResearchers() { return(DbAdaptor.fetchBasicResearcherDetails()); }