예제 #1
0
파일: Task.cs 프로젝트: StefanAniff/hb.trex
        public virtual void RemoveTimeEntry(int timeEntryId)
        {
            var timeEntry = TimeEntries.Single(te => te.Id == timeEntryId);

            if (timeEntry == null)
            {
                throw new EntityDeleteException("Timeentry not found in task: " + timeEntryId);
            }

            if (timeEntry.Invoice != null)
            {
                throw new EntityDeleteException("Timeentry cannot be deleted when billed: Id:" + timeEntry.Id);
            }

            TimeEntries.Remove(timeEntry);
        }