public ActionResult DeleteConfirmed(int id) { CadreMaster cadreMaster = db.CadreMasters.Find(id); db.CadreMasters.Remove(cadreMaster); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "CadreId,CadreName,CreatedDate,IsDeleted")] CadreMaster cadreMaster) { if (ModelState.IsValid) { db.Entry(cadreMaster).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(cadreMaster)); }
public ActionResult Create([Bind(Include = "CadreId,CadreName,CreatedDate,IsDeleted")] CadreMaster cadreMaster) { if (ModelState.IsValid) { db.CadreMasters.Add(cadreMaster); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(cadreMaster)); }
// GET: CadreMasters/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CadreMaster cadreMaster = db.CadreMasters.Find(id); if (cadreMaster == null) { return(HttpNotFound()); } return(View(cadreMaster)); }