public ActionResult Add(EditPointViewModel model)
        {
            try
            {
                var pointsRepository = new PointsRepository();
                var dataLayersRepository = new DataLayersRepository();

                var point = new Point()
                {
                    Name = model.Name,
                    Description = model.Description,
                    Latitude = model.Latitude,
                    Longitude = model.Longitude,
                    Coordinates = model.Coordinates,
                    PageId = model.PageId,
                    RegionId = model.RegionId
                };

                if (model.SelectedDataLayers != null)
                {
                    var dataLayers = dataLayersRepository.GetByStringIds(model.SelectedDataLayers);
                    point.DataLayers = new List<DataLayer>(dataLayers);
                }
                else
                {
                    point.DataLayers = null;
                }

                pointsRepository.Add(point);

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
        public ActionResult Edit(EditPointViewModel model)
        {
            try
            {
                var dataLayersRepository = new DataLayersRepository();

                var pointsRepository = new PointsRepository();
                var originalPoint = pointsRepository.GetById(model.Id);

                if (model.SelectedDataLayers != null)
                {
                    var dataLayers = dataLayersRepository.GetByStringIds(model.SelectedDataLayers);
                    originalPoint.DataLayers = new List<DataLayer>(dataLayers);
                }
                else
                {
                    originalPoint.DataLayers = null;
                }

                originalPoint.Name = model.Name;
                originalPoint.Description = model.Description;
                originalPoint.Latitude = model.Latitude;
                originalPoint.Longitude = model.Longitude;
                originalPoint.PageId = model.PageId;
                originalPoint.RegionId = model.RegionId;
                originalPoint.Coordinates = model.Coordinates;

                pointsRepository.Update(originalPoint);

                return RedirectToAction("Index");
            }
            catch (Exception ex)
            {
                return View();
            }
        }