This commit is contained in:
sunkaixuan 2017-06-16 16:08:32 +08:00
parent ffb754dd70
commit e71d2e5efa
2 changed files with 16 additions and 1 deletions

View File

@ -9,7 +9,9 @@ namespace SqlSugar
internal const string AssemblyName = "SqlSugar";
internal const string Space = " ";
internal static Type StringType = typeof(string);
internal static Type ShortType = typeof(short);
internal static Type IntType = typeof(int);
internal static Type LongType = typeof(long);
internal static Type DecType = typeof(decimal);
internal static Type GuidType = typeof(Guid);
internal static Type DateType = typeof(DateTime);

View File

@ -13,7 +13,8 @@ namespace SqlSugar
{
this.Value = value;
this.ParameterName = name;
if (value != null) {
if (value != null)
{
SettingDataType(value.GetType());
}
}
@ -38,10 +39,22 @@ namespace SqlSugar
{
this.DbType = System.Data.DbType.Int32;
}
else if (type == PubConst.ShortType)
{
this.DbType = System.Data.DbType.Int16;
}
else if (type == PubConst.LongType)
{
this.DbType = System.Data.DbType.Int64;
}
else if (type == PubConst.DateType)
{
this.DbType = System.Data.DbType.Date;
}
else if (type == PubConst.DobType)
{
this.DbType = System.Data.DbType.Double;
}
}
public SugarParameter(string name, object value, bool isOutput)
{