Sfoglia il codice sorgente

【修改】excel导入方法:增加字段类型是布尔值时的判断;

怀来职教中心中职
dyy 10 mesi fa
parent
commit
8b85a29786
1 ha cambiato i file con 16 aggiunte e 2 eliminazioni
  1. +16
    -2
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Excel/Import/ExcelImportBLL.cs

+ 16
- 2
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Excel/Import/ExcelImportBLL.cs Vedi File

@@ -321,7 +321,7 @@ namespace Learun.Application.Excel
throw (new Exception("【" + col.F_ColName + "】 此项数据为必填项"));
}
}
if (dbType == System.Data.DbType.DateTime || dbType == System.Data.DbType.Decimal)
if (dbType == System.Data.DbType.DateTime || dbType == System.Data.DbType.Decimal || dbType == System.Data.DbType.Boolean)
{
if (string.IsNullOrEmpty(dr[col.F_ColName].ToString()))
{
@@ -349,7 +349,21 @@ namespace Learun.Application.Excel
dataItemMap.Add(col.F_DataItemCode, dataItemList);
}
dataItemName = FindDataItemValue(dataItemMap[col.F_DataItemCode], dr[col.F_ColName].ToString(), col.F_ColName, col.F_IsMandatory ?? false);
dp.Add(col.F_Name, dataItemName, dbType);
if (dbType == System.Data.DbType.Boolean)
{
if (string.IsNullOrEmpty(dr[col.F_ColName].ToString()) || string.IsNullOrEmpty(dataItemName))
{
dp.Add(col.F_Name, null, dbType);
}
else
{
dp.Add(col.F_Name, dataItemName, dbType);
}
}
else
{
dp.Add(col.F_Name, dataItemName, dbType);
}
IsOnlyOne(col, sqlonly, dataItemName, entity.F_DbId, dbType);
break;
case 3://数据表


Caricamento…
Annulla
Salva