/// <summary> /// will build the list of tasks from the data base /// note: should wrap in try catch /// </summary> /// <param name="DB">The Database</param> /// <param name="ProjectID">The ProjectID to select from</param> public Project_Tasks_And_Links(MVCTaskMasterAppDataEntities2 DB, int ProjectID) { //grab the projects and start adding them to the list using (ObjectResult <SelectTasksByProjectID_Result> OJ = DB.SelectTasksByProjectID(ProjectID)) { List <SelectTasksByProjectID_Result> TasksIn = OJ.ToList(); Tasks = new List <ProjectTasks>(TasksIn.Count); foreach (SelectTasksByProjectID_Result R in TasksIn) { Tasks.Add(new ProjectTasks(R)); } } //after we have all the projects start to grab the linkers foreach (ProjectTasks T in Tasks) { using (ObjectResult <SelectLinkerByTaskID_Result> OJ = DB.SelectLinkerByTaskID(T.TaskID)) { List <SelectLinkerByTaskID_Result> Linkers = OJ.ToList(); // foreach linker grab that task and set its next task foreach (SelectLinkerByTaskID_Result R in OJ) { T.AddNextTask(R.NextTaskID); } //get all the next and set them accordingly //.. foreach next task set the data to the prev one foreach (ProjectTasks TNext in Tasks.Where(X => T.NextTask.Contains(X.TaskID))) { TNext.AddPreTask(T.TaskID); } } } ProjectTasks[] TempTasks = Tasks.Where(x => { return(x.PrevTask.Count() == 0); }).ToArray(); for (int CN = 0; CN < TempTasks.Count(); CN++) { int NInC = 0; TempTasks[CN].NumberInChain = CN; TempTasks[CN].NumberInChain = NInC; NInC++; TaskChainBuilder(TempTasks[CN], ref NInC); } }
public string GenericIfcMethod <T3> (TTarget t1, TNext t2, T3 t3) { return("IVeryGenericMixin.GenericIfcMethod-" + t3); }