Ejemplo n.º 1
0
        public async Task <IActionResult> PutExam(Guid id, Exam exam)
        {
            if (id != exam.Id)
            {
                return(BadRequest());
            }

            _context.Entry(exam).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ExamExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PutStudentSubject(Guid id, StudentSubject studentSubject)
        {
            if (id != studentSubject.Id)
            {
                return(BadRequest());
            }

            _context.Entry(studentSubject).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!StudentSubjectExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
 public ActionResult Edit([Bind(Include = "InstructorId,FirstName,LastName,EmailAddress,PhoneNum")] Instructor instructor)
 {
     if (ModelState.IsValid)
     {
         db.Entry(instructor).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(instructor));
 }
Ejemplo n.º 4
0
 public ActionResult Edit([Bind(Include = "UserId,FirstName,LastName,EmailAddress,PhoneNum,Password,Role")] User user)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(user));
 }
Ejemplo n.º 5
0
 public ActionResult Edit([Bind(Include = "CourseId,Name,Address,X,Y,Description,StartDate,EndDate,InstructorId")] Course course)
 {
     if (ModelState.IsValid)
     {
         db.Entry(course).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(course));
 }
Ejemplo n.º 6
0
 public ActionResult Edit([Bind(Include = "CourseId,Name,Address,Description,StartDate,EndDate,InstructorId")] Course course)
 {
     if (ModelState.IsValid)
     {
         db.Entry(course).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.InstructorId = new SelectList(db.Instructors, "InstructorId", "FirstName", course.InstructorId);
     return(View(course));
 }