Exemplo n.º 1
0
 public static void trimColumn(DataTable table, string col)
 {
     if ((table != null) && (table.Columns[col].DataType == typeof(string)))
     {
         for (int i = 0; i < table.Rows.Count; ++i)
         {
             if (!ToolRow.isDeleted(table.Rows[i]))
             {
                 table.Rows[i][col] = ((string)ToolCell.isNull(table.Rows[i][col], string.Empty)).Trim();
             }
         }
     }
 }
Exemplo n.º 2
0
        public static double getSumDouble(DataRow[] rows, string col)
        {
            double res = 0;

            if (rows != null)
            {
                for (int i = 0; i < rows.Length; ++i)
                {
                    if (!ToolRow.isDeleted(rows[i]))
                    {
                        res += (double)ToolCell.isNull(rows[i][col], 0.0);
                    }
                }
            }
            return(res);
        }
Exemplo n.º 3
0
        public static double getSumDouble(DataTable table, string col)
        {
            double res = 0;

            if (table != null)
            {
                for (int i = 0; i < table.Rows.Count; ++i)
                {
                    if (!ToolRow.isDeleted(table.Rows[i]))
                    {
                        res += (double)ToolCell.isNull(table.Rows[i][col], 0.0);
                    }
                }
            }
            return(res);
        }
Exemplo n.º 4
0
        public static double getSum(IEnumerable rows, string col)
        {
            IEnumerator enumer = rows.GetEnumerator();

            enumer.Reset();
            Double sum = 0;

            while (enumer.MoveNext())
            {
                if (!ToolRow.isDeleted((DataRow)enumer.Current))
                {
                    sum += Convert.ToDouble(((DataRow)enumer.Current)[col]);
                }
            }
            return(sum);
        }