コード例 #1
0
        internal long Add(long scheduleId, IntermediateLocation location)
        {
            var databaseId = GetNewId();
            var row        = Table.NewRow();

            row["Id"]                   = databaseId;
            row["ScheduleId"]           = scheduleId;
            row["LocationId"]           = _lookup.Find(location.Location);
            row["Sequence"]             = location.Sequence;
            row["WorkingArrival"]       = (object)location.WorkingArrival ?? DBNull.Value;
            row["WorkingDeparture"]     = (object)location.WorkingDeparture ?? DBNull.Value;
            row["WorkingPass"]          = (object)location.WorkingPass ?? DBNull.Value;
            row["PublicArrival"]        = (object)location.PublicArrival ?? DBNull.Value;
            row["PublicDeparture"]      = (object)location.PublicDeparture ?? DBNull.Value;
            row["Platform"]             = location.Platform;
            row["Line"]                 = location.Line;
            row["Path"]                 = location.Path;
            row["Activities"]           = location.Activities;
            row["EngineeringAllowance"] = location.EngineeringAllowance;
            row["PathingAllowance"]     = location.PathingAllowance;
            row["PerformanceAllowance"] = location.PerformanceAllowance;
            Table.Rows.Add(row);
            return(databaseId);
        }
コード例 #2
0
        internal long Add(Association association)
        {
            var databaseId = GetNewId();
            var row        = Table.NewRow();

            row["Id"]                 = databaseId;
            row["Action"]             = ScheduleHeaderLoader.MapAction(association.Action, _logger);
            row["StpIndicator"]       = association.StpIndicator.ToString();
            row["MainUid"]            = association.MainUid;
            row["AssociatedUid"]      = association.AssociatedUid;
            row["RunsFrom"]           = association.RunsFrom;
            row["RunsTo"]             = (object)association.RunsTo ?? DBNull.Value;
            row["DayMask"]            = DayMaskConverter.Convert(association.DayMask);
            row["Category"]           = SetNullIfEmpty(association.Category);
            row["DateIndicator"]      = SetNullIfEmpty(association.DateIndicator);
            row["LocationId"]         = _lookup.Find(association.Location);
            row["MainSequence"]       = association.MainSequence;
            row["AssociatedSequence"] = association.AssociationSequence;
            row["AssociationType"]    = SetNullIfEmpty(association.AssociationType);
            Table.Rows.Add(row);
            return(databaseId);
        }