示例#1
0
        private void FilterSubjects()
        {
            TimetableCourseProject Context = new TimetableCourseProject();

            SubjectsDatabase = new ObservableCollection <Subjects>(Context.Subjects.ToList());
            context.Subjects.Load();
            if (Subjects != null)
            {
                Subjects.Clear();
                foreach (var obj in SubjectsDatabase)
                {
                    if (FilterSubjects(obj))
                    {
                        Subjects.Add(obj);
                    }
                }
            }
        }
        private void FilterPulpits()
        {
            TimetableCourseProject Context = new TimetableCourseProject();

            PulpitDatabase = new ObservableCollection <Pulpits>(Context.Pulpits.ToList());
            context.Pulpits.Load();
            if (Pulpit != null)
            {
                Pulpit.Clear();
                foreach (var obj in PulpitDatabase)
                {
                    if (FilterPulpits(obj))
                    {
                        Pulpit.Add(obj);
                    }
                }
            }
        }
示例#3
0
        private void FilterTimetable()
        {
            TimetableCourseProject Context = new TimetableCourseProject();

            TimetableDatabase = new ObservableCollection <Timetable>(Context.Timetable.ToList());
            if (Timetable != null)
            {
                Timetable.Clear();
                if (TimetableDatabase.Count != 0)
                {
                    foreach (var obj in TimetableDatabase)
                    {
                        if (FilterTimetable(obj))
                        {
                            Timetable.Add(obj);
                        }
                    }
                }
            }
        }
        public MainViewModel()
        {
            context = new TimetableCourseProject();
            context.Audience.Load();
            context.Timetable.Load();
            context.Subjects.Load();
            context.Groups.Load();
            context.Audience.Load();
            context.Teachers.Load();
            context.PairTypes.Load();
            context.Specialities.Load();
            context.Faculties.Load();
            context.Pulpits.Load();
            context.PairsNumber.Load();
            context.PairTypes.Load();

            DayNumber = new ObservableCollection <DayNumbers>((from d in context.DayNumbers select d).ToList());
            Subgroup  = new ObservableCollection <string>(new List <string>()
            {
                "I", "II", "Нету"
            });
            WeekNumber = new ObservableCollection <string>(new List <string>()
            {
                "I", "II", "По обеим"
            });
            Corpses = new ObservableCollection <string>(new List <string>()
            {
                "1", "2", "3", "3а", "4", "5"
            });

            PairNumber        = context.PairsNumber.Local;
            Timetable         = context.Timetable.Local;
            Subjects          = context.Subjects.Local;
            Groups            = context.Groups.Local;
            AudienceNumber    = context.Audience.Local;
            TeacherId         = context.Teachers.Local;
            ShortPairtypeName = context.PairTypes.Local;
            Specialities      = context.Specialities.Local;
            Faculties         = context.Faculties.Local;
            Pulpits           = context.Pulpits.Local;
        }
示例#5
0
        private void FilterFaculties()
        {
            TimetableCourseProject Context = new TimetableCourseProject();

            FacultiesDatabase = new ObservableCollection <Faculties>(Context.Faculties.ToList());
            context.Faculties.Load();
            if (Faculty != null)
            {
                Faculty.Clear();
                if (FacultiesDatabase.Count != 0)
                {
                    foreach (var obj in FacultiesDatabase)
                    {
                        if (FilterFaculties(obj))
                        {
                            Faculty.Add(obj);
                        }
                    }
                }
            }
        }
        private void FilterTeachers()
        {
            TimetableCourseProject Context = new TimetableCourseProject();

            TeachersDatabase = new ObservableCollection <Teachers>(Context.Teachers.ToList());
            context.Teachers.Load();
            if (Teachers != null)
            {
                Teachers.Clear();
                if (TeachersDatabase.Count != 0)
                {
                    foreach (var obj in TeachersDatabase)
                    {
                        if (FilterTeachers(obj))
                        {
                            Teachers.Add(obj);
                        }
                    }
                }
            }
        }
示例#7
0
        private void FilterGroups()
        {
            TimetableCourseProject Context = new TimetableCourseProject();

            GroupsDatabase = new ObservableCollection <Groups>(Context.Groups.ToList());
            context.Groups.Load();
            if (Groups != null)
            {
                Groups.Clear();
                if (GroupsDatabase.Count != 0)
                {
                    foreach (var obj in GroupsDatabase)
                    {
                        if (FilterGroups(obj))
                        {
                            Groups.Add(obj);
                        }
                    }
                }
            }
        }
        private async void FilterAudience()
        {
            TimetableCourseProject Context = new TimetableCourseProject();

            AudienceNumberDatabase = new ObservableCollection <Audience>(await Context.Audience.ToListAsync());

            context.Audience.Load();
            if (AudienceNumber != null)
            {
                AudienceNumber.Clear();
                if (AudienceNumberDatabase.Count != 0)
                {
                    foreach (var obj in AudienceNumberDatabase)
                    {
                        if (FilterAudience(obj))
                        {
                            AudienceNumber.Add(obj);
                        }
                    }
                }
            }
        }
 public TimetableModel()
 {
     this.context = new TimetableCourseProject();
 }
示例#10
0
 public FacultiesModel()
 {
     this.context = new TimetableCourseProject();
 }
 public SpecialityModel()
 {
     this.context = new TimetableCourseProject();
 }