lihongji
2024-08-12 acf70acb5438a3358d07978afdc0eb28950f40d5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Quintiq file version 2.0
#parent: #root
StaticMethod ValidDate (
  output String feedback_o,
  MacroPlan owner,
  DateTime startdate,
  DateTime endtime
) declarative remote as Boolean
{
  TextBody:
  [*
    // 甄兰鸽 Jul-26-2024 (created)
    feedback_o := '';
    if( startdate > endtime ){
      feedback_o := Translations::MP_LibCal_Event_ValidDatePeriod();
    }
    
    if( not exists( owner, Period_MP, period, not period.IsHistorical() 
                and period.TimeUnit() = Translations::MP_GlobalParameters_Day() 
                and period.StartDate() = startdate.Date() 
                and ( period.EndDate() = endtime.Date() or period.StartDate() = endtime.Date() ) ) ){
      feedback_o := Translations::MP_LibCal_Event_ValidDate();
    }
    return feedback_o = '';
    //return true;
  *]
}