コード例 #1
0
ファイル: kechengController.cs プロジェクト: XHY126/7
 public ActionResult Edit([Bind(Include = "Id,CourdeName")] kecheng kecheng)
 {
     if (ModelState.IsValid)
     {
         db.Entry(kecheng).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(kecheng));
 }
コード例 #2
0
 public ActionResult Edit(Teachers teachers)
 {
     if (ModelState.IsValid)
     {
         db.Entry(teachers).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(teachers));
 }
コード例 #3
0
 public ActionResult Edit(Course course)
 {
     if (ModelState.IsValid)
     {
         db.Entry(course).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(course));
 }
コード例 #4
0
 public ActionResult Edit(ActionLink actionlink)
 {
     if (ModelState.IsValid)
     {
         db.Entry(actionlink).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(actionlink));
 }
コード例 #5
0
 public ActionResult Edit([Bind(Include = "Id,Name,ClassId")] Students students)
 {
     if (ModelState.IsValid)
     {
         db.Entry(students).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(students));
 }
コード例 #6
0
 public ActionResult Edit([Bind(Include = "Id,Name,Controller,Action")] Sidebars sidebars)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sidebars).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(sidebars));
 }
コード例 #7
0
 public ActionResult Edit(Student student)
 {
     if (ModelState.IsValid)
     {
         db.Entry(student).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(student));
 }
コード例 #8
0
 public ActionResult Edit([Bind(Include = "Id,ClassId,CourseId,TeacherId")] CourseManagements courseManagements)
 {
     if (ModelState.IsValid)
     {
         db.Entry(courseManagements).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(courseManagements));
 }
コード例 #9
0
 public ActionResult Edit([Bind(Include = "Id,WeekId,SectionId,CourseId")] Weeks weeks)
 {
     if (ModelState.IsValid)
     {
         db.Entry(weeks).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(weeks));
 }
コード例 #10
0
ファイル: TeacherController.cs プロジェクト: XHY126/7
 public ActionResult Edit([Bind(Include = "Id,Name")] Teacher teacher)
 {
     if (ModelState.IsValid)
     {
         db.Entry(teacher).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(teacher));
 }
コード例 #11
0
        public ActionResult Edit(Classes classes)
        {
            if (ModelState.IsValid)
            {
                db.Entry(classes).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            var teachers = db.Teachers.ToList();

            ViewBag.Teachers = teachers;

            return(View(classes));
        }