Наследование: INotifyPropertyChanging, INotifyPropertyChanged
Пример #1
0
        public WorkItemTimeEntryDetails StartWorkItem(Guid workItemId, DateTime? startTime)
        {
            var workItem = repository.Query<WorkItem>().Where(x => x.Id == workItemId).FirstOrDefault();

            if(workItem.TimeEntries.Any(x => x.EndTime == null))
            {
                throw new Exception("Work item already started");
            }

            var timeEntry = new TimeEntry
                            {
                                Id = Guid.NewGuid(),
                                StartTime = startTime??dateTimeTasks.Now(),
                                    WorkItem = workItem
                            };

            repository.Insert(timeEntry);

            return new WorkItemTimeEntryDetails
                   	{
                   		StartTime = timeEntry.StartTime,
                            WorkItemId = workItem.Id
                   	};
        }
Пример #2
0
		private void detach_TimeEntries(TimeEntry entity)
		{
			this.SendPropertyChanging();
			entity.WorkItem = null;
		}