public ActionResult test() { TrueStudent stu = new TrueStudent(); stu.Name = "test"; return(View("test", stu)); }
public ActionResult DeleteConfirmed(string id) { TrueStudent trueStudent = db.TrueStudents.Find(id); db.TrueStudents.Remove(trueStudent); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Num,Name,Age,Gender,Firstscore,Secondscore,Thirdscore,Classroomid")] TrueStudent trueStudent) { if (ModelState.IsValid) { db.Entry(trueStudent).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(trueStudent)); }
public ActionResult Create([Bind(Include = "Num,Name,Age,Gender,Firstscore,Secondscore,Thirdscore,Classroomid")] TrueStudent trueStudent) { if (ModelState.IsValid) { db.TrueStudents.Add(trueStudent); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(trueStudent)); }
// GET: TrueStudents/Delete/5 public ActionResult Delete(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TrueStudent trueStudent = db.TrueStudents.Find(id); if (trueStudent == null) { return(HttpNotFound()); } return(View(trueStudent)); }