private void UpdateMilestoneCodeActivity_ExecuteCode(object sender, EventArgs e) { using (Entities _edc = new Entities(this.workflowProperties.Web.Url)) { CAS.AgileWorkloadTracker.DataModel.Linq.Milestone _mlstne = _edc.Milestone.GetAtIndex <CAS.AgileWorkloadTracker.DataModel.Linq.Milestone>(workflowProperties.ItemId); _mlstne.MilestoneHours = _mlstne.Requirements.Sum <Requirements>(a => a.Hours); _hours = _mlstne.MilestoneHours.Value; _tasks = _mlstne.Tasks0.Count; _edc.SubmitChanges(); _activeTasks = _mlstne.Tasks0.Where <Tasks>(tsk => tsk.Active.GetValueOrDefault(false)).Count <Tasks>(); } }
/// <summary> /// Moves this instance of <see cref="Requirements"/> to specified <paramref name="target"/>. /// </summary> /// <param name="edc">The instance of <see cref="Entities"/>.</param> /// <param name="target">The target <see cref="Milestone"/>.</param> internal void Move(Entities edc, Milestone target) { this.Requirements2MilestoneTitle = target; MakeConsistent(edc); }