public ActionResult DeleteConfirmed(int id) { is_staffDetails is_staffDetails = db.is_staffDetails.Find(id); db.is_staffDetails.Remove(is_staffDetails); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "detailsID,badgeID,fName,lName,dept,phone,birthdate")] is_staffDetails is_staffDetails) { if (ModelState.IsValid) { db.Entry(is_staffDetails).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(is_staffDetails)); }
public ActionResult Create([Bind(Include = "detailsID,badgeID,fName,lName,dept,phone,birthdate")] is_staffDetails is_staffDetails) { if (ModelState.IsValid) { db.is_staffDetails.Add(is_staffDetails); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(is_staffDetails)); }
// GET: StaffDetails/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } is_staffDetails is_staffDetails = db.is_staffDetails.Find(id); if (is_staffDetails == null) { return(HttpNotFound()); } return(View(is_staffDetails)); }
public ActionResult StaffRegister([Bind(Include = "detailsID,badgeID,fName,lName,dept,phone,birthdate")] is_staffDetails is_staffDetails, int choice) { if (ModelState.IsValid) { db.is_staffDetails.Add(is_staffDetails); is_StaffClass staffClass = new is_StaffClass { badgeID = is_staffDetails.badgeID, classID = choice, approved = false, endDate = DateTime.Parse("01/01/2001 01:00:00 AM"), status = false }; db.StaffClasses.Add(staffClass); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(is_staffDetails)); }