public ActionResult DeleteConfirmed(int id) { // TODO: Add delete logic here emptable emptable = db.emplo.Find(id); db.emplo.Remove(emptable); db.SaveChanges(); return(RedirectToAction("Index")); }
// GET: emplo/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } emptable emptable = db.emplo.Find(id); if (emptable == null) { return(HttpNotFound()); } return(View(emptable)); }
public ActionResult Create([Bind(Include = "Id,first_name,lastname,email,dob,gender,password,conformpassword")] emptable emptable) { // TODO: if (ModelState.IsValid) { db.emplo.Add(emptable); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(emptable)); }
public ActionResult Edit([Bind(Include = "Id,first_name,lastname,email,dob,gender,password,conformpassword")] emptable emptable) { // TODO: Add update logic here if (ModelState.IsValid) { db.Entry(emptable).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(emptable)); }
public ActionResult Login(emptable user) { var verifi = db.emplo.Where(a => a.email.Equals(user.email) && a.password.Equals(user.password)).SingleOrDefault(); if (verifi != null) { Session["User"] = user.email; return(RedirectToAction("Edit")); } else { ViewBag.error = "Wrong Password or Email"; return(View()); } }