public static Models.Lane CopyLane(Models.Lane laneToCopy) { Models.Lane newLG = new Models.Lane(); newLG.ApproachID = laneToCopy.ApproachID; newLG.Description = laneToCopy.Approach.Description + laneToCopy.MovementType.Abbreviation; newLG.LaneGroupTypeID = laneToCopy.LaneGroupTypeID; newLG.MovementTypeID = laneToCopy.MovementTypeID; newLG.Detectors = new List <Models.Detector>(); return(newLG); }
public static Models.Lane CopyLane(int incommingLaneGroupID) { MOE.Common.Models.Repositories.ILaneGroupRepository repository = MOE.Common.Models.Repositories.LaneGroupRepositoryFactory.Create(); Models.Lane laneToCopy = repository.GetLaneGroupByLaneGroupID(incommingLaneGroupID); Models.Lane newLG = new Models.Lane(); newLG.ApproachID = laneToCopy.ApproachID; newLG.Description = laneToCopy.Approach.Description + laneToCopy.MovementType.Abbreviation; newLG.LaneGroupTypeID = laneToCopy.LaneGroupTypeID; newLG.MovementTypeID = laneToCopy.MovementTypeID; newLG.Detectors = new List <Models.Detector>(); return(newLG); }
public static Models.Detector GetDetectorByLaneByDetectionType(Models.Lane laneGroup, int detectionTypeID) { List <Models.Detector> dets = new List <Models.Detector>(); foreach (Models.Detector d in laneGroup.Detectors) { foreach (Models.DetectionType m in d.DetectionTypes) { if (m.DetectionTypeID == detectionTypeID) { dets.Add(d); } } } if (dets.Count > 0) { return(dets[0]); } else { return(null); } }
public LaneGroupModelHelper(Models.Lane laneGroup) { //MOE.Common.Models.Repositories.ILaneGroupRepository laneGroups = MOE.Common.Models.Repositories.LaneGroupRepositoryFactory.CreateLaneGroupRepository(); LaneGroup = laneGroup; }