/// <summary> /// Callback method for AddUserPreferenceBenchmark Service call - adds benchmark to selected group /// </summary> /// <param name="result">True/False</param> private void AddUserPreferenceBenchmarkCallBackMethod(bool result) { string methodNamespace = String.Format("{0}.{1}", GetType().FullName, System.Reflection.MethodInfo.GetCurrentMethod().Name); Logging.LogBeginMethod(_logger, methodNamespace); try { if (result != false) { Logging.LogMethodParameter(_logger, methodNamespace, result, 1); if (_selectedMorningSnapshotRow.MorningSnapshotPreferenceInfo.BenchmarkName == null) { MorningSnapshotInfo.Remove(_selectedMorningSnapshotRow); } _dbInteractivity.RetrieveMorningSnapshotData(new List <UserBenchmarkPreference> { _selectedUserBenchmarkPreference }, RetrieveMorningSnapshotDataCallBackMethod); RefreshContextMenu(); } else { Logging.LogMethodParameterNull(_logger, methodNamespace, 1); } } catch (Exception ex) { MessageBox.Show("Message: " + ex.Message + "\nStackTrace: " + Logging.StackTraceToString(ex), "Exception", MessageBoxButton.OK); Logging.LogException(_logger, ex); } Logging.LogEndMethod(_logger, methodNamespace); }
/// <summary> /// Callback method for AddUserPreferenceBenchmark Service call - adds benchmark to selected group /// </summary> /// <param name="result">True/False</param> private void RemoveUserPreferenceBenchmarkCallBackMethod(bool result) { string methodNamespace = String.Format("{0}.{1}", GetType().FullName, System.Reflection.MethodInfo.GetCurrentMethod().Name); Logging.LogBeginMethod(_logger, methodNamespace); try { if (result != false) { Logging.LogMethodParameter(_logger, methodNamespace, result, 1); int groupBenchmarkCount = MorningSnapshotInfo.Where(i => i.MorningSnapshotPreferenceInfo.GroupName == _selectedMorningSnapshotRow.MorningSnapshotPreferenceInfo.GroupName).Count(); if (groupBenchmarkCount == 1) { MorningSnapshotInfo.Add(new MorningSnapshotData() { MorningSnapshotPreferenceInfo = new UserBenchmarkPreference() { GroupName = _selectedMorningSnapshotRow.MorningSnapshotPreferenceInfo.GroupName } }); } MorningSnapshotInfo.Remove(_selectedMorningSnapshotRow); RefreshContextMenu(); } else { Logging.LogMethodParameterNull(_logger, methodNamespace, 1); } } catch (Exception ex) { MessageBox.Show("Message: " + ex.Message + "\nStackTrace: " + Logging.StackTraceToString(ex), "Exception", MessageBoxButton.OK); Logging.LogException(_logger, ex); } Logging.LogEndMethod(_logger, methodNamespace); }