public ActionResult DeleteConfirmed(int id) { Userdemo userdemo = db.usersdemo.Find(id); db.usersdemo.Remove(userdemo); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "UserdemoId,username,password")] Userdemo userdemo) { if (ModelState.IsValid) { db.Entry(userdemo).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(userdemo)); }
public ActionResult Create([Bind(Include = "UserdemoId,username,password")] Userdemo userdemo) { if (ModelState.IsValid) { db.usersdemo.Add(userdemo); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(userdemo)); }
// GET: /UseDemo/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Userdemo userdemo = db.usersdemo.Find(id); if (userdemo == null) { return(HttpNotFound()); } return(View(userdemo)); }