Files
itca_api_sap_wms/Net.Data/HelperData/Inventario/HelperInventario.cs
T

34 lines
1.1 KiB
C#
Raw Normal View History

using Sap.Data.Hana;
using System;
using System.Data;
namespace Net.Data.HelperData.Inventario
{
public class HelperInventario
{
public static string Get(string TipoMovimiento)
{
DataTable dt = new DataTable();
string Cuenta = "";
using (HanaConnection con = new HanaConnection(LocalData.ConnectionString))
{
con.Open();
HanaCommand cmd = new HanaCommand($"CALL\"{LocalData.Schema}\".\"ITCA_GetAccountCode_TipoEntradaSalida\"(?)", con);
cmd.Parameters.Add("TipoMovimiento", HanaDbType.VarChar).Value = TipoMovimiento ?? "";
HanaDataAdapter da = new HanaDataAdapter(cmd);
if (da != null)
{
da.Fill(dt);
}
con.Close();
}
for (int x = 0; x < dt.Rows.Count; x++)
{
Cuenta = (dt.Rows[x]["U_Cuenta"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["U_Cuenta"]) : string.Empty;
}
return Cuenta;
}
}
}