public ActionResult DeleteConfirmed(int id) { 客戶聯絡人 客戶聯絡人 = RepoContact.Find(id); RepoContact.Delete(客戶聯絡人); RepoContact.UnitOfWork.Commit(); return(RedirectToAction("Index")); }
// GET: 客戶聯絡人/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } 客戶聯絡人 客戶聯絡人 = RepoContact.Find(id); if (客戶聯絡人 == null) { return(HttpNotFound()); } return(View(客戶聯絡人)); }
// GET: 客戶聯絡人/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } 客戶聯絡人 客戶聯絡人 = RepoContact.Find(id); if (客戶聯絡人 == null) { return(HttpNotFound()); } ViewBag.客戶Id = new SelectList(RepoCust.All(), "Id", "客戶名稱", 客戶聯絡人.客戶Id); return(View(客戶聯絡人)); }