public ActionResult DeleteConfirmed(int id) { tDolzhnost tDolzhnost = db.tDolzhnost.Find(id); db.tDolzhnost.Remove(tDolzhnost); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "DolzhnostID,Naimenovanie")] tDolzhnost tDolzhnost) { if (ModelState.IsValid) { db.Entry(tDolzhnost).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tDolzhnost)); }
public ActionResult Create([Bind(Include = "DolzhnostID,Naimenovanie")] tDolzhnost tDolzhnost) { if (ModelState.IsValid) { db.tDolzhnost.Add(tDolzhnost); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tDolzhnost)); }
// GET: tDolzhnosts/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tDolzhnost tDolzhnost = db.tDolzhnost.Find(id); if (tDolzhnost == null) { return(HttpNotFound()); } return(View(tDolzhnost)); }