yanweiyuan3
2023-08-09 588bc7829387dfc761cc25f06f77d4c81818bd10
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Quintiq file version 2.0
#parent: #root
StaticMethod IsPrimaryKeysUnique (
  Unit unit,
  DateTime start,
  UnitCapacity unitcapacity
) declarative remote as Boolean
{
  Description: "Return true if the to-be created unit capacity's primary keys is unique."
  TextBody:
  [*
    // Soh Yee Jul-23-2012 (created)
    
    // For editing of the unit capacity, exclude itself from the checking of the primary key.
    return not exists( unit, UnitCapacity, uc,
                       uc <> unitcapacity,
                       uc.Start() = start );
  *]
}