public ActionResult DeleteConfirmed(int id) { ClassStandard classstandard = db.ClassStandards.Find(id); db.ClassStandards.Remove(classstandard); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Name,Roomno,FloorNo,Section,EmployeeID,MaxStudents,CreatedDate,UpdatedDate")] ClassStandard classstandard) { if (ModelState.IsValid) { db.Entry(classstandard).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.EmployeeID = new SelectList(db.Employee, "Id", "EmpCode", classstandard.EmployeeID); return(View(classstandard)); }
public ActionResult Create([Bind(Include = "Id,Name,Roomno,FloorNo,Section,EmployeeID,MaxStudents,CreatedDate,UpdatedDate")] ClassStandard classstandard) { classstandard.CreatedDate = DateTime.Now; classstandard.UpdatedDate = DateTime.Now; if (ModelState.IsValid) { db.ClassStandards.Add(classstandard); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.EmployeeID = new SelectList(db.Employee, "Id", "EmpCode", classstandard.EmployeeID); return(View(classstandard)); }
// GET: /ClassStandard/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ClassStandard classstandard = db.ClassStandards.Find(id); if (classstandard == null) { return(HttpNotFound()); } return(View(classstandard)); }
// GET: /ClassStandard/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ClassStandard classstandard = db.ClassStandards.Find(id); if (classstandard == null) { return(HttpNotFound()); } ViewBag.EmployeeID = new SelectList(db.Employee, "Id", "EmpCode", classstandard.EmployeeID); return(View(classstandard)); }