public MainWindowViewModel() { _scheduleCreationInfo = new ScheduleCreationInfo(); InitDataFromDb(); _screenObjects = InitScreenObjects(); CurrentTab = 0; }
public override void Initialize(ScheduleCreationInfo scheduleCreationInfo) { CabinSchedules = new ObservableCollection <CabinSchedule>(DataBaseAccess.GetCabinSchedules()); ActiveCabins = new ObservableCollection <CabinViewModel>(scheduleCreationInfo.ActiveCabins.Select(x => new CabinViewModel(x))); foreach (CabinViewModel cabin in ActiveCabins) { cabin.SelectedSchedule = CabinSchedules.Where(x => x.Id == cabin.WrappedCabin.CabinScheduleId).FirstOrDefault(); } }
public override void Initialize(ScheduleCreationInfo scheduleCreationInfo) { ActiveStaffMembers = scheduleCreationInfo.ActiveStaffMembers.OrderBy(x => x.Name).ToStaffMemberViewModel(); ActiveCabins = scheduleCreationInfo.ActiveCabins.OrderBy(x => x.Name).ToCabinViewModel(); RaisePropertyChanged(nameof(ActiveStaffCount)); RaisePropertyChanged(nameof(ActiveCabinCount)); }
public override void Initialize(ScheduleCreationInfo scheduleCreationInfo) { base.Initialize(scheduleCreationInfo); _activeStaffMembers = new List <StaffMember>() { StaffMember.Random }.Concat(scheduleCreationInfo.ActiveStaffMembers).ToList(); _activeCabins = new List <Cabin>() { Cabin.Random }.Concat(scheduleCreationInfo.ActiveCabins).ToList(); InitializeMiscAssignmentViewModels(); }
public override void Initialize(ScheduleCreationInfo scheduleCreationInfo) { base.Initialize(scheduleCreationInfo); _activeStaffMembers = scheduleCreationInfo.ActiveStaffMembers.ToObservableCollection(); _activeCabins = scheduleCreationInfo.ActiveCabins.ToObservableCollection(); _activeCabins.Insert(0, Cabin.None); _activeWorkAreas = DataBaseAccess.GetWorkAreas().ToObservableCollection(); _activeWorkAreas.Insert(0, Location.None); RaisePropertyChanged(nameof(ActiveStaffMembers)); RaisePropertyChanged(nameof(ActiveCabins)); RaisePropertyChanged(nameof(ActiveWorkAreas)); }
public override void Initialize(ScheduleCreationInfo scheduleCreationInfo) { base.Initialize(scheduleCreationInfo); _activeProgramAreas = scheduleCreationInfo.ActiveWorkAreas.Where(x => x.IsProgramArea).ToLocationViewModel(); LocationViewModel.Advance = this.Advance; foreach (var area in _activeProgramAreas) { area.AssignedStaffnames = new List <string>(); foreach (var member in scheduleCreationInfo.ActiveStaffMembers) { if (member.PStaffAssignment == area.WrappedLocation) { area.AssignedStaffnames.Add(member.Name); } } } RaisePropertyChanged(nameof(ActiveProgramAreas)); }
public override void Initialize(ScheduleCreationInfo scheduleCreationInfo) { base.Initialize(scheduleCreationInfo); StaffMembers = new ObservableCollection <StaffMemberViewModel>(); var members = DataBaseAccess.GetStaffMembers(); foreach (var staff in members) { StaffMembers.Add(new StaffMemberViewModel(staff)); } Cabins = new ObservableCollection <CabinViewModel>(); foreach (var cabin in DataBaseAccess.GetCabins()) { Cabins.Add(new CabinViewModel(cabin)); } SelectActiveStaffMembers = new SelectActiveMembersViewModel <StaffMemberViewModel>( "Staff Members", StaffMembers, DeleteStaffMember, CreateNewStaffMember, EditStaffMember ); SelectActiveCabins = new SelectActiveMembersViewModel <CabinViewModel>( "Cabins", Cabins, DeleteCabin, CreateNewCabin, EditCabin ); }
public virtual void Initialize(ScheduleCreationInfo scheduleCreationInfo) { this.scheduleCreationInfo = scheduleCreationInfo; }
public GenerationEngine(ScheduleCreationInfo scheduleCreationInfo) { _scheduleCreationInfo = scheduleCreationInfo; }
public override void Initialize(ScheduleCreationInfo scheduleCreationInfo) { base.Initialize(scheduleCreationInfo); InitDefaultUIValues(); }