public ActionResult DeleteConfirmed(int id) { stamaster stamaster = db.stamaster.Find(id); db.stamaster.Remove(stamaster); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Name,Code,DivisionName")] stamaster stamaster) { if (ModelState.IsValid) { db.Entry(stamaster).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(stamaster)); }
public ActionResult Create([Bind(Include = "Id,Name,Code,DivisionName")] stamaster stamaster) { if (ModelState.IsValid) { db.stamaster.Add(stamaster); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(stamaster)); }
// GET: stamasters/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } stamaster stamaster = db.stamaster.Find(id); if (stamaster == null) { return(HttpNotFound()); } return(View(stamaster)); }