This commit is contained in:
seb
2026-07-14 23:30:16 +02:00
parent 245fb047d7
commit 262fa63f1b
109 changed files with 21566 additions and 367 deletions

View File

@@ -0,0 +1,42 @@
#pragma once
#include <string>
#include "xml.hpp"
#include "../db/pool.hpp"
namespace delivery {
inline void deliver_picklists(OdbcPool::Connection* c, int kBenutzer, int kSessionId,
int kAuftrag, int kVersandArt) {
std::string pakete = xml::element("Paket",
xml::tag("kBestellung", int64_t(kAuftrag)) +
xml::tag("kVersandart", int64_t(kVersandArt)) +
xml::tag("fGewicht", 0.0));
const int AUSLIEFERN_OPTIONS = 0x002;
const char* sql =
"DECLARE @xHinweise XML = NULL;"
"DECLARE @xPakete XML = CONVERT(XML, ?);"
"DECLARE @xResult XML;"
"EXEC Auslieferung.spPicklistenAusliefern"
" @xHinweise = @xHinweise,"
" @Pakete = @xPakete,"
" @nOptions = ?,"
" @kBenutzer = ?,"
" @kSessionId = ?,"
" @xResult = @xResult OUTPUT;"
"SELECT @xResult AS xResult";
std::vector<Param> ps = {
{ParamType::NVarChar, pakete, 0},
{ParamType::Int, "", AUSLIEFERN_OPTIONS},
{ParamType::Int, "", kBenutzer},
{ParamType::Int, "", kSessionId}
};
ResultSet rs;
if (!get_pool().execute(c, sql, ps, rs)) {
throw std::runtime_error("deliver_picklists failed");
}
}
} // namespace delivery