public UnAssignResource(RHumanResource resource, Release release, Project project, Milestone milestone, Deliverable deliverable, Activity activity, Period period) { _resource = resource; _release = release; _milestone = milestone; _deliverable = deliverable; _activity = activity; _period = period; _project = project; }
public PlanReleaseResource(RHumanResource resource, Release release, Project project, Milestone milestone, Deliverable deliverable, Activity activity, Period period, double focusFactor) { _resource = resource; _release = release; _milestone = milestone; _deliverable = deliverable; _activity = activity; _focusFactor = focusFactor; _period = period; _project = project; }
/// <summary> /// UnAssign the resource from the specified deliverable activity /// </summary> /// <param name="str"></param> /// <returns></returns> public static void UnAssignFromRelease(this RHumanResource person, Release release, Project project, Milestone milestone, Deliverable deliverable, Activity activity, Period assignedPeriod) { var rep = new ResourceRepository(); try { rep.DeleteReleaseAssignment(release.Id, project.Id, person.Id, milestone.Id, deliverable.Id, activity.Id, assignedPeriod.StartDate, assignedPeriod.EndDate); } catch (Exception ex) { throw; } }
/// <summary> /// Plan the resource for an assignment /// </summary> /// <param name="str"></param> /// <returns></returns> public static void PlanForRelease(this RHumanResource person, RReleasePlanning release, Project project, Milestone milestone, Deliverable deliverable, Activity activity, Period assignedPeriod, double focusFactor) { var rep = new ResourceRepository(); try { rep.SaveReleaseAssignment(release.Id, project.Id, person.Id, milestone.Id, deliverable.Id, activity.Id, assignedPeriod.StartDate, assignedPeriod.EndDate, focusFactor); // make sure we have status records for all release, project, milestone and deliverable combinations if (release.Milestones.Count == 0) release.LoadPhasesAndMilestonesAndProjects(); release.GenerateMilestoneStatusRecords(); } catch (Exception ex) { throw; } }
public JsonResult SaveDeliverableStatus(DeliverableStatusInputModel obj) { //var rep = new ReleaseRepository(); //rep.SaveDeliverableStatus(obj); var del = new Deliverable { Id = obj.DeliverableId }; foreach(var proj in obj.Scope) { var project = new Project { Id = proj.Id }; foreach (var act in proj.Workload) { project.Workload.Add(new ActivityStatus { Activity = act.Activity, HoursRemaining = act.HoursRemaining }); } del.Scope.Add(project); } var ms = new Milestone { Id = obj.MilestoneId, Release = new Release { Id = obj.ReleaseId } }; var uc = new UpdateMilestoneDeliverableStatus(del, ms); uc.Execute(); var result = this.Json("Saved", JsonRequestBehavior.AllowGet); return result; }
public List<Release> GetReleaseSnapshotsWithProgressData() { var conn = new SqlConnection("Data Source=localhost\\SQLENTERPRISE;Initial Catalog=Planner;Integrated Security=SSPI;MultipleActiveResultSets=true"); var allMilestones = new List<Milestone>(); try { using (conn) { conn.Open(); var cmd = new SqlCommand("sp_get_release_snapshots_with_progress_data", conn); cmd.CommandType = System.Data.CommandType.StoredProcedure; using (var reader = cmd.ExecuteReader()) { while (reader.Read()) { // get records with PhaseId, PhaseTitle, MilestoneId, MilestoneTitle var status = new Milestone { Id = int.Parse(reader["MilestoneId"].ToString()), Title = reader["MilestoneTitle"].ToString(), Release = new Release { Id = int.Parse(reader["PhaseId"].ToString()), Title = reader["PhaseTitle"].ToString() } }; allMilestones.Add(status); } } } // create hierarchical structure var phases = allMilestones .GroupBy(m => new { m.Release.Id, m.Release.Title }, // group by two columns, making an ANONYMOUS object m => new Milestone { Id = m.Id, Title = m.Title }, // every grouped record contains an IEnumerable<Milestone> (key, values) => new Release(values.ToList()) { Id = key.Id, Title = key.Title }); // key is the grouping columns, values is the IEnumerable<Milestone> from 2nd param function // create a new Release object //var phases = allMilestones // .GroupBy(m => new { m.Release.Id, m.Release.Title }) // group by two columns, making a Release object // .Select(m => new Release(m.ToList()) { Id = m.Key.Id, Title = m.Key.Title }); return phases.ToList(); } catch (Exception ex) { throw; } }