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); }
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)); }
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)); }
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); }
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); }