示例#1
0
 public UnitController()
 {
     unitList     = SchoolDBAAdapter.FetchAllUnit();//load all units to local
     viewableUnit = new ObservableCollection <Unit>(unitList);
     foreach (Unit i in unitList)
     {
         i.classList = SchoolDBAAdapter.FetchClassByCode(i.Code);
     }
 }
示例#2
0
        public void FilterByCampus(string code, Campus cam)
        {
            Campus all = ParseEnum <Campus>("All");

            classList     = SchoolDBAAdapter.FetchClassByCode(code);
            viewableClass = new ObservableCollection <UnitClass>(classList);
            if (cam != all)
            {
                var SearchtName = from UnitClass uc in classList
                                  where (uc.Campus == cam)
                                  select uc;
                viewableClass.Clear();
                SearchtName.ToList().ForEach(viewableClass.Add);
            }
        }