public ActionResult DeleteConfirmed(int id) { AccountManagmentEntities3 db = new AccountManagmentEntities3(); UserAccount userAccount = db.UserAccounts.Find(id); db.UserAccounts.Remove(userAccount); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult AddUser([Bind(Include = "UserID,UserName,AccountNo,ACopenDate,AccountBalance,Email,PhoneNumber,Comments")] UserAccount userAccount) { AccountManagmentEntities3 db = new AccountManagmentEntities3(); if (ModelState.IsValid) { db.UserAccounts.Add(userAccount); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(userAccount)); }