public ActionResult DeleteConfirmed(int id) { ShoesProjectModels.Model.Admin admin = db.Admins.Find(id); db.Admins.Remove(admin); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "AdminId,AdminPassword,AdminUsername,AdminIsDeleted,AdminIsDisabled,IsSuper")] ShoesProjectModels.Model.Admin admin) { if (ModelState.IsValid) { db.Entry(admin).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(admin)); }
public ActionResult Create([Bind(Include = "AdminId,AdminPassword,AdminUsername,AdminIsDeleted,AdminIsDisabled,IsSuper")] ShoesProjectModels.Model.Admin admin) { if (ModelState.IsValid) { admin.AdminPassword = Util.Utility.getHashedMD5(admin.AdminUsername + admin.AdminPassword); db.Admins.Add(admin); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(admin)); }
// GET: Admin/Admins/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ShoesProjectModels.Model.Admin admin = db.Admins.Find(id); if (admin == null) { return(HttpNotFound()); } return(View(admin)); }