例外のために平日を定義します

Contents
[ Hide Show ]

C ++のAspose.Tasksを使用してカレンダーの例外を設定する場合、営業日を例外として定義することができます。

就業日を定義する

カレンダークラスによって公開された例外収集を使用して、例外の平日を定義できます。

Microsoftプロジェクトの例外のリストを見るには:

  1. ファイルを開きます。
  2. ツールメニューから、作業時間の変更を選択して、作業時間の変更を開きます。

次のコードの例は、例外として、2009年12月24日から2009年12月31日の日付を定義しています。

 1System::String dataDir = RunExamples::GetDataDir(System::Reflection::MethodBase::GetCurrentMethod(ASPOSE_CURRENT_FUNCTION)->get_DeclaringType().get_FullName());
 2    
 3// Create a project instance
 4System::SharedPtr<Project> prj = System::MakeObject<Project>();
 5    
 6// Define Calendar
 7System::SharedPtr<Aspose::Tasks::Calendar> cal = prj->get_Calendars()->Add(u"Calendar1");
 8    
 9// Define week days exception for a holiday
10System::SharedPtr<CalendarException> except = System::MakeObject<CalendarException>();
11except->set_EnteredByOccurrences(false);
12except->set_FromDate(System::DateTime(2009, 12, 24, 0, 0, 0));
13except->set_ToDate(System::DateTime(2009, 12, 31, 23, 59, 0));
14except->set_Type(Aspose::Tasks::CalendarExceptionType::Daily);
15except->set_DayWorking(false);
16cal->get_Exceptions()->Add(except);
17    
18// Save the Project
19prj->Save(dataDir + u"Project_DefineWeekDayException_out.xml", Aspose::Tasks::Saving::SaveFileFormat::XML);
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.