예제 #1
0
		public bool IsIntersection(TimeTrackPartDetailsViewModel timeTrackPartDetailsViewModel)
		{
			var enterTime = timeTrackPartDetailsViewModel.EnterTime;
			var exitTime = timeTrackPartDetailsViewModel.ExitTime;
			var uid = timeTrackPartDetailsViewModel.UID;
			return DayTimeTrackParts.Any(x => x.UID != uid &&
				(x.EnterTimeSpan <= enterTime && x.ExitTimeSpan > enterTime
				|| x.EnterTimeSpan < exitTime && x.ExitTimeSpan > exitTime));
		}
예제 #2
0
		void OnAddCustomPart()
		{
			var timeTrackPartDetailsViewModel = new TimeTrackPartDetailsViewModel(DayTimeTrack, ShortEmployee, this);
			if (DialogService.ShowModalWindow(timeTrackPartDetailsViewModel))
			{
				DayTimeTrackParts.Add(new DayTimeTrackPartViewModel(timeTrackPartDetailsViewModel.UID, timeTrackPartDetailsViewModel.EnterTime, timeTrackPartDetailsViewModel.ExitTime, timeTrackPartDetailsViewModel.SelectedZone.Name));
				IsChanged = true;
				ServiceFactory.Events.GetEvent<EditTimeTrackPartEvent>().Publish(ShortEmployee.UID);
			}
		}
예제 #3
0
		void OnEditPart()
		{
			var timeTrackPartDetailsViewModel = new TimeTrackPartDetailsViewModel(DayTimeTrack, ShortEmployee, this, SelectedDayTimeTrackPart.UID, SelectedDayTimeTrackPart.EnterTimeSpan, SelectedDayTimeTrackPart.ExitTimeSpan);
			if (DialogService.ShowModalWindow(timeTrackPartDetailsViewModel))
			{
				SelectedDayTimeTrackPart.Update(timeTrackPartDetailsViewModel.EnterTime, timeTrackPartDetailsViewModel.ExitTime, timeTrackPartDetailsViewModel.SelectedZone.Name);
				IsChanged = true;
				ServiceFactory.Events.GetEvent<EditTimeTrackPartEvent>().Publish(ShortEmployee.UID);
			}
		}