Exemple #1
0
        public void DeletePOI(Guid Id)
        {
            pointOfInterest poi = (pointOfInterest)context.pointsOfInterest.Find(Id);

            context.pointsOfInterest.Remove(poi);
            context.SaveChanges();
        }
        public ActionResult DeleteConfirmed(Guid id)
        {
            pointOfInterest pointOfInterest = db.pointOfInterests.Find(id);

            db.pointOfInterests.Remove(pointOfInterest);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "Id,Name,Description")] pointOfInterest pointOfInterest)
 {
     if (ModelState.IsValid)
     {
         db.Entry(pointOfInterest).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(pointOfInterest));
 }
        public ActionResult Create([Bind(Include = "Id,Name,Description")] pointOfInterest pointOfInterest)
        {
            if (ModelState.IsValid)
            {
                pointOfInterest.Id = Guid.NewGuid();
                db.pointOfInterests.Add(pointOfInterest);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(pointOfInterest));
        }
        // GET: pointOfInterests/Delete/5
        public ActionResult Delete(Guid?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            pointOfInterest pointOfInterest = db.pointOfInterests.Find(id);

            if (pointOfInterest == null)
            {
                return(HttpNotFound());
            }
            return(View(pointOfInterest));
        }
Exemple #6
0
 public void EditPOI(pointOfInterest poi)
 {
     context.Entry(poi).State = System.Data.Entity.EntityState.Modified;
 }
Exemple #7
0
 public void AddPOI(pointOfInterest poi)
 {
     context.pointsOfInterest.Add(poi);
     context.SaveChanges();
 }