private void Generate(object param) { //Generating worklabels _workLabels = new ObservableCollection <WorkLabel>(WorkLabel.GenerateWorkLabels(Subjects)); _mainWindow.WorkLabels = new ObservableCollection <WorkLabel>(_workLabels); //passing data to worklabel viewmodel _mainWindow.WorkLabelEditViewModel.WorkLabels = new ObservableCollection <WorkLabel>(_workLabels); _mainWindow.WorkLabelEditViewModel.Employees = new ObservableCollection <Employee>(_employees); _mainWindow.WorkLabelEditViewModel.Employees.Add(new Employee()); _mainWindow.WorkLabelEditViewModel.Subjects = new ObservableCollection <Subject>(_subjects); }
private void Save(object param) { WorkLabel workLabel = new WorkLabel(_name, _employee, _subject, _labelTypes, _numberOfStudents, _numberOfHours, _numberOfWeeks, _language); WorkLabels[WorkLabels.IndexOf(_selectedWorkLabel)] = workLabel; SelectedWorkLabel = workLabel; //removing worklabel with empty employee and removing that worklabel from Employees if (_employee == null) { foreach (Employee employee in Employees) { if (employee.WorkLabels.Contains(workLabel)) { employee.WorkLabels.Remove(workLabel); } } } else //else add worklabel to employee { Employees[Employees.IndexOf(_employee)].WorkLabels.Add(workLabel); } }
void ReleaseDesignerOutlets() { if (AddressLine1Label != null) { AddressLine1Label.Dispose(); AddressLine1Label = null; } if (AppointmentDateTimeLabel != null) { AppointmentDateTimeLabel.Dispose(); AppointmentDateTimeLabel = null; } if (AppointmentStackView != null) { AppointmentStackView.Dispose(); AppointmentStackView = null; } if (AssignButton != null) { AssignButton.Dispose(); AssignButton = null; } if (CallHomeButton != null) { CallHomeButton.Dispose(); CallHomeButton = null; } if (CallMobileButton != null) { CallMobileButton.Dispose(); CallMobileButton = null; } if (CallWorkButton != null) { CallWorkButton.Dispose(); CallWorkButton = null; } if (CityStateZipLabel != null) { CityStateZipLabel.Dispose(); CityStateZipLabel = null; } if (ComposeEmailButton != null) { ComposeEmailButton.Dispose(); ComposeEmailButton = null; } if (ConsentLabel != null) { ConsentLabel.Dispose(); ConsentLabel = null; } if (ConsentStackView != null) { ConsentStackView.Dispose(); ConsentStackView = null; } if (ContactPreferenceLabel != null) { ContactPreferenceLabel.Dispose(); ContactPreferenceLabel = null; } if (DetailStackView != null) { DetailStackView.Dispose(); DetailStackView = null; } if (EmailButton != null) { EmailButton.Dispose(); EmailButton = null; } if (EmailStackView != null) { EmailStackView.Dispose(); EmailStackView = null; } if (ExcludeStackView != null) { ExcludeStackView.Dispose(); ExcludeStackView = null; } if (HomeLabel != null) { HomeLabel.Dispose(); HomeLabel = null; } if (HomeStackView != null) { HomeStackView.Dispose(); HomeStackView = null; } if (MessageButton != null) { MessageButton.Dispose(); MessageButton = null; } if (MessageLabel != null) { MessageLabel.Dispose(); MessageLabel = null; } if (MobileLabel != null) { MobileLabel.Dispose(); MobileLabel = null; } if (MobileStackView != null) { MobileStackView.Dispose(); MobileStackView = null; } if (NameLabel != null) { NameLabel.Dispose(); NameLabel = null; } if (PhoneButton != null) { PhoneButton.Dispose(); PhoneButton = null; } if (PreferenceLabel != null) { PreferenceLabel.Dispose(); PreferenceLabel = null; } if (PreferenceStackView != null) { PreferenceStackView.Dispose(); PreferenceStackView = null; } if (ProspectTabBar != null) { ProspectTabBar.Dispose(); ProspectTabBar = null; } if (SeparatorLineLabel1 != null) { SeparatorLineLabel1.Dispose(); SeparatorLineLabel1 = null; } if (SeparatorLineLabel2 != null) { SeparatorLineLabel2.Dispose(); SeparatorLineLabel2 = null; } if (StreetAddressStackView != null) { StreetAddressStackView.Dispose(); StreetAddressStackView = null; } if (WorkLabel != null) { WorkLabel.Dispose(); WorkLabel = null; } if (WorkStackView != null) { WorkStackView.Dispose(); WorkStackView = null; } }