public LecturerPageVM(string dbcontextName, ISystemUser loggedInLectuer) : base(dbcontextName) { try { rowsToReturn = 20; IsConfirmed = false; SubgridContext = SubgridContext.Groups; //commands NewModeCmd = new NewModeCmd(this); SaveFormCmd = new SaveCmd(this); DeleteCmd = new DeleteCmd(this); CancelCmd = new CancelCmd(this); NewPassHashCmd = new NewPassHashCmd(this); ToggleAdminRoleCmd = new ToggleAdminRoleCmd(this); //TODO: will likely need to attach lecturer to the DbContext.. User = UnitOfWork.LecturerRepo.Get(loggedInLectuer.Id); SearchTxt = ""; SelectedLecturer = new Lecturer(); //TODO: figure out Async with EF and Pagination/ limit the results (limit probably best) List <Lecturer> results = UnitOfWork.LecturerRepo.GetTopXFromSearch(null, rowsToReturn).ToList(); Lecturers = new ObservableCollection <Lecturer>(results); Mediator.Register(MediatorChannels.PoolingUpdate.ToString(), PoolingUpdate); } catch (Exception ex) { ShowFeedback(ex.Message, FeedbackType.Error); } }
protected BaseMyAccountPageVM(string dbcontextName) : base(dbcontextName) { ProposedPassword = ""; ProposedPasswordConf = ""; SaveFormCmd = new SaveCmd(this); NewPassHashCmd = new NewPassHashCmd(this); CancelCmd = new CancelCmd(this); //No need for pooling updates in MyAccount page as it only loads your single reccord }
public StudentsPageVM(string dbcontextName, Student selectedStudent, ISystemUser loggedInLectuer) : base(dbcontextName) { try { studentRowsToReturn = 50; IsConfirmed = false; SubgridContext = SubgridContext.Groups; //commands RemoveEntityCmd = new RemoveEntityCmd(this); NewModeCmd = new NewModeCmd(this); SaveFormCmd = new SaveCmd(this); NewPassHashCmd = new NewPassHashCmd(this); MoveEntityOutOfListCmd = new MoveEntityOutOfListCmd(this); MoveEntityInToListCmd = new MoveEntityInToListCmd(this); ChangeSubgridContextCmd = new ChangeSubgridContextCmd(this); DeleteCmd = new DeleteCmd(this); CancelCmd = new CancelCmd(this); GoToEntityCmd = new GoToEntityCmd(this); AnalyseEntityCmd = new AnalyseEntityCmd(this); CSVCmd = new CSVCmd(this); //TODO: will likely need to attach lecturer to the DbContext.. Lecturer = (Lecturer)loggedInLectuer; SearchStudentTxt = ""; if (selectedStudent.Id == 0) { SelectedStudent = new Student(); } else { SelectedStudent = UnitOfWork.StudentRepo.Get(selectedStudent.Id); } //TODO: figure out Async with EF and Pagination/ limit the results (limit probably best) RefreshAvailableGroups(SelectedStudent); List <Student> results = UnitOfWork.StudentRepo.GetAll().ToList(); Students = new ObservableCollection <Student>(results); } catch (Exception ex) { ShowFeedback(ex.Message, FeedbackType.Error); } }