public AddVolunteerViewModel(VolunteerListViewModel volunteerListViewModel, VolunteerService volunteerService, PersonService personService, WorkUnitService workUnitService, SpecialtyService specialtyService, VolunteerSpecialtyService volunteerSpecialtyService) { _volunteerListViewModel = volunteerListViewModel; _volunteerService = volunteerService; _workUnitService = workUnitService; _personService = personService; _volunteerSpecialtyService = volunteerSpecialtyService; _specialtyService = specialtyService; Supervisors = new ObservableCollection <Person>(_personService.GetPersons() .Where(c => c.Discriminator == "Physician" || c.Discriminator == "Nurse" || c.Discriminator == "Staff" || c.Discriminator == "Technician")); Specialties = new ObservableCollection <Specialty>(_specialtyService.GetSpecialties()); WorkUnits = new ObservableCollection <WorkUnit>(_workUnitService.GetWorkUnits()); Hours = new ObservableCollection <int>(new List <int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 }); }
public VolunteerView() { InitializeComponent(); _volunteerService = new VolunteerService(new MVCHContext()); _volunteerListViewModel = new VolunteerListViewModel(_volunteerService); _specialtyService = new SpecialtyService(new MVCHContext()); _volunteerSpecialtyService = new VolunteerSpecialtyService(new MVCHContext()); _workUnitService = new WorkUnitService(new MVCHContext()); _personService = new PersonService(new MVCHContext()); DataContext = _volunteerListViewModel; }
public AddVolunteerView(VolunteerListViewModel volunteerListViewModel, VolunteerService volunteerService, PersonService personService, WorkUnitService workUnitService, SpecialtyService specialtyService, VolunteerSpecialtyService volunteerSpecialtyService) { _toAddVolunteer = new AddVolunteerViewModel(volunteerListViewModel, volunteerService, personService, workUnitService, specialtyService, volunteerSpecialtyService); DataContext = _toAddVolunteer; InitializeComponent(); }
public void AddVolunteerSpecialtyTest() { var serv = new VolunteerSpecialtyService(new MVCHContext()); serv.AddVolunteerSpecialty(new VolunteerSpecialty { VolunteerId = "PER-000041", SpecialtyId = "SPY-000001", DateAcquired = DateTime.Now }); serv.AddVolunteerSpecialty(new VolunteerSpecialty { VolunteerId = "PER-000042", SpecialtyId = "SPY-000002", DateAcquired = DateTime.Now }); serv.AddVolunteerSpecialty(new VolunteerSpecialty { VolunteerId = "PER-000043", SpecialtyId = "SPY-000003", DateAcquired = DateTime.Now }); serv.AddVolunteerSpecialty(new VolunteerSpecialty { VolunteerId = "PER-000044", SpecialtyId = "SPY-000004", DateAcquired = DateTime.Now }); serv.AddVolunteerSpecialty(new VolunteerSpecialty { VolunteerId = "PER-000045", SpecialtyId = "SPY-000005", DateAcquired = DateTime.Now }); serv.AddVolunteerSpecialty(new VolunteerSpecialty { VolunteerId = "PER-000046", SpecialtyId = "SPY-000001", DateAcquired = DateTime.Now }); serv.AddVolunteerSpecialty(new VolunteerSpecialty { VolunteerId = "PER-000047", SpecialtyId = "SPY-000002", DateAcquired = DateTime.Now }); serv.AddVolunteerSpecialty(new VolunteerSpecialty { VolunteerId = "PER-000048", SpecialtyId = "SPY-000003", DateAcquired = DateTime.Now }); serv.AddVolunteerSpecialty(new VolunteerSpecialty { VolunteerId = "PER-000049", SpecialtyId = "SPY-000004", DateAcquired = DateTime.Now }); serv.AddVolunteerSpecialty(new VolunteerSpecialty { VolunteerId = "PER-000050", SpecialtyId = "SPY-000005", DateAcquired = DateTime.Now }); }