public static Street Get(STREET street) { return(new Street { Id = street.ID, Name = street.NAME }); }
public ActionResult DeleteConfirmed(int id) { STREET sTREET = db.STREET.Find(id); db.STREET.Remove(sTREET); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "STREET_ID,STREET_NAME")] STREET sTREET) { if (ModelState.IsValid) { db.Entry(sTREET).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(sTREET)); }
public ActionResult Create([Bind(Include = "STREET_NAME")] STREET sTREET) { if (ModelState.IsValid) { db.STREET.Add(sTREET); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(sTREET)); }
public STREET Save(STREET street) { if (street.ID == 0) { context.STREETs.Add(street); } else { context.Entry(street).State = EntityState.Modified; } context.SaveChanges(); return(street); }
// GET: Streets/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } STREET sTREET = db.STREET.Find(id); if (sTREET == null) { return(HttpNotFound()); } return(View(sTREET)); }
public void Delete(STREET street) { context.STREETs.Remove(street); context.SaveChanges(); }