private int GetIntValue(DataRow2 row, int colInd) { bool isInt = columnTypes[colInd] == ColumnType.Integer; object o = row[colInd]; if (isInt) { if (o == null || o is DBNull || o.ToString().Length == 0) { return(0); } return((int)o); } return(0); }
private double GetDoubleValue(DataRow2 row, int colInd) { bool isInt = columnTypes[colInd] == ColumnType.Integer; bool isDouble = IsNumeric(colInd); object o = row[colInd]; if (isInt || isDouble) { if (o == null || o is DBNull || o.ToString().Length == 0) { return(double.NaN); } if (isInt) { return((int)o); } return((double)o); } return(double.NaN); }
private ITableModel CreateTable(IList <int> searchInds, IList <int[]> matchingCols) { DataTable2 table = new DataTable2("Search results", "Search results"); table.AddColumn("Row", 100, ColumnType.Integer, "", Visibility.Visible); table.AddColumn("Columns", 80, ColumnType.Text, "", Visibility.Visible); for (int index = 0; index < searchInds.Count; index++) { int searchInd = searchInds[index]; DataRow2 row = table.NewRow(); row["Row"] = searchInd + 1; string[] colNames = new string[matchingCols[index].Length]; for (int i = 0; i < matchingCols[index].Length; i++) { colNames[i] = tableModel.GetColumnName(matchingCols[index][i]); } row["Columns"] = StringUtils.Concat(";", colNames); table.AddRow(row); } return(table); }
public void AddRow(DataRow2 row) { Rows.Add(row); }
private int GetIntValue(DataRow2 row, int colInd) { bool isInt = columnTypes[colInd] == ColumnType.Integer; object o = row[colInd]; if (isInt){ if (o == null || o is DBNull || o.ToString().Length == 0){ return 0; } return (int) o; } return 0; }
private double GetDoubleValue(DataRow2 row, int colInd) { bool isInt = columnTypes[colInd] == ColumnType.Integer; bool isDouble = IsNumeric(colInd); object o = row[colInd]; if (isInt || isDouble){ if (o == null || o is DBNull || o.ToString().Length == 0){ return double.NaN; } if (isInt){ return (int) o; } return (double) o; } return double.NaN; }
public void RemoveRow(DataRow2 row) { Rows.Remove(row); }
public void InsertRow(int index, DataRow2 row) { Rows.Insert(index, row); }