Ejemplo n.º 1
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));
 }
Ejemplo n.º 2
0
        // GET: Benchmark/Create
        public ActionResult Create()
        {
            Dropdownlist _student = new Dropdownlist();

            ViewBag.studentID = _student.DrowStudentID();
            Dropdownlist _Course = new Dropdownlist();

            ViewBag.CourseID = _Course.DrowCourseID();
            return(View());
        }