Exemplo n.º 1
0
        public SupervisorWorkbooksViewModel(
            WorkBookService workBookService,
            UserService userService,
            DepartmentService departmentService
            )
        {
            _workBookService   = workBookService;
            _userService       = userService;
            _departmentService = departmentService;

            WorkbooksList   = new ObservableCollection <WorkbookDTO>(_workBookService.FindAll());
            StudentsList    = new ObservableCollection <UserDTO>(_userService.Find(x => x.Role.Name == AppRoles.Student.ToString()));
            SupervisorsList = new ObservableCollection <UserDTO>(_userService.Find(x => x.Role.Name == AppRoles.Opiekun.ToString()));
            CompaniesList   = new ObservableCollection <UserDTO>(_userService.Find(x => x.Role.Name == AppRoles.Firma.ToString()));
            DepartmentsList = new ObservableCollection <DepartmentDTO>(_departmentService.FindAll());

            if (WorkbooksList.Any())
            {
                SelectedWorkBook = WorkbooksList.First();
            }

            SaveSelectedItem   = new DelegateCommand <object>(SaveSelected, (x) => true);
            RemoveSelectedItem = new DelegateCommand <object>(RemoveSelected, (x) => true);
            AddNewItem         = new DelegateCommand <object>(AddNew, (x) => true);
        }
Exemplo n.º 2
0
        public StudentWorkbooksViewModel(WorkBookService workBookService, BookNoteService bookNoteService)
        {
            _workBookService = workBookService;
            _bookNoteService = bookNoteService;

            WorkbooksList = new ObservableCollection <WorkbookDTO>(_workBookService.FindAll());
            NotesList     = new ObservableCollection <BookNoteDTO>();

            AddNoteCommand    = new DelegateCommand <object>(AddNote, (x) => true);
            RemoveNoteCommand = new DelegateCommand <object>(RemoveNote, (x) => true);
            SaveNoteCommand   = new DelegateCommand <object>(SaveNote, (x) => true);
        }