コード例 #1
0
ファイル: TimeRecordService.cs プロジェクト: ralescano/castle
		public void StartClock(Task selectedTask)
		{
			if (selectedTask == null)
			{
				throw new ArgumentNullException("Task cannot be null");
			}
			
			// Creates the record
			
			currentRecord = new TimeRecord();
			
			currentRecord.StartedDate = DateTime.Now;
			currentRecord.Task = selectedTask;
			
			timeDataAccess.Insert(currentRecord);
			
			// Creates the event
			
			TimeRecordEvent timeEvent = new TimeRecordEvent(currentRecord, EventType.Started, DateTime.Now);
			
			timeDataAccess.InsertEvent(timeEvent);
			
			currentClockState = EventType.Started;
		}
コード例 #2
0
		public void Insert(TimeRecord record)
		{
			records.Add(record);
		}
コード例 #3
0
		public TimeRecordEvent(TimeRecord parentRecord, EventType eventType, DateTime time)
		{
			this.parentRecord = parentRecord;
			this.eventType = eventType;
			this.time = time;
		}