35 lines
1.1 KiB
C#
35 lines
1.1 KiB
C#
using Sap.Data.Hana;
|
|
using System;
|
|
using System.Data;
|
|
|
|
namespace Net.Data.HelperData.Invoices
|
|
{
|
|
public class HelperInvoice
|
|
{
|
|
public static int Get(string DocNum)
|
|
{
|
|
DataTable dt = new DataTable();
|
|
int DocEntry = 0;
|
|
using (HanaConnection con = new HanaConnection(LocalData.ConnectionString))
|
|
{
|
|
con.Open();
|
|
HanaCommand cmd = new HanaCommand($"CALL\"{LocalData.Schema}\".\"ITCA_WMS_SAP_GetEntradaPorImportacion\"(?)", con);
|
|
cmd.Parameters.Add("DocNum", HanaDbType.VarChar).Value = DocNum ?? "";
|
|
HanaDataAdapter da = new HanaDataAdapter(cmd);
|
|
if (da != null)
|
|
{
|
|
da.Fill(dt);
|
|
}
|
|
con.Close();
|
|
}
|
|
|
|
for (int x = 0; x < dt.Rows.Count; x++)
|
|
{
|
|
DocEntry = (dt.Rows[x]["DocEntry"] != DBNull.Value) ? Convert.ToInt32(dt.Rows[x]["DocEntry"]) : 0;
|
|
}
|
|
|
|
return DocEntry;
|
|
}
|
|
}
|
|
}
|