protected Allocation( Resource resource, TActivity activity, TimeQuantity period) { this.Resource = resource; this.Activity = activity; this.Period = period; }
private void DoCreate(int timeValue) { ATrigger.Initialize(Cores.Strings.ATriggerApiKey, Cores.Strings.ATriggerApiSecret); var tags = new Dictionary <string, string> { { "type", Cores.Strings.GenRandText(11, false) } }; ATrigger.Client.doCreate(TimeQuantity.Minute(), timeValue.ToString(), this.SendStoryApiUrl, tags); }
public virtual void ClockIn(DateTime eventDate, AllocatableResource resource, TimeQuantity timeSpent) { var entry = new Allocation <TActivity>(resource, this, eventDate, timeSpent); if (_allocations.ContainsKey(eventDate)) { Check.Require(_allocations[eventDate].Resource.Equals(resource), "This method requires that the same resource is the resource in this allocation."); _allocations[eventDate] = entry; } else { _allocations.Add(eventDate, entry); } }
public Allocation(AllocatableResource resource, TActivity activity, DateTime eventDate, TimeQuantity timeSpent) { Check.RequireNotNull <IResource>(resource); Resource = resource; Check.RequireNotNull <Activities.Activity>(activity); Activity = activity; Check.Require(timeSpent.Amount >= 0, Msgs.Allocation_NegativeTimeSpent); TimeSpentPeriod = _toTimeSpentPeriod(eventDate, timeSpent); }