Класс для хранения данных о сущности студентов.
Inheritance: PersonItem
Example #1
0
 /// <summary>
 /// Исключение студента из группы.
 /// </summary>
 /// <param name="student">Студенты.</param>
 public void Delete(StudentItem student)
 {
     using (var sqlh = new SqlHelper())
     {
         sqlh.ExecNoQuery(@"
     insert into Person.student
     (
     event_date,
     person,
     team,
     act
     )
     values
     (
     getdate(),
     @Id,
     @TeamId,
     -1
     )", student);
     }
 }
Example #2
0
        /// <summary>
        /// Зачисление студента в группу.
        /// </summary>
        /// <param name="student">Студенты.</param>
        /// <returns>Идентификатор созданной задачи.</returns>
        public int Create(StudentItem student)
        {
            using (var sqlh = new SqlHelper())
            {
                return sqlh.ExecScalar<int>(@"
            insert into Person.student
            (
            event_date,
            person,
            team,
            act
            )
            values
            (
            getdate(),
            @Id,
            @TeamId,
            1
            )

            select @Id", student);
            }
        }
Example #3
0
        public void SetUp()
        {
            _transactionScope = new TransactionScope();
            _studentRepository = new StudentRepository();
            _personRepository = new PersonRepository();
            _teamRepository = new TeamRepository();
            _specialtyDetailRepository = new SpecialtyDetailRepository();
            _specialtyRepository = new SpecialtyRepository();
            _cathedraRepository = new CathedraRepository();
            _facultyRepository = new FacultyRepository();

            _team = new TeamItem()
            {
                CreateDate = DateTime.Now,
                Name = "ПЕ-22б",
                SpecialtyDetailId = _specialtyDetailRepository.Create(new SpecialtyDetailItem()
                {
                    SpecialtyId = _specialtyRepository.Create(new SpecialtyItem()
                    {
                        CathedraId = _cathedraRepository.Create(new CathedraItem()
                        {
                            FacultyId = _facultyRepository.Create(new FacultyItem()),
                            FullName = "Кафедра",
                            ShortName = "K"
                        }),
                        FullName = "Специальность",
                        ShortName = "С",
                        Code = "1"
                    }),
                    ActualDate = DateTime.Now
                })
            };

            _student = new StudentItem()
            {
                LastName = "Егоров",
                FirstName = "Виталий",
                FatherName = "Игоревич",
                Birthday = DateTime.Now,
                TeamId = _teamRepository.Create(_team)
            };
            _student.Id = _personRepository.Create(_student);

            _studentNew = new StudentItem()
            {
                LastName = "Журавлев",
                FirstName = "Данил",
                FatherName = "Александрович",
                Birthday = DateTime.Now,
                TeamId = _teamRepository.Create(_team)
            };
            _studentNew.Id = _personRepository.Create(_student);
        }
Example #4
0
 /// <summary>
 /// Проверяет эквивалентны ли два студента.
 /// </summary>
 /// <param name="first_student">Первый студент для сравнения</param>
 /// <param name="second_student">Второй студент для сравнения</param>
 private void AreEqualStudents(StudentItem first_student, StudentItem second_student)
 {
     Assert.AreEqual(first_student.Id, second_student.Id);
     Assert.AreEqual(first_student.LastName, second_student.LastName);
     Assert.AreEqual(first_student.FirstName, second_student.FirstName);
     Assert.AreEqual(first_student.FatherName, second_student.FatherName);
     Assert.AreEqual(first_student.TeamId, second_student.TeamId);
 }