/// <summary> /// 获取插入语句,根据字典. /// </summary> /// <param name="columnDic">列数据字典,如果列为日期格式,需要增加后缀__date</param> /// <param name="tableName">表名</param> /// <returns></returns> public int Insert(Dictionary <string, object> columnDic, string tableName = "") { try { string sql = GetInsertSql(columnDic, tableName); return(dbl.ExecuteSql(sql)); } catch (Exception ex) { LogHelper.WriteLog(ex); return(-1); } }
/// <summary> /// 增加 /// </summary> /// <param name="t">实体类型</param> /// <returns></returns> public int Insert(T t) { try { string sql = GetInsertSql(t); return(dbl.ExecuteSql(sql)); } catch (Exception ex) { LogHelper.WriteLog(ex); return(-1); } }
/// <summary> /// 执行SQL语句,返回影响的记录数 、用于增删改 /// </summary> /// <param name="SqlString">SQL语句</param> /// <returns>影响的记录数</returns> public int ExecuteSql(string SqlString) { return(dbl.ExecuteSql(SqlString)); }