private void btnReject_Click(object sender, RoutedEventArgs e) { RejectionReason rejectionReason = new RejectionReason(); rejectionReason.ShowDialog(); Tuple <bool, string> rejectionResult = rejectionReason.result; // once we do this we know the string cannot be empty if (rejectionResult == null) { return; } if (!rejectionResult.Item1) { return; } string str = rejectionResult.Item2; List <Entry> entries = new List <Entry>(); for (int i = 0; i < dgHours.SelectedItems.Count; i++) { entries.Add((Entry)dgHours.SelectedItems[i]); } queries.Approval_Reject(entries, str); RefreshDGHoursFromClassList(); savedRejectReason = "No Reason Provided, See Manager"; }