Schreiben aktualisierter TaskLink -Daten an MPP in Ruby
Contents
[
Hide
Show
]Aspose.Tasks - Schreiben aktualisierter TaskLink -Daten an MPP
So schreiben Sie aktualisierte TaskLink -Daten an MPP mit Aspose.Tasks java für Ruby, einfach auf updateTaskLink Modul aufzurufen. Hier sehen Sie Beispielcode.
Rubincode
1ONE_SEC = 10000000
2
3ONE_MIN = 60 * ONE_SEC
4
5ONE_HOUR = 60 * ONE_MIN
6
7project = rjb :: import ('com.aspsient.tasks.project'). new ('test_tasks.mpp')
8
9tsk = rjb :: import ('com.aspsient.tasks.tsk'))
10
11prj = rjb :: import ('com.aspsient.tasks.prj')
12
13task1 = project.getroottask (). getChildren (). add ("1")
14
15task1.set (tsk.duration, project.getDuration (8, rjb :: import ('com.asispor.tasks.TimeUnitType'). Stunde)))
16
17Task1.set (tsk.start, project.get (prj.start_date))
18
19Task1.set (tsk.finish, project.get (prj.calendar) .gettaskfinishDateFromDuration (Task1, Task1.get (tsk.duration) .todouble ()))
20
21task2 = project.getroottask (). getChildren (). add ("2")
22
23Task2.set (tsk.duration, project.getDuration (8, rjb :: import ('com.asispor.tasks.timeUnITType'). Stunde)))
24
25Task2.set (tsk.start, project.get (prj.start_date))
26
27Task2.set (tsk.finish, project.get (prj.calendar) .gettaskfinishDateFromDuration (Task2, Task2.get (tsk.duration) .todouble ()))
28
29project.getroottask (). getChildren (). Add (Task1)
30
31project.getroottask (). getChildren (). Add (Task2)
32
33link1 = project.gettaskLinks (). add (task1, task2, rjb :: import ('com.aspsient.tasks.taskLinkType').
34
35project.save ("tasklinks.mpp", rjb :: import ('com.asispor.tasks.savefileformat'). MPP).
36
37Stellt "gespeicherte Aufgabenverlinksdaten".
Download Running Code
Download Schreiben aktualisierter TaskLink -Daten an MPP (Aspose.Tasks) Aus einem der folgenden erwähnten Social -Coding -Websites: