예제 #1
0
        public string GetLaneGroupDirection()
        {
            MOE.Common.Models.Repositories.IApproachRepository Approaches = MOE.Common.Models.Repositories.ApproachRepositoryFactory.Create();
            MOE.Common.Models.Approach approach = Approaches.GetApproachByApproachID(LaneGroup.ApproachID);

            return(approach.DirectionType.Description);
        }
예제 #2
0
        public ActionResult Copy(int approachID)
        {
            ViewBag.DirectionType = new SelectList(directionRepository.GetAllDirections(), "DirectionTypeID", "Abbreviation");
            MOE.Common.Models.Repositories.IApproachRepository approachRepository =
                MOE.Common.Models.Repositories.ApproachRepositoryFactory.Create();
            MOE.Common.Models.Approach approachToCopy = approachRepository.GetApproachByApproachID(approachID);

            Approach newApproach = MOE.Common.Models.Approach.CopyApproach(approachID);

            return(PartialView("Create", newApproach));
        }
예제 #3
0
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Approach approach = approachRepository.GetApproachByApproachID(id.Value);

            if (approach == null)
            {
                return(HttpNotFound());
            }
            return(View(approach));
        }
예제 #4
0
        public static Approach CopyApproachForSignal(int approachIDToCopy)
        {
            MOE.Common.Models.Repositories.IApproachRepository approachRepository =
                MOE.Common.Models.Repositories.ApproachRepositoryFactory.Create();
            Approach approachToCopy = approachRepository.GetApproachByApproachID(approachIDToCopy);
            Approach newApproach    = CopyApproachCommonProperties(approachToCopy);

            foreach (Detector d in approachToCopy.Detectors)
            {
                Detector dForNewApproach = Detector.CopyDetector(d.ID, false);
                newApproach.Detectors.Add(dForNewApproach);
            }
            return(newApproach);
        }
예제 #5
0
        public static Approach CopyApproach(int approachIDToCopy)
        {
            MOE.Common.Models.Repositories.IApproachRepository approachRepository =
                MOE.Common.Models.Repositories.ApproachRepositoryFactory.Create();
            Approach approachToCopy = approachRepository.GetApproachByApproachID(approachIDToCopy);
            Approach newApproach    = CopyApproachCommonProperties(approachToCopy);

            foreach (Detector d in approachToCopy.Detectors)
            {
                Detector dForNewApproach = Detector.CopyDetector(d.ID, true); //need to increase DetChannel if not copying the whole signal.
                newApproach.Detectors.Add(dForNewApproach);
            }
            if (newApproach.Detectors.Count > 1)
            {
                newApproach = SetDetChannelWhenMultipleDetectorsExist(newApproach);
            }
            return(newApproach);
        }