private void Init() { TxtIssue.Text = Model.Issue; DpDate.SelectedDate = Model.Date; TxtStart.Text = Model.Start; TxtEnd.Text = Model.End; TxtDuration.Text = WorkLogHelper.SecondsToString(Model.DurationSeconds); TxtComment.Text = Model.Comment; SetTxtDuration(); TxtIssue.Focus(); }
/// <summary> /// Calculates and sets the total value for the day /// </summary> private void CalculateDayTotal() { var totalSeconds = _logs.Sum(log => log.DurationSeconds); LblCurrentDayTotal.Content = WorkLogHelper.SecondsToString(totalSeconds); }
private void SetTxtDuration() { var durationSeconds = WorkLogHelper.CalculateDurationSeconds(TxtStart.Text, TxtEnd.Text); TxtDuration.Text = WorkLogHelper.SecondsToString(durationSeconds); }