wzp
2021-09-16 b65806043f0f2f411f1c02501e92ba8e2f86fcf2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
 
using System;
using System.Data;
 
namespace Common
{
  public class DataRowReader
  {
    private DataRow Row;
 
    public DataRowReader(DataRow row)
    {
      this.Row = row;
    }
 
    public string GetString(string fieldName)
    {
      return TypeConvert.ToString(this.Row[fieldName]);
    }
 
    public int GetInt(string fieldName)
    {
      return TypeConvert.ToInt32(this.Row[fieldName]);
    }
 
    public Decimal GetDecimal(string fieldName)
    {
      return TypeConvert.ToDecimal(this.Row[fieldName]);
    }
 
    public long GetInt64(string fieldName)
    {
      return TypeConvert.ToInt64(this.Row[fieldName]);
    }
 
    public int GetInt(int columnIndex)
    {
      return TypeConvert.ToInt32(this.Row[columnIndex]);
    }
 
    public string GetString(int columnIndex)
    {
      return TypeConvert.ToString(this.Row[columnIndex]);
    }
 
    public bool GetBoolean(string fieldName)
    {
      return TypeConvert.ToBoolean(this.Row[fieldName]);
    }
 
    public bool GetBoolean(int columnIndex)
    {
      return TypeConvert.ToBoolean(this.Row[columnIndex]);
    }
 
    public DateTime GetDateTime(string fieldName)
    {
      return TypeConvert.ToDateTime(this.Row[fieldName]);
    }
  }
}