예제 #1
0
        public MyObservableCollection <MyTeacher> refreshTeacherTable()
        {
            MyObservableCollection <MyTeacher> myTeachers = new MyObservableCollection <MyTeacher>();
            var query = from s in teacherTable
                        select new MyTeacher(s.ID, s.CellPhone, s.FirstName, s.LastName, s.Enabled);

            foreach (MyTeacher ss in query)
            {
                myTeachers.Add(ss);
            }
            return(myTeachers);
        }
예제 #2
0
        public MyObservableCollection <MyClass> refreshClassTable()
        {
            MyObservableCollection <MyClass> myClasses = new MyObservableCollection <MyClass>();
            var query = from s in classTable
                        where s.Enabled == true
                        select new MyClass(s.ID, s.Division, s.ClassName, s.Semester, s.Dayofweek, s.Timeofweek, s.Enabled, s.Tuition);

            foreach (MyClass ss in query)
            {
                myClasses.Add(ss);
            }
            return(myClasses);
        }
예제 #3
0
        public CSViewModel()
        {
            dataItems = new MyObservableCollection <ClassStudent>();
            GetClassStudents();

            //Use side by side with IsSynchronizedWithCurrentItem="True"
            //We can use DataGrid instead of ListBox [SelectedItem="{Binding SelectedProduct}">]
            ///_customerView.CurrentChanged += CustomerSelectionChanged;

            listBoxSelectionChangeCommand = new RelayCommand(() => SelectionHasChanged());
            App.Messenger.Register("ProductCleared", (Action)(() => SelectedProduct = null));
            App.Messenger.Register("GetClassStudents", (Action)(() => GetClassStudents()));
            App.Messenger.Register("UpdateProduct", (Action <ClassStudent>)(param => UpdateProduct(param)));
            App.Messenger.Register("DeleteProduct", (Action)(() => DeleteProduct()));
            App.Messenger.Register("AddProduct", (Action <ClassStudent>)(param => AddProduct(param)));
        }
        public MyObservableCollection <MyClass> refreshClassTable()
        {
            MyObservableCollection <MyClass> myClasses = new MyObservableCollection <MyClass>();
            var query = (from s in classTable
                         where s.Enabled == true
                         orderby s.ID descending
                         select new MyClass(s.ID, s.Division, s.ClassName, s.Semester, s.Dayofweek, s.Timeofweek, s.Enabled, s.Tuition)
                         ).Take(ClassDropDownItems)
            ;

            foreach (MyClass ss in query)
            {
                myClasses.Add(ss);
            }
            return(myClasses);
        }
        public MyObservableCollection <MyStudent> refreshStudentTable()
        {
            MyObservableCollection <MyStudent> myStudents = new MyObservableCollection <MyStudent>();
            var query = (from s in studentTable
                         select new MyStudent(s.ID,
                                              "" + s.FirstName + " " + s.LastName + " " + ((s.CellPhone.Length > 0) ? s.CellPhone : s.HomePhone),
                                              s.FirstName, s.LastName)
                         ).Take(StudentDropDownItems)
            ;

            foreach (MyStudent ss in query)
            {
                myStudents.Add(ss);
            }
            return(myStudents);
        }