Beispiel #1
0
 public ActionResult DeleteConfirmed(int id)
 {
     ShoesProjectModels.Model.Admin admin = db.Admins.Find(id);
     db.Admins.Remove(admin);
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }
Beispiel #2
0
 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));
 }
Beispiel #3
0
        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));
        }
Beispiel #4
0
 // 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));
 }