public List<DestinationEnterExitsModel> CreateEnterExitsList(DestinationObjectLayer destination) { List<DestinationEnterExitsModel> enterExitsList = new List<DestinationEnterExitsModel>(); foreach (DestinationEnterExits enterExit in destination.DestinationEnterExits) { DestinationEnterExitsModel enterExitForList = new DestinationEnterExitsModel(enterExit.id, enterExit.destinationLayerId, enterExit.typeId, enterExit.latitude, enterExit.longitude, enterExit.hadicapAccessible); enterExitsList.Add(enterExitForList); } return enterExitsList; }
public ActionResult CreateEnterExits(DestinationEnterExitsModel newEnterExitModel) { _destinationRepository.SaveDatabaseEnterExits(newEnterExitModel); return RedirectToAction("Index"); }
public ActionResult CreateEnterExits(int destinationLayerId) { DestinationEnterExitsModel enterExit = new DestinationEnterExitsModel(); enterExit.DestinationLayerID = destinationLayerId; return View(enterExit); }
public void SaveDatabaseEnterExits(DestinationEnterExitsModel enterExits) { if(enterExits != null) { DestinationEnterExits dbEnterExit = new DestinationEnterExits(); dbEnterExit.id = enterExits.ID; dbEnterExit.destinationLayerId = enterExits.DestinationLayerID; dbEnterExit.typeId = enterExits.TypeID; dbEnterExit.latitude = enterExits.Latitude; dbEnterExit.longitude = enterExits.Longitude; dbEnterExit.hadicapAccessible = enterExits.IsHandicapAccessible; _phillyZooDatabaseEntities.DestinationEnterExits.Add(dbEnterExit); _phillyZooDatabaseEntities.SaveChanges(); } }
void IDestinationRepository.SaveDatabaseEnterExits(DestinationEnterExitsModel enterExit) { }