Пример #1
0
 protected Allocation(
     Resource resource, TActivity activity, TimeQuantity period)
 {
     this.Resource = resource;
     this.Activity = activity;
     this.Period   = period;
 }
Пример #2
0
        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);
        }
Пример #3
0
    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);
        }
    }
Пример #4
0
 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);
 }