//Writes quickstat items to the master list if it does not already exist private static void AddToQuickStats(UserQuickStat quickStat) { int index = FindQuickStatItem(quickStat); if (index == -1) { ApplicationData.QuickStatistics.UserQuickStats.Add(quickStat); } else { ApplicationData.QuickStatistics.UserQuickStats[index].UpdateQuickStat(quickStat); } }
public void UpdateQuickStat(UserQuickStat quickStat) { UserID = quickStat.UserID; TotalReplies = quickStat.TotalReplies; TotalConversations = quickStat.TotalConversations; HappinessScore = quickStat.HappinessScore; HandleTime = quickStat.HandleTime; CustomersHelped = quickStat.CustomersHelped; ConversationsCreated = quickStat.ConversationsCreated; TotalRatingsCount = quickStat.TotalRatingsCount; GreatRatingsCount = quickStat.GreatRatingsCount; }
//Finds and returns the idex of a quickstat item in teh master list private static int FindQuickStatItem(UserQuickStat quickStat) { for(int i = 0; i <= ApplicationData.QuickStatistics.UserQuickStats.Count; i++) { if(ApplicationData.QuickStatistics.UserQuickStats[i].Name == quickStat.Name) { return i; } } return -1; }