public void Delete(客戶資料 instance) { if (instance == null) { throw new ArgumentNullException("instance"); } else { db.Entry(instance).State = EntityState.Deleted; this.SaveChanges(); } }
public ActionResult Edit([Bind(Include = "Id,客戶名稱,統一編號,電話,傳真,地址,Email")] CustomerData customerData) { if (ModelState.IsValid) { db.Entry(customerData).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(customerData)); }
public ActionResult Edit([Bind(Include = "Id,客戶Id,職稱,姓名,Email,手機,電話")] CustomerContact customerContact) { if (ModelState.IsValid) { db.Entry(customerContact).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.客戶Id = new SelectList(db.CustomerData, "Id", "客戶名稱", customerContact.客戶Id); return(View(customerContact)); }
public ActionResult Edit([Bind(Include = "Id,客戶Id,銀行名稱,銀行代碼,分行代碼,帳戶名稱,帳戶號碼")] CustomerBankInfo customerBankInfo) { if (ModelState.IsValid) { db.Entry(customerBankInfo).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.客戶Id = new SelectList(db.CustomerData, "Id", "客戶名稱", customerBankInfo.客戶Id); return(View(customerBankInfo)); }