public ActionResult DeleteConfirmed(int id) { User user = db.Users.Find(id); db.Users.Remove(user); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "UserId,Login,Password,Email,EmailElInvoice,IsLegalEntity,Bin,Kbe,CertSeries,CertNumber,CertDateIssue,Status,CreateDate,UpdateDate,NameOrganization,User1CGuid,Surname,Name,Patronymic")] User user) { if (ModelState.IsValid) { db.Entry(user).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(user)); }
// GET: Users/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } User user = db.Users.Find(id); if (user == null) { return(HttpNotFound()); } return(View(user)); }