public ActionResult DeleteMetingPoint(int Id) { var deleted = ""; var Inv = (from p in db.MetingPoint where p.IdMetingPoint == Id select p).ToList <MetingPoint>(); if (Inv.Count() > 0) { MetingPoint MetingPoint = db.MetingPoint.Find(Id); db.MetingPoint.Remove(MetingPoint); db.SaveChanges(); deleted = "true"; @ViewBag.Message = "Sucess"; } else { deleted = "false"; } return(Json(new { success = true, deleted }, JsonRequestBehavior.AllowGet)); }
public ActionResult DeleteConfirmed(int id) { MetingPoint metingPoint = db.MetingPoint.Find(id); db.MetingPoint.Remove(metingPoint); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "IdMetingPoint,DescMetingPoint")] MetingPoint metingPoint) { if (ModelState.IsValid) { db.Entry(metingPoint).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(metingPoint)); }
public ActionResult Create([Bind(Include = "IdMetingPoint,DescMetingPoint")] MetingPoint metingPoint) { if (ModelState.IsValid) { db.MetingPoint.Add(metingPoint); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(metingPoint)); }
// GET: MetingPoint/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MetingPoint metingPoint = db.MetingPoint.Find(id); if (metingPoint == null) { return(HttpNotFound()); } return(View(metingPoint)); }