Exemple #1
0
        public void Edit(LANDMARK landmark, LANDMARK_KNOWN_AS lka)
        {
            var results = from p in dBase.LANDMARKs
            join q in dBase.LANDMARK_KNOWN_AS on p.Landmark_ID equals q.Landmark_FK
            select new { p, q };

            foreach (var item in results)
            {
                item.p.Landmark_Coordinates = landmark.Landmark_Coordinates;
                item.q.Known_As_Description = lka.Known_As_Description;
            }

            dBase.SaveChanges();
        }
 public void Add(LANDMARK_KNOWN_AS landmark)
 {
     dBase.LANDMARK_KNOWN_AS.Add(landmark);
     dBase.SaveChanges();
 }
Exemple #3
-1
        private void addReference(Placemark placemark, SharpKml.Dom.Point point, DbGeography coordinates)
        {
            LANDMARK landmark = new LANDMARK();
            LANDMARK_KNOWN_AS knowAsLandmark;

            knowAsLandmark = new LANDMARK_KNOWN_AS();

            knowAsLandmark.Known_As_Description = placemark.Name;
            landmark.Landmark_Coordinates = coordinates;
            knowAsLandmark.LANDMARK = landmark;
            knowAsLandmark.Known_As_ID = count = count + 1;

            DBLandmarkKnownAs db = new DBLandmarkKnownAs(context);
            db.Add(knowAsLandmark);

            if (placemark.Description != null)
            {
                string[] description = placemark.Description.Text.Split(';');

                for (int i = 0; i < description.Count(); i++)
                {
                    knowAsLandmark = new LANDMARK_KNOWN_AS();

                    knowAsLandmark.Known_As_Description = description[i];
                    landmark.Landmark_Coordinates = coordinates;
                    knowAsLandmark.Known_As_ID = count = count + 1;

                    knowAsLandmark.LANDMARK = landmark;

                    db = new DBLandmarkKnownAs(context);
                    db.Add(knowAsLandmark);
                }
            }
        }