| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod CreateLaneFromJson ( |
| | | JSON datarow |
| | | JSON datarow, |
| | | MacroPlan macroplan |
| | | ) as Lane |
| | | { |
| | | Description: 'Read the json data and use it to create lane data' |
| | |
| | | userleadtime := datarow.Get( "userleadtime" ); |
| | | processingtime := Duration::Zero(); |
| | | |
| | | unitofmeasurename := "PCS"; |
| | | currencyid := "CNY"; |
| | | startdate := Date::Date( 1900, 1, 1 ); |
| | | enddate := Date::Date( 9999, 12, 31 ); |
| | | capacitytype := "Transport quantity"; |
| | | if( userleadtime.IsNull() ) |
| | | { |
| | | processingtime := Duration::Zero(); |
| | |
| | | }; |
| | | |
| | | unit := Unit::FindUnitTypeIndex( unitid ); |
| | | if( isnull( unit)){ |
| | | unit :=macroplan.Unit( relnew, |
| | | ID := unitid, |
| | | Name := unitid, |
| | | UnitOfMeasureName := unitofmeasurename, |
| | | CurrencyID := currencyid, |
| | | StartDate := startdate, |
| | | EndDate := enddate, |
| | | CapacityType := capacitytype ); |
| | | } |
| | | |
| | | result := Lane::CreateLane( unit, id, name, processingtime); |
| | | |
| | |
| | | for( i:=0; i<data_length; i++ ) |
| | | { |
| | | datarow := data.Get( i ); |
| | | a := Lane::CreateLaneFromJson( datarow ); |
| | | a := Lane::CreateLaneFromJson( datarow ,this); |
| | | updates.Add( a ); |
| | | } |
| | | origindataset := selectset( this, Unit.Lane, l, true ); |