/// <summary>
/// 將DataRow轉換成指定類型
/// </summary>
/// <param name="pDataRow"></param>
/// <param name="pType">實體類</param>
/// <returns></returns>
private Object ConvertToEntity(DataRow pDataRow, Type pType)
{
Object entity = null;
Object proValue = null;
PropertyInfo propertyInfo = null;
try
{
if (pDataRow != null)
{
//動態創建類的實例
entity = Activator.CreateInstance(pType);
foreach (DataColumn dc in pDataRow.Table.Columns)
{
//忽略綁定時的大小寫
propertyInfo = pType.GetProperty(dc.ColumnName, BindingFlags.Public | BindingFlags.Instance | BindingFlags.IgnoreCase);
proValue = pDataRow[dc];
//當值不為空時