FrmWorkLog: Fix NRE changing start date of a work log.

This commit is contained in:
2021-05-13 19:01:19 +02:00
parent 2e8f8c6c8d
commit fb898e4bde

View File

@@ -435,14 +435,16 @@ namespace VAR.Toolbox.UI.Tools.WorkLog
private void WorkLogItem_Update(bool refresh = true) private void WorkLogItem_Update(bool refresh = true)
{ {
if (_currentWorkLogItem == null) { return; } if (_currentWorkLogItem == null) { return; }
_currentWorkLogItem.DateStart = dtStart.Value; DateTime dateStart = dtStart.Value;
_currentWorkLogItem.DateStart = dateStart;
_currentWorkLogItem.DateEnd = dtEnd.Value; _currentWorkLogItem.DateEnd = dtEnd.Value;
_currentWorkLogItem.Activity = txtActivity.Text; _currentWorkLogItem.Activity = txtActivity.Text;
_currentWorkLogItem.Description = txtDescription.Text; _currentWorkLogItem.Description = txtDescription.Text;
if (refresh) if (refresh)
{ {
lsbWorkLog.SelectedIndex = -1;
WorkLog_Refresh(); WorkLog_Refresh();
WorkLog_SelectDate(_currentWorkLogItem.DateStart); WorkLog_SelectDate(dateStart);
} }
WorkLog_MarkDirty(); WorkLog_MarkDirty();
} }