陈清红
2025-04-14 880f3c0257eeb8c37761d484258fdd102a369a19
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
28
29
30
31
32
33
34
35
36
37
Quintiq file version 2.0
#parent: #root
Method ValuesEventOK () as Boolean id:Method_LibCal_dlgEvent_ValuesEventOK
{
  #keys: '[131094.1.528683483]'
  Body:
  [*
    feedback := FeedbackObject::LocalFeedback();
    
    if( edtName.Text().TrimBoth() = "" )
    {
      feedback.AddHard( Translations::Event_NoSubject() );
    }
    
    if( ddslType.Text() = LibCal_Event::TYPE_PARTIAL() )
    {
      capacity := this.StringToReal( edtCapacity.Text() );
      
      if( capacity <> Real::MinReal() )
      {
        // Check the value of the Real.
        if( capacity < 0.0 or  // cannot happen, because '-' is not accepted
            capacity > 1.0 )
        {                                                           // Format according to the applicable locale.
          feedback.AddHard( Translations::Event_CapacityMustBeBetween0and1( ( 0.0 ).Format( "N(Dec(1))" ), 
                                                                            ( 1.0 ).Format( "N(Dec(1))" ) ) );
        }
      }
      else
      {
        feedback.AddHard( Translations::Event_InvalidCapacity() );
      }
    }
    
    return feedback.IsAllowed();
  *]
}