public ActionResult DeleteConfirmed(int id) { Myemployee myemployee = db.Myemployees.Find(id); db.Myemployees.Remove(myemployee); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Name,Gender,City,Photo,AlternateText")] Myemployee myemployee) { if (ModelState.IsValid) { db.Entry(myemployee).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(myemployee)); }
public ActionResult Create([Bind(Include = "Id,Name,Gender,City,Photo,AlternateText")] Myemployee myemployee) { if (ModelState.IsValid) { db.Myemployees.Add(myemployee); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(myemployee)); }
// GET: Home/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Myemployee myemployee = db.Myemployees.Find(id); if (myemployee == null) { return(HttpNotFound()); } return(View(myemployee)); }
// GET: Home/Details/5 public PartialViewResult Details(int?id) { if (id == null) { // return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } Myemployee myemployee = db.Myemployees.Find(id); if (myemployee == null) { // return HttpNotFound(); } return(PartialView("~/Shared/_My", myemployee)); }