public ActionResult DeleteConfirmed(int id) { associate associate = db.associate.Find(id); db.associate.Remove(associate); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "age,full_name,position,associate_id")] associate associate) { if (ModelState.IsValid) { db.Entry(associate).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(associate)); }
public ActionResult Create([Bind(Include = "age,full_name,position,associate_id")] associate associate) { if (ModelState.IsValid) { db.associate.Add(associate); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(associate)); }
public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } associate associate = db.associate.Find(id); if (associate == null) { return(HttpNotFound()); } return(View(associate)); }