Example #1
0
        public void PunchOut(DateTime when)
        {
            // When punching out, set the end time and clear
            // the current entry
            if (_currentTimeEntryRow != null)
            {
                _currentTimeEntryRow.EndTime = when;

                TimeTrackerDataSet.TimeEntriesRow _punchedOutTimeEntryRow = _currentTimeEntryRow;

                _currentTimeEntryRow = null;

                RaiseUserPunchedOut(_currentProjectRow, _punchedOutTimeEntryRow);
            }
        }
Example #2
0
        public void PunchIn()
        {
            //If already punched in, no need to punch in
            if (_currentTimeEntryRow != null)
            {
                return;
            }

            // This should never happen...
            Debug.Assert(_currentProjectRow != null, "Unable to punch in when CurrentProjectRow is not set");

            _currentTimeEntryRow             = ds.TimeEntries.NewTimeEntriesRow();
            _currentTimeEntryRow.StartTime   = DateTime.Now;
            _currentTimeEntryRow.ProjectsRow = _currentProjectRow;
            ds.TimeEntries.AddTimeEntriesRow(_currentTimeEntryRow);

            RaiseUserPunchedIn(_currentProjectRow, _currentTimeEntryRow);
        }
Example #3
0
 private void RaiseUserPunchedOut(TimeTrackerDataSet.ProjectsRow projectEntry, TimeTrackerDataSet.TimeEntriesRow timeEntryRow)
 {
     UserPunchedOut?.Invoke(this, new TimeTrackerEvent(projectEntry, timeEntryRow));
 }
Example #4
0
 public TimeTrackerEvent(TimeTrackerDataSet.ProjectsRow projectEntry, TimeTrackerDataSet.TimeEntriesRow timeEntry)
 {
     ProjectEntry = projectEntry;
     TimeEntry    = timeEntry;
 }