/// <summary> /// Saves the daily survey result in the db & resets some items /// </summary> /// <param name="popup"></param> private void SaveDailySurvey(DailyProductivityPopUp popup) { _lastDailyPopUpResponse = DateTime.Now.Date; // no more daily pop-up for today _currentSurveyEntry.Productivity = popup.UserSelectedProductivity; _currentSurveyEntry.TimeStampFinished = DateTime.Now; Queries.SaveDailyEntry(_currentSurveyEntry); _currentSurveyEntry = null; // reset }
/// <summary> /// Handles the response to the daily popup /// </summary> /// <param name="popup"></param> private void HandleDailyPopUpResponse(DailyProductivityPopUp popup) { // user took the survey || user didn't work if ((popup.UserSelectedProductivity >= 1 && popup.UserSelectedProductivity <= 7) || popup.UserSelectedProductivity == -1) { SaveDailySurvey(popup); } // something strange happened else { _currentSurveyEntry = null; _timeRemainingUntilNextSurvey = Settings.IntervalPostponeShortInterval; } }
/// <summary> /// Saves the daily survey result in the db & resets some items /// </summary> /// <param name="popup"></param> private void SaveDailySurvey(DailyProductivityPopUp popup) { _lastDailyPopUpResponse = DateTime.Now.Date; // no more daily pop-up for today _currentSurveyEntry.Productivity = popup.UserSelectedProductivity; _currentSurveyEntry.TimeStampFinished = DateTime.Now; Queries.SaveDailyEntry(_currentSurveyEntry); _currentSurveyEntry = null; // reset }
/// <summary> /// Handles the response to the daily popup /// </summary> /// <param name="popup"></param> private void HandleDailyPopUpResponse(DailyProductivityPopUp popup) { // user took the survey || user didn't work if ((popup.UserSelectedProductivity >= 1 && popup.UserSelectedProductivity <= 7) || popup.UserSelectedProductivity == -1) { SaveDailySurvey(popup); } // something strange happened else { _currentSurveyEntry = null; _timeRemainingUntilNextSurvey = Settings.IntervalPostponeShortInterval; } }