public ActionResult DeleteConfirmed(int id) { Student_Type student_Type = db.Student_Type.Find(id); db.Student_Type.Remove(student_Type); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Name")] Student_Type student_Type) { if (ModelState.IsValid) { db.Entry(student_Type).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(student_Type)); }
public ActionResult Create([Bind(Include = "Id,Name")] Student_Type student_Type) { if (ModelState.IsValid) { db.Student_Type.Add(student_Type); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(student_Type)); }
//overloaded constructor public Student(string name, string ppsn, string address, string phone, string email, string studentNumber,Student_Type type) : base(name, ppsn, address, phone, email) { this.StudentNumber = studentNumber; this.Pps = ppsn; this.Name = name; this.Address = Address; this.Phone = phone; this.Email = email; this.Type = type; }
// GET: Student_Type/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Student_Type student_Type = db.Student_Type.Find(id); if (student_Type == null) { return(HttpNotFound()); } return(View(student_Type)); }