修改安全月报

This commit is contained in:
2024-09-04 16:31:09 +08:00
parent 97b236d21d
commit 3d1e4f6338
6 changed files with 172 additions and 49 deletions
+39
View File
@@ -972,5 +972,44 @@ namespace BLL
maxId = GetIntValue(str);
return maxId;
}
/// <summary>
/// 通过存储过程获取数据
/// </summary>
/// <param name="storedProcName"></param>
/// <returns></returns>
public static int RunProcGetHsseKq(string ProjectId,DateTime startTime,DateTime endTime,string UnitId)
{
string str = "";
using (SqlConnection Connection = new SqlConnection(connectionString))
{
try
{
Connection.Open();
SqlCommand command = new SqlCommand("SpGetHsseKq", Connection)
{
CommandTimeout = 0,
CommandType = CommandType.StoredProcedure
};
SqlParameter[] values = new SqlParameter[]
{
new SqlParameter("@ProjectId", ProjectId),
new SqlParameter("@startTime", startTime.ToString()),
new SqlParameter("@endTime", endTime.ToString()),
new SqlParameter("@UnitId", UnitId),
new SqlParameter("@returnVal", SqlDbType.Int)
};
command.Parameters.AddRange(values);
command.Parameters["@returnVal"].Direction = ParameterDirection.Output;
command.ExecuteNonQuery();
str = command.Parameters["@returnVal"].Value.ToString();
}
finally
{
Connection.Close();
}
return Convert.ToInt32(str);
}
}
}
}