public ActionResult DeleteConfirmed(int id) { town town = db.towns.Find(id); db.towns.Remove(town); db.SaveChanges(); return(RedirectToAction("Index")); }
public bool isNeighbour(town fromTown, town toTown) { path outPath; if (paths.TryGetValue(new pathParam(fromTown, toTown), out outPath)) { return(true); } else { return(false); } }
// GET: Admin/towns/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } town town = db.towns.Find(id); if (town == null) { return(HttpNotFound()); } return(View(town)); }
// GET: towns/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } town town = db.towns.Find(id); if (town == null) { return(HttpNotFound()); } ViewBag.ZoneId = new SelectList(db.zones, "ZoneID", "ZoneName"); return(View(town)); }
public ActionResult Create([Bind(Include = "TownID,TownName,AccountStatusID,ZoneId")] town town) { if (ModelState.IsValid) { using (db = new AdminEntities()) { town.AccountStatusID = 1; db.towns.Add(town); db.SaveChanges(); } return(RedirectToAction("Index")); } ViewBag.ZoneId = new SelectList(db.zones, "ZoneID", "ZoneName", town.ZoneId); return(View(town)); }
public Person(string email, string name, int age, town) { }
public pathParam(town fromTown, town toTown) { this.fromTown = fromTown; this.toTown = toTown; }