Quintiq file version 2.0
|
#parent: #root
|
Method InitializeWeek (
|
LibCal_SubscriberEventTable table,
|
LibCal_SubscriberEventRow row,
|
DateTime starttime,
|
DateTime endtime,
|
String desc
|
)
|
{
|
TextBody:
|
[*
|
// 甄兰鸽 May-29-2024 (created)
|
for( startTime := starttime; startTime < endtime; startTime := startTime.StartOfNextWeek() ){
|
time := startTime;
|
if( starttime = startTime ){
|
time := startTime.StartOfWeek();
|
}
|
column := selectobject( table, LibCal_SubscriberEventColumn, column, column.Name() = time.Format( 'M/D/Y' ) );
|
if( isnull( column ) ){
|
column := table.LibCal_SubscriberEventColumn( relnew, Name := time.Format( 'M/D/Y' ), Period := time.Date() );
|
}
|
|
cell := selectobject( column, LibCal_SubscriberEventCell, cell, cell.LibCal_SubscriberEventRow() = row );
|
if( isnull( cell ) ){
|
cell := column.LibCal_SubscriberEventCell( relnew, Value := '0'
|
, Description := desc );
|
row.LibCal_SubscriberEventCell( relinsert, cell );
|
}
|
|
value := [Real]cell.Value();
|
if( startTime.StartOfNextWeek() > endtime ){
|
duration := endtime - startTime;
|
value := value + duration.HoursAsReal();
|
cell.Period( relnew, Start := startTime.Format( 'M/D/Y H:m' ), End := endtime.Format( 'M/D/Y H:m' ) );
|
}else{
|
duration := startTime.StartOfNextWeek() - startTime;
|
value := value + duration.HoursAsReal();
|
cell.Period( relnew, Start := startTime.Format( 'M/D/Y H:m' ), End := startTime.StartOfNextWeek().Format( 'M/D/Y H:m' ) );
|
}
|
cell.Value( [String]value );
|
|
// info( startTime, column.Name(), duration.AsQUILL(), duration.HoursAsReal() );
|
}
|
*]
|
}
|