public ActionResult DeleteConfirmed(Guid id) { Specializ specializ = db.Specializ.Find(id); db.Specializ.Remove(specializ); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,Specialization")] Specializ specializ) { if (ModelState.IsValid) { db.Entry(specializ).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(specializ)); }
public ActionResult Create([Bind(Include = "ID,Specialization")] Specializ specializ) { if (ModelState.IsValid) { specializ.ID = Guid.NewGuid(); db.Specializ.Add(specializ); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(specializ)); }
// GET: Specializs/Delete/5 public ActionResult Delete(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Specializ specializ = db.Specializ.Find(id); if (specializ == null) { return(HttpNotFound()); } return(View(specializ)); }