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;
 }
Пример #2
0
 public ActionResult CreateEnterExits(DestinationEnterExitsModel newEnterExitModel)
 {
     _destinationRepository.SaveDatabaseEnterExits(newEnterExitModel);
     return RedirectToAction("Index");
 }
Пример #3
0
        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)
 {
 }