/// <summary> /// Copy Tasks from other Phase /// </summary> /// <param name="fromPhase">from phase</param> /// <returns>number of tasks copied</returns> public int CopyTasksFrom(MProjectTypePhase fromPhase) { if (fromPhase == null) { return(0); } int count = 0; // Copy Type Tasks MProjectTypeTask[] fromTasks = fromPhase.GetTasks(); for (int i = 0; i < fromTasks.Length; i++) { MProjectTask toTask = new MProjectTask(this, fromTasks[i]); if (toTask.Save()) { count++; } } log.Fine("#" + count + " - " + fromPhase); if (fromTasks.Length != count) { log.Log(Level.SEVERE, "Count difference - TypePhase=" + fromTasks.Length + " <> Saved=" + count); } return(count); }
/// <summary> /// Copy Tasks from other Phase /// </summary> /// <param name="fromPhase">from phase</param> /// <returns>number of tasks copied</returns> public int CopyTasksFrom(MProjectTypePhase fromPhase) { if (fromPhase == null) { return(0); } int count = 0; int tasklinecount = 0; // Copy Type Tasks MProjectTypeTask[] fromTasks = fromPhase.GetTasks(); for (int i = 0; i < fromTasks.Length; i++) { MProjectTask toTask = new MProjectTask(this, fromTasks[i]); if (toTask.Save()) { // check if table exists then only it will copy the task lines if (PO.Get_Table_ID("C_TaskLine") > 0) { tasklinecount = CopyMTaskLines(fromTasks[i].GetC_Task_ID(), toTask.GetC_ProjectTask_ID()); } count++; } } log.Fine("#" + count + " - " + fromPhase + ", #" + tasklinecount); if (fromTasks.Length != count) { log.Log(Level.SEVERE, "Count difference - TypePhase=" + fromTasks.Length + " <> Saved=" + count); } return(count); }