Beispiel #1
0
 public ActionResult Edit(Course course)
 {
     if (ModelState.IsValid)
     {
         db.Entry(course).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     PopulateDropdownList(course);
     return(View(course));
 }
 public ActionResult Edit(Enrollment enrollment)
 {
     if (ModelState.IsValid)
     {
         db.Entry(enrollment).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.StudentId = new SelectList(db.Students, "StudentId", "RegNo", enrollment.StudentId);
     ViewBag.CourseId  = new SelectList(db.Courses, "CourseId", "Code", enrollment.CourseId);
     return(View(enrollment));
 }
 public ActionResult Edit(Department department)
 {
     if (ModelState.IsValid)
     {
         db.Entry(department).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(department));
 }
 public ActionResult Edit([Bind(Include = "Id,DeptCode,DeptName")] Department department)
 {
     if (ModelState.IsValid)
     {
         db.Entry(department).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(department));
 }
Beispiel #5
0
 public ActionResult Edit([Bind(Include = "Id,Semester_Name")] Semester semester)
 {
     if (ModelState.IsValid)
     {
         db.Entry(semester).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(semester));
 }
 public ActionResult Edit(Student student)
 {
     if (ModelState.IsValid)
     {
         db.Entry(student).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.DepartmentId = new SelectList(db.Departments, "DepartmentId", "Code", student.DepartmentId);
     return(View(student));
 }
 public ActionResult Edit([Bind(Include = "Id,RegistrationNo,CourseId,EnrollDate,CourseGrade")] EnrollCourse enrollcourse)
 {
     if (ModelState.IsValid)
     {
         db.Entry(enrollcourse).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CourseId = new SelectList(db.Courses, "Id", "CourseCode", enrollcourse.CourseId);
     return(View(enrollcourse));
 }
 public ActionResult Edit([Bind(Include = "Id,StudentRegNo,Name,Email,Contact,RegDate,Address,DepartmentId")] Student student)
 {
     if (ModelState.IsValid)
     {
         db.Entry(student).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.DepartmentId = new SelectList(db.Deparments, "Id", "DeptName", student.DepartmentId);
     return(View(student));
 }
Beispiel #9
0
 public ActionResult Edit([Bind(Include = "Id,Course_Code,Course_Name,Course_Credit,CourseAssignTo,DepartmentId,SemesterId")] Course course)
 {
     if (ModelState.IsValid)
     {
         db.Entry(course).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.DepartmentId = new SelectList(db.Deparments, "Id", "DeptCode", course.DepartmentId);
     ViewBag.SemesterId   = new SelectList(db.Semesters, "Id", "Semester_Name", course.SemesterId);
     return(View(course));
 }
 public ActionResult Edit(Teacher teacher)
 {
     if (ModelState.IsValid)
     {
         db.Entry(teacher).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.DesignationId = new SelectList(db.Designations, "DesignationId", "Name", teacher.DesignationId);
     ViewBag.DepartmentId  = new SelectList(db.Departments, "DepartmentId", "Code", teacher.DepartmentId);
     return(View(teacher));
 }
Beispiel #11
0
 public ActionResult Edit([Bind(Include = "Id,TeacherName,TeacherAddress,TeacherEmail,TeacherContactNo,DesignationId,DepartmentId,CreditTaken,CreditLeft")] Teacher teacher)
 {
     if (ModelState.IsValid)
     {
         db.Entry(teacher).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.DepartmentId  = new SelectList(db.Departments, "Id", "DeptCode", teacher.DepartmentId);
     ViewBag.DesignationId = new SelectList(db.Designations, "Id", "DesignationName", teacher.DesignationId);
     return(View(teacher));
 }
 public ActionResult Edit(ClassRoomAllocation classroomallocation)
 {
     if (ModelState.IsValid)
     {
         db.Entry(classroomallocation).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.DepartmentId = new SelectList(db.Departments, "DepartmentId", "Code", classroomallocation.DepartmentId);
     ViewBag.CourseId     = new SelectList(db.Courses, "CourseId", "Code", classroomallocation.CourseId);
     ViewBag.ClassRoomId  = new SelectList(db.ClassRooms, "ClassRoomId", "RoomNo", classroomallocation.ClassRoomId);
     ViewBag.DayId        = new SelectList(db.Days, "DayId", "Name", classroomallocation.DayId);
     return(View(classroomallocation));
 }
 public ActionResult Edit([Bind(Include = "Id,DepartmentId,CourseId,RoomId,DayId,StartTime,EndTime,RoomStatus")] ClassRoomAllocation classroomallocation)
 {
     if (ModelState.IsValid)
     {
         db.Entry(classroomallocation).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CourseId     = new SelectList(db.Courses, "Id", "CourseCode", classroomallocation.CourseId);
     ViewBag.DayId        = new SelectList(db.Days, "Id", "Name", classroomallocation.DayId);
     ViewBag.DepartmentId = new SelectList(db.Departments, "Id", "DeptCode", classroomallocation.DepartmentId);
     ViewBag.RoomId       = new SelectList(db.Rooms, "Id", "Name", classroomallocation.RoomId);
     return(View(classroomallocation));
 }
 public ActionResult Edit(int id, Predmet predmet)
 {
     try
     {
         var res = db.Predmets.Single(m => m.predmetId == id);
         if (res != null)
         {
             predmet.predmetId = res.predmetId;
             db.Entry(res).CurrentValues.SetValues(predmet);
             db.SaveChanges();
             return(RedirectToAction("Index"));
         }
         else
         {
             return(View());
         }
     }
     catch
     {
         return(View());
     }
 }
Beispiel #15
0
 public void UpdateEducation(Education education)
 {
     _context.Entry(education).State = EntityState.Modified;
 }