private void AddEmployeeAddress_Click(object sender, RoutedEventArgs e) { if (this.AddressBox.SelectedIndex < 0) { MessageBox.Show("Please select an address", "NO ADDRESS SELECTED", MessageBoxButton.OK, MessageBoxImage.Error); return; } List <EmployeeAddress> checklist = EntityContentSelector.SelectEmployeeAddress(); bool containsResidence = checklist.Where(ea => ea.Bsn == this._employee.Bsn).Select(r => r.IsResidence).Contains(true); if (containsResidence && this.ResidenceBox.IsChecked == true) { MessageBox.Show("This employee already has a residence", "Residence Already Exists", MessageBoxButton.OK, MessageBoxImage.Error); return; } InsertIntoTable.InsertEmployeeAddress(this._employee.Bsn, this._addressList.ElementAt(this.AddressBox.SelectedIndex).PostalCode, this._addressList.ElementAt(this.AddressBox.SelectedIndex).Country, this.ResidenceBox.IsChecked == true); this.GetData(); var list = this.GetAddressesAssociatedWithEmployee(this._employeeAddressList, this._addressList); this.AddressListViewer.PopulateList(list); this.ShowResidence(); }
private void GetData() { this._employeeProjectList = EntityContentSelector.SelectEmployeeProject( ).Where(e => e.ProjectId == this._project.ProjectId).ToList(); this._employeeList = EntityContentSelector.SelectEmployee( ); this._employeePositionList = EntityContentSelector.SelectEmployeePosition( ); this._positionList = EntityContentSelector.SelectPosition( ); var bsnposList = this._employeeProjectList.Select(e => new { e.Bsn, e.PositionName }); var feList = this._employeePositionList.OrderBy(e => e.Bsn).Where(e => bsnposList.Contains(new { e.Bsn, e.PositionName })).Select(e => e.Bsn).ToList(); var fpList = this._employeePositionList.OrderBy(e => e.Bsn).Where(e => bsnposList.Contains(new { e.Bsn, e.PositionName })).Select(e => e.PositionName).ToList(); List <Employee> eList = new List <Employee>(); foreach (int b in feList) { eList.Add(this._employeeList.Where(e => e.Bsn == b).ToList()[0]); } List <Position> pList = new List <Position>(); foreach (string n in fpList) { pList.Add(this._positionList.Where(p => p.PositionName == n).ToList()[0]); } this.EmployeePositionViewer.PopulateList(eList, pList, this._employeeProjectList); }
private void PopulateViewer() { this.IsShowingFailingProjects = false; this._projectList = EntityContentSelector.SelectProject(); foreach (Project p in this._projectList) { this.ProjectList.Items.Add(p); } }
public ProjectAddWindow( ) { InitializeComponent(); this._hqList = EntityContentSelector.SelectHeadquarters( ); foreach (Headquarters hq in this._hqList) { this.HeadquarterBox.Items.Add($"{hq.BuildingName}"); } }
public EmployeeAdder( ) { InitializeComponent(); this._windowText = "Add a new Employee"; this._headquartersList = EntityContentSelector.SelectHeadquarters( ); foreach (Headquarters hq in this._headquartersList) { this.MainHeadquarters.Items.Add($"{hq.PostalCode},\t{hq.BuildingName}"); } }
public EmployeeEditor(Employee employee) { InitializeComponent(); this._employee = employee; this.Header.Content = $"Employee: {this._employee.Name} {this._employee.Surname}, BSN: {this._employee.Bsn}"; this._headquartersList = EntityContentSelector.SelectHeadquarters( ); foreach (Headquarters hq in this._headquartersList) { this.HeadquarterList.Items.Add($"{hq.PostalCode},\t{hq.BuildingName}"); } this.ResetFields(this, new RoutedEventArgs()); }
private void PopulateFailingViewer() { this.IsShowingFailingProjects = true; this._projectList = EntityContentSelector.SelectProject(); var hqList = EntityContentSelector.SelectHeadquarters(); foreach (Project p in this._projectList) { Headquarters hq = hqList.Where(h => h.BuildingName == p.BuildingName).ToList()[0]; if (p.Budget * 0.10F < hq.Rent) { this.ProjectList.Items.Add(p); } } }
public ProjectEditWindow(Project project) { InitializeComponent(); this._project = project; this._hqList = EntityContentSelector.SelectHeadquarters( ); this.Header.Content = $"Project: {this._project.ProjectId}"; foreach (Headquarters hq in this._hqList) { this.Headquarters.Items.Add(hq.BuildingName); } this.SetData(); }
private void GetData() { this._degreeList = EntityContentSelector.SelectDegree(); this._employeeDegreeList = EntityContentSelector.SelectEmployeeDegree().Where(e => e.Bsn == this._employee.Bsn).ToList(); }
private void GetData() { this._positionList = EntityContentSelector.SelectPosition( ); this._employeePositionList = EntityContentSelector.SelectEmployeePosition( ); }
private void GetData() { this._employeeAddressList = EntityContentSelector.SelectEmployeeAddress(); this._addressList = EntityContentSelector.SelectAddress(); }
public void UpdateViewer() { this._employeeList = EntityContentSelector.SelectEmployee(); this.PopulateViewer(); }
public EmployeeViewer() { InitializeComponent(); this._employeeList = EntityContentSelector.SelectEmployee(); this.PopulateViewer(); }