// used to refresh the all question sets in the UI list private void RefreshQuestionSetList() { // verify that the current user is valid if (currentUser == null) { completeStenerStatusLabel.Text = "No valid user logged in!"; return; } // retrieve current user's uid var currentUserDepartmentUid = currentUser.DepartmentUid; //get all question sets for the department var qSets = stenerManagement.GetQuestionSetsForDepartment(currentUserDepartmentUid); completeQuestionSetListView.Items.Clear(); // loop through each question set that was retrieved foreach (var qSet in qSets) { string[] row = { qSet.Priority.ToString(), qSet.UniqueID.ToString(), qSet.Questions.Count.ToString(), qSet.DueDate.ToString("MM/dd/yyyy"), qSet.Status, qSet.Category, qSet.SubmittedDate.Equals(new DateTime()) ? "" : qSet.SubmittedDate.ToString("MM/dd/yyyy") }; var listItem = new ListViewItem(row); // add the data to the ui. completeQuestionSetListView.Items.Add(listItem); } }
public void StartProcess(UserData notificationsUser) { userToMonitor = notificationsUser; // Initial questions to compare var initialQuestionSets = stenerManagement.GetQuestionSetsForDepartment(notificationsUser.DepartmentUid); // Time parameters var startTimeSpan = TimeSpan.Zero; var periodTimeSpan = TimeSpan.FromMinutes(5); // Every 5 minutes this runs, if data, popup appears var timer = new Timer(e => { var toBeDisplayed = RefreshNotifications(initialQuestionSets, userToMonitor); var totalString = ""; if (toBeDisplayed != null) { foreach (var qs in toBeDisplayed) { var statusString = qs.Status; totalString += "Status: " + statusString + " StenerSetID: "; var idString = qs.UniqueID.ToString(); totalString += idString + "; "; } } MessageBox.Show(totalString); }, null, startTimeSpan, periodTimeSpan); }
private void refreshQuestionSetList() { if (currentUser == null) { completeStenerStatusLabel.Text = "No valid user logged in!"; return; } int departmentID = currentUser.DepartmentUID; //get all question sets for the department List <QuestionSet> qSets = stenerManagement.GetQuestionSetsForDepartment(departmentID); completeQuestionSetListView.Items.Clear(); foreach (QuestionSet qSet in qSets) { string[] row = { qSet.Priority.ToString(), qSet.UniqueID.ToString(), qSet.Questions.Count.ToString(), qSet.DueDate.ToString("MM/dd/yyyy"), qSet.Status.ToString(), qSet.Category, (qSet.SubmittedDate.Equals(new DateTime()) ? "" : qSet.SubmittedDate.ToString("MM/dd/yyyy")) }; var listItem = new ListViewItem(row); completeQuestionSetListView.Items.Add(listItem); } }