コード例 #1
0
ファイル: Lanes.cs プロジェクト: zfx1982/ATSPM
        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);
        }
コード例 #2
0
ファイル: Lanes.cs プロジェクト: zfx1982/ATSPM
        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);
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
ファイル: LaneGroupModelHelper.cs プロジェクト: zfx1982/ATSPM
        public LaneGroupModelHelper(Models.Lane laneGroup)
        {
            //MOE.Common.Models.Repositories.ILaneGroupRepository laneGroups = MOE.Common.Models.Repositories.LaneGroupRepositoryFactory.CreateLaneGroupRepository();

            LaneGroup = laneGroup;
        }