コード例 #1
0
ファイル: NoteModel.cs プロジェクト: Isur/a-d-d
        public ICollection <Specialization> GetSpecializationsOnFaculty(string facultyName)
        {
            try
            {
                var faculty = FacultiesRepository.GetList().Where(x => x.Name == facultyName).First();
                if (session.User.AccountType == 0)
                {
                    var resultSpecializations = new List <Specialization>();
                    var userSpecializations   = UsersSpecializationsRepository.GetList().Where(x => x.User_Id == session.User.Id);
                    var specializations       = SpecializationsRepository.GetList(faculty);

                    foreach (var userSpec in userSpecializations)
                    {
                        resultSpecializations.AddRange(specializations.Where(x => x.Id == userSpec.Specialization_Id));
                    }

                    return(resultSpecializations);
                }
                else
                {
                    return(SpecializationsRepository.GetList(faculty));
                }
            }
            catch (Exception)
            {
                return(new List <Specialization>());
            }
        }
コード例 #2
0
ファイル: RegisterModel.cs プロジェクト: Isur/a-d-d
 public ICollection <Faculty> GetFacultiesInCollege(College college)
 {
     try
     {
         return(FacultiesRepository.GetList(college));
     }
     catch (Exception)
     {
         return(new List <Faculty>());
     }
 }
コード例 #3
0
ファイル: NoteModel.cs プロジェクト: Isur/a-d-d
 public ICollection <Faculty> GetFacultiesInCollege(string collegeName)
 {
     try
     {
         var college = CollegesRepository.GetList().Where(x => x.Name == collegeName).First();
         return(FacultiesRepository.GetList(college));
     }
     catch (Exception)
     {
         return(new List <Faculty>());
     }
 }
コード例 #4
0
        public ScheduleRepository(string connectionString)
        {
            Database.SetInitializer(new MigrateDatabaseToLatestVersion<ScheduleContext, Configuration>());

            Auditoriums = new AuditoriumsRepository();
            Buildings = new BuildingsRepository();
            Calendars = new CalendarsRepository();
            Disciplines = new DisciplinesRepository();
            DisciplineNames = new DisciplineNameRepository();
            Lessons = new LessonsRepository(this);
            Rings = new RingsRepository();
            Students = new StudentsRepository();
            StudentGroups = new StudentGroupsRepository();
            StudentsInGroups = new StudentsInGroupsRepository();
            Teachers = new TeachersRepository();
            TeacherForDisciplines = new TeacherForDisciplinesRepository();
            ConfigOptions = new ConfigOptionRepository();

            AuditoriumEvents = new AuditoriumEventsRepository();

            Faculties = new FacultiesRepository();
            GroupsInFaculties = new GroupsInFacultiesRepository();

            ScheduleNotes = new ScheduleNotesRepository();

            LessonLogEvents = new LessonLogEventsRepository();

            TeacherWishes = new TeacherWishesRepository();

            CustomTeacherAttributes = new CustomTeacherAttributesRepository();
            CustomDisciplineAttributes = new CustomDisciplineAttributesRepository();
            CustomStudentGroupAttributes = new CustomStudentGroupAttributesRepository();

            Shifts = new ShiftsRepository();
            ShiftRings = new ShiftRingsRepository();

            Exams = new ExamsRepository();
            LogEvents = new LogEventsRepository();

            CommonFunctions = new CommonFunctions(this);

            SetConnectionString(connectionString);
        }
コード例 #5
0
        public App()
        {
            // Nina
            User.CurrentUserId = 9; // TODO: implement logging

            InitializeComponent();
            Suspending += OnSuspending;

            projects     = new ProjectsRepository();
            users        = new UsersRepository();
            applications = new ProjectApplicationsRepository();

            // FIX
            Task.Run(() => TagsRepository.CreateAsync()).Wait();
            tags = TagsRepository.instance;

            Task.Run(() => FacultiesRepository.CreateAsync()).Wait();
            faculties = FacultiesRepository.instance;
        }