public ActionResult DeleteConfirmed(string id) { 清單 清單 = db.清單.Find(id); db.清單.Remove(清單); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "客戶名稱,客戶銀行數量,客戶聯絡人數量")] 清單 清單) { if (ModelState.IsValid) { db.Entry(清單).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(清單)); }
public ActionResult Create([Bind(Include = "客戶名稱,客戶銀行數量,客戶聯絡人數量")] 清單 清單) { if (ModelState.IsValid) { db.清單.Add(清單); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(清單)); }
// GET: 清單/Delete/5 public ActionResult Delete(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } 清單 清單 = db.清單.Find(id); if (清單 == null) { return(HttpNotFound()); } return(View(清單)); }