Пример #1
0
        public DisciplineNameView(DisciplineName disciplineName)
        {
            DisciplineNameId = disciplineName.DisciplineNameId;
            DisciplineId = disciplineName.Discipline.DisciplineId;
            StudentGroupId = disciplineName.StudentGroup.StudentGroupId;
            Name = disciplineName.Name;

            var discSummary = "";
            var separator = " @ ";
            discSummary += disciplineName.Discipline.StudentGroup.Name + separator;
            discSummary += disciplineName.Discipline.Name + separator;
            discSummary += (Constants.Attestation.ContainsKey(disciplineName.Discipline.Attestation) ? Constants.Attestation[disciplineName.Discipline.Attestation] : "") + separator;
            discSummary += disciplineName.Discipline.AuditoriumHours;
            DisciplineSummary = discSummary;

            StudentGroupName = disciplineName.StudentGroup.Name;
        }
Пример #2
0
        private void add_Click(object sender, EventArgs e)
        {
            var discipline =
                _repo.Disciplines.GetFirstFiltredDisciplines(d => d.DisciplineId == (int) DisciplinesList.SelectedValue);

            var studentGroup =
                _repo.StudentGroups.GetFirstFiltredStudentGroups(
                    sg => sg.StudentGroupId == (int) StudentGroupList.SelectedValue);

            var newDisciplineName = new DisciplineName
            {
                Discipline = discipline,
                StudentGroup = studentGroup,
                Name = DisciplineName.Text
            };

            _repo.DisciplineNames.AddDisciplineName(newDisciplineName);

            RefreshView();
        }