public ActionResult DeleteConfirmed(int id) { ATTENDENCE aTTENDENCE = db.ATTENDENCEs.Find(id); db.ATTENDENCEs.Remove(aTTENDENCE); db.SaveChanges(); return(RedirectToAction("Index")); }
// GET: reports // GET: Report public ActionResult Index(int?id) { STUDENT sTUDENT = db.STUDENTS.Find(id); ATTENDENCE atten = db.ATTENDENCEs.Find(id); ViewBag.ATTENDENCE = atten; ViewBag.User = System.Web.HttpContext.Current.User.Identity.Name; ViewBag.Date = DateTime.Now.ToString("dd/MMM/yyyy"); ViewBag.Time = DateTime.Now.ToShortTimeString(); return(View(sTUDENT)); }
public ActionResult Edit([Bind(Include = "ID,STID,DATES,TIME_IN,TIME_OUT")] ATTENDENCE aTTENDENCE) { if (ModelState.IsValid) { db.Entry(aTTENDENCE).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.STID = new SelectList(db.STUDENTS, "ID", "FirstName", aTTENDENCE.STID); return(View(aTTENDENCE)); }
// GET: attendence/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ATTENDENCE aTTENDENCE = db.ATTENDENCEs.Find(id); if (aTTENDENCE == null) { return(HttpNotFound()); } return(View(aTTENDENCE)); }
// GET: attendence/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ATTENDENCE aTTENDENCE = db.ATTENDENCEs.Find(id); if (aTTENDENCE == null) { return(HttpNotFound()); } ViewBag.STID = new SelectList(db.STUDENTS, "ID", "FirstName", aTTENDENCE.STID); return(View(aTTENDENCE)); }