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