예제 #1
0
        // GET: Parent/Create
        public ActionResult Create()
        {
            Dropdownlist _student = new Dropdownlist();

            ViewBag.studentID = _student.DrowStudentID();
            return(View());
        }
예제 #2
0
 // GET: Benchmark/Edit/5
 public ActionResult Edit(int id)
 {
     Student.Models.Benchmark _Benchmark = new Student.Models.Benchmark();
     if (id == null)
     {
         return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
     }
     using (TritonEntities EFDbContext = new TritonEntities())
     {
         var BenchmarkData = from BenchmarkTable in EFDbContext.Benchmarks
                             where BenchmarkTable.BenchmarkID == id
                             select BenchmarkTable;
         if (BenchmarkData.Any())
         {
             Dropdownlist _student = new Dropdownlist();
             ViewBag.studentID = _student.DrowStudentID();
             Dropdownlist _Course = new Dropdownlist();
             ViewBag.CourseID          = _Course.DrowCourseID();
             _Benchmark.StudentID      = BenchmarkData.First().StudentID;
             _Benchmark.BenchmarkID    = BenchmarkData.First().BenchmarkID;
             _Benchmark.CourseID       = BenchmarkData.First().CourseID;
             _Benchmark.benchmarkRange = BenchmarkData.First().benchmarkRange;
             //EFDbContext.SaveChanges();
             return(View(_Benchmark));
         }
         else
         {
             return(HttpNotFound());
         }
     }
     return(View(_Benchmark));
 }
예제 #3
0
 // GET: Parent/Edit/5
 public ActionResult Edit(int id)
 {
     Student.Models.Parent _parent = new Student.Models.Parent();
     if (id == null)
     {
         return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
     }
     using (TritonEntities EFDbContext = new TritonEntities())
     {
         var ParentData = from ParentTable in EFDbContext.Parents
                          where ParentTable.ParentID == id
                          select ParentTable;
         if (ParentData.Any())
         {
             Dropdownlist _student = new Dropdownlist();
             ViewBag.studentID = _student.DrowStudentID();
             _parent.StudentID = ParentData.First().StudentID;
             _parent.ParentID  = ParentData.First().ParentID;
             _parent.Pa_name   = ParentData.First().Pa_name;
             _parent.Pa_sex    = ParentData.First().Pa_sex;
             //EFDbContext.SaveChanges();
             return(View(_parent));
         }
         else
         {
             return(HttpNotFound());
         }
     }
     return(View(_parent));
 }