public void SetGridToJobs() { ShowAllFilterBoxes(); Column0Label.Content = "Co Name: "; Column1Label.Content = "Rating: "; Column2Label.Content = "Position: "; SQLConnections sql = new SQLConnections(); List <Jobs> jobs = sql.GetAllJobs(); List <ColumnData> columnDataJobs = new List <ColumnData>(); foreach (var item in jobs) { ColumnData data = new ColumnData { Column1 = item.CompanyName, Column2 = item.CEOName, Column3 = item.Rating, Column4 = item.Comments, Column5 = "Update", Column6 = "Delete" }; columnDataJobs.Add(data); } ResultBox.ItemsSource = columnDataJobs; }
private void SetGridToAll() { Column0Label.Content = "Keyword: "; Column1Label.Visibility = Visibility.Hidden; Column2Label.Visibility = Visibility.Hidden; Column1TextBox.Visibility = Visibility.Hidden; Column2TextBox.Visibility = Visibility.Hidden; SQLConnections sql = new SQLConnections(); List <Jobs> jobsAll = sql.GetAllJobs(); List <Location> locationsAll = sql.GetAllLocations(); List <Position> positionsAll = sql.GetAllPositions(); List <ColumnData> columnDataAll = new List <ColumnData>(); foreach (var item in jobsAll) { ColumnData data = new ColumnData { Column1 = "Job", Column2 = item.CompanyName, Column3 = item.CEOName, Column4 = item.Rating, Column5 = "Update", Column6 = "Delete" }; columnDataAll.Add(data); } foreach (var item in locationsAll) { ColumnData data = new ColumnData { Column1 = "Location", Column2 = item.City, Column3 = item.State, Column4 = item.RatingConverted, Column5 = "Update", Column6 = "Delete" }; columnDataAll.Add(data); } foreach (var item in positionsAll) { ColumnData data = new ColumnData { Column1 = "Position", Column2 = item.JobTitle, Column3 = null, Column4 = null, Column5 = "Update", Column6 = "Delete" }; columnDataAll.Add(data); } ResultBox.ItemsSource = columnDataAll; }
private void FillAllJobs() { SQLConnections sql = new SQLConnections(); AllJobs = sql.GetAllJobs(); }