public void populateJobManagerWindow() { string tableName = txtBlock_tableName.Text; Grid grid = jobManagerGrid; DataTable columnInfo = jobManagerSQLManager.getTableStructureInfo(tableDatabaseName, tableName); foreach (DataRow col in columnInfo.Rows) { //Get how many columns are in our table and store it later for update implementation tableColumnCount++; string columnName = col[columnInfo.Columns["ColumnName"]].ToString(); string dataType = col[columnInfo.Columns["DataType"]].ToString(); Label lblColumnName = new Label(); if (labelYMarginCurrent >= 195) { lblColumnName.Margin = new Thickness(labelXMarginCurrent + 325, labelYMarginInitial += labelYMarginOffset, 0, 0); findAndPlotColumnDataType(dataType, labelXMarginCurrent + 30, labelYMarginInitial, jobManagerGrid, columnName); } else { lblColumnName.Margin = new Thickness(labelXMarginCurrent, labelYMarginCurrent += labelYMarginOffset, 0, 0); findAndPlotColumnDataType(dataType, labelXMarginCurrent - 600, labelYMarginCurrent, jobManagerGrid, columnName); } lblColumnName.VerticalAlignment = VerticalAlignment.Top; lblColumnName.Content = columnName + ":"; lblColumnName.RenderTransformOrigin = new Point(1.882, 0.635); grid.Children.Add(lblColumnName); } }
public void updateDataGrids() { if (listViewTables.SelectedItem != null) { DataTable dataSet = welcomeSQLManager.getDataTable(databaseName, listViewTables.SelectedItem.ToString()); dataSet.Columns.RemoveAt(0); selectedTableDataGrid.ItemsSource = dataSet.DefaultView; if (showNextWorkingDay) { DataTable dt = welcomeSQLManager.getTableStructureInfo(databaseName, listViewTables.SelectedItem.ToString()); foreach (DataRow col in dt.Rows) { string columnName = col[dt.Columns["ColumnName"]].ToString(); string dataType = col[dt.Columns["DataType"]].ToString(); if (dataType == "System.DateTime") { nWD.populateDataGridByDate(databaseName, listViewTables.SelectedItem.ToString(), columnName); } } } } }