예제 #1
0
        public ActionResult test()
        {
            TrueStudent stu = new TrueStudent();

            stu.Name = "test";
            return(View("test", stu));
        }
예제 #2
0
        public ActionResult DeleteConfirmed(string id)
        {
            TrueStudent trueStudent = db.TrueStudents.Find(id);

            db.TrueStudents.Remove(trueStudent);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #3
0
 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));
 }
예제 #4
0
        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));
        }
예제 #5
0
        // 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));
        }