private string getWorkSpanEnd(int workSpanIndex, bool isInterruption = false) { if (!this.IsNotificationTurnedOn()) { return(""); } WorkSpan srcWorkSpan = isInterruption ? _dayData.WorkInterruptions[workSpanIndex] : _dayData.WorkSpans[workSpanIndex]; DateTime endTimeWithCorrections = srcWorkSpan.GetEndTimeIncludingCorrections(); if (endTimeWithCorrections.Hour == 0 && endTimeWithCorrections.Minute == 0) { return(""); } else { return(string.Format("{0:t}", endTimeWithCorrections)); } }
private void setWorkSpanEnd(int workSpanIndex, string value, bool isInterruption = false) { WorkSpan destWorkSpan = isInterruption ? _dayData.WorkInterruptions[workSpanIndex] : _dayData.WorkSpans[workSpanIndex]; if (this.IsChangeByUserAllowed) { destWorkSpan.CorrectionEndTime = TimeMerge.Utils.Calculations.StringToDateTime(value, _parentMonthVM.YearMonth.Year, _parentMonthVM.YearMonth.Month, Day); } else { destWorkSpan.EndTime = TimeMerge.Utils.Calculations.StringToDateTime(value, _parentMonthVM.YearMonth.Year, _parentMonthVM.YearMonth.Month, Day); // Setting start/end time from remote web server doesn't mean we'll lose our manual corrections // _dayData.WorkSpans[workSpanIndex].HasCorrectionData = false; } string changedPropertyBaseName = isInterruption ? "Interrupt" : "WorkSpan"; NotifyPropertyChanged(string.Format("{0}{1}End", changedPropertyBaseName, workSpanIndex)); NotifyPropertyChanged("Duration"); NotifyPropertyChanged("HasAutoDecrementedLunchTime"); NotifyPropertyChanged(string.Format("{0}{1}HasCorrections", changedPropertyBaseName, workSpanIndex)); NotifyPropertyChanged(string.Format("{0}{1}ToolTip", changedPropertyBaseName, workSpanIndex)); NotifyPropertyChanged(string.Format("{0}{1}VirtualTimeEnding", changedPropertyBaseName, workSpanIndex)); }