Пример #1
0
        public ActionResult Edit(int id)
        {
            int studentId = id;
            var student = _serviceStudent.GetById(studentId);
            int teacherId= student.EmployeeHistories.OrderByDescending(x=> x.Date).FirstOrDefault().EmployeeId;

            TeacherLogModel teacherLogModel = new TeacherLogModel()
            {
                Description= _serviceTeacherChange.GetByTeacherId(teacherId).Description,
                StudentId = student.Id,
                TeacherId = teacherId,
                ModifiedDate = DateTime.Now,
                Teachers = _serviceTeacher.GetAll().ToList()
            };

            return View(teacherLogModel);
        }
Пример #2
0
        public ActionResult Edit(TeacherLogModel model)
        {
            EmployeeHistory teacherLog = new EmployeeHistory()
            {
                Description = model.Description,
                Date = model.ModifiedDate,
                EmployeeId = model.TeacherId,
                TraineeId = model.StudentId,
                IsDeleted = false
            };
            _serviceTeacherChange.Insert(teacherLog);

            var student = _serviceStudent.GetById(model.StudentId);
            student.EmployeeHistories.OrderByDescending(x=>x.Date).FirstOrDefault().EmployeeId = model.TeacherId;
            _serviceStudent.Update(student);

            return RedirectToAction("StudentInterviews","Interview");
        }