using Microsoft.Data.SqlClient; using System.Data; namespace RB_MES_API.Controllers { /// /// 直接SQL帮助类 /// public interface IKDSqlHelper { /// /// 获取多个结果集 /// /// /// /// /// public DataSet? GetDataSet(CommandType cmdType, string cmdText, SqlParameter[]? sqlParams, ref string? mess, bool KD = false); /// /// 并返回由查询返回的结果集中第一行的第一列 /// /// /// /// /// public object? ExecuteScalar(CommandType cmdType, string cmdText, SqlParameter[] sqlParams, ref string? mess, bool KD = false); /// /// 执行存储过程,并获得返回值 /// /// /// /// public Dictionary GetProcedurePairs(string cmdText, SqlParameter[] sqlParams, ref string? mess, bool KD = false); /// /// 直接执行编译好的SQL语句 /// /// 如果执行不带返回参数的存储过程,填写存储过程名 /// 必填 /// 可以传空值 /// public Task ExecuteNonQueryAsync(string cmdText, CommandType cmdType, SqlParameter[]? sqlParams, bool KD = false); /// /// 将整理好的表单批量导入数据库 /// /// 整理好的数据集 /// 数据库表名 /// 返回错误消息 /// 是否金蝶数据库 /// public bool InsertBill(DataTable idata, string TableName, ref string? reason, bool KD = false); } }