public ActionResult DeleteConfirmed(int id) { AdminProfil adminProfil = db.AdminProfils.Find(id); db.AdminProfils.Remove(adminProfil); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "InfoID,MailAdress,Password,Name")] AdminProfil adminProfil) { if (ModelState.IsValid) { db.Entry(adminProfil).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(adminProfil)); }
public ActionResult Create([Bind(Include = "InfoID,MailAdress,Password,Name")] AdminProfil adminProfil) { if (ModelState.IsValid) { db.AdminProfils.Add(adminProfil); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(adminProfil)); }
// GET: Panel/AdminProfils/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AdminProfil adminProfil = db.AdminProfils.Find(id); if (adminProfil == null) { return(HttpNotFound()); } return(View(adminProfil)); }
public ActionResult RenewalPassword(string NewPassword, string NewPasswordRepeat) { bool?Control = false; ViewBag.ControlPassword = "******"; if (NewPassword == NewPasswordRepeat) { string Mail = Request.QueryString["Mail"]; AdminProfil Account = Db.AdminProfils.Where(x => x.MailAdress == Mail).FirstOrDefault(); Account.Password = NewPassword; Db.Entry(Account).State = System.Data.Entity.EntityState.Modified; Db.SaveChanges(); Control = true; RedirectToAction("RenewalPassword", "Index"); } return(View(Control)); }