자원 및 캘린더

Resource 클래스는 리소스의 캘린더를 설정하거나 얻는 데 사용되는 캘린더 속성을 노출시킵니다. 이 속성은 캘린더 객체를 수락하고 반환합니다.

자원 캘린더 작업

Microsoft Project의 리소스에 대한 캘린더 정의 :

  1. 자원 시트에서 원하는 리소스를 두 번 클릭하십시오.
  2. 작업 시간 변경 버튼을 클릭하십시오.

Microsoft Project의 근무 시간 변경

Microsoft 프로젝트의 근무 시간 변경

Aspose.Tasks를 사용하여 리소스 캘린더 설정

다음 코드는 표준 캘린더 및 리소스를 생성 한 다음 캘린더를 리소스에 할당합니다.

 1// For complete examples and data files, please go to https://github.com/aspose-tasks/Aspose.Tasks-for-Java
 2// The path to the documents directory.
 3String dataDir = Utils.getDataDir(ResourceAndCalendars.class);
 4
 5Project project = new Project(dataDir + "input.mpp");
 6ResourceCollection alRes = project.getResources();
 7for (Resource res : alRes) {
 8    if (res.get(Rsc.NAME) != null) {
 9        // code to display res.Calendar properties
10    }
11}

**Getting Resource Calendar using Aspose.Tasks **

The code below shows how to set resource calendars by traversing a project’s resources.

 1// For complete examples and data files, please go to https://github.com/aspose-tasks/Aspose.Tasks-for-Java
 2// The path to the documents directory.
 3String dataDir = Utils.getDataDir(ResourceAndCalendars.class);
 4
 5Project project = new Project();
 6Resource res = project.getResources().add("Resource1");
 7
 8// add standard calendar
 9Calendar cal = project.getCalendars().add("Resource1");
10res.set(Rsc.CALENDAR, cal);
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.