Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 public void AddRow(DataRow2 row)
 {
     Rows.Add(row);
 }
Ejemplo n.º 5
0
 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;
 }
Ejemplo n.º 6
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;
 }
Ejemplo n.º 7
0
 public void RemoveRow(DataRow2 row)
 {
     Rows.Remove(row);
 }
Ejemplo n.º 8
0
 public void InsertRow(int index, DataRow2 row)
 {
     Rows.Insert(index, row);
 }
Ejemplo n.º 9
0
 public void RemoveRow(DataRow2 row)
 {
     Rows.Remove(row);
 }
Ejemplo n.º 10
0
 public void InsertRow(int index, DataRow2 row)
 {
     Rows.Insert(index, row);
 }
Ejemplo n.º 11
0
 public void AddRow(DataRow2 row)
 {
     Rows.Add(row);
 }