public void Leer(Entidades.Precio Precio) { StringBuilder a = new StringBuilder(String.Empty); a.Append("select Valor from Precio where Cuit='" + sesion.Cuit.Nro + "' and IdArticulo='" + Precio.IdArticulo + "' and IdListaPrecio='" + Precio.IdListaPrecio + "' "); DataTable dt = (DataTable)Ejecutar(a.ToString(), TipoRetorno.TB, Transaccion.Acepta, sesion.CnnStr); if (dt.Rows.Count == 1) { Precio.Valor = Convert.ToDouble(dt.Rows[0]["Valor"]); } else { throw new EX.Validaciones.ElementoInexistente("Precio"); } }
public static double Valor(string IdArticulo, string IdListaPrecio, Entidades.Sesion Sesion) { Entidades.Precio precio = new Entidades.Precio(); precio.Cuit = Sesion.Cuit.Nro; precio.IdArticulo = IdArticulo; precio.IdListaPrecio = IdListaPrecio; DB.Precio db = new DB.Precio(Sesion); try { db.Leer(precio); return(precio.Valor); } catch { return(0); } }
public static double Valor(string IdArticulo, string IdListaPrecio, Entidades.Sesion Sesion) { Entidades.Precio precio = new Entidades.Precio(); precio.Cuit = Sesion.Cuit.Nro; precio.IdArticulo = IdArticulo; precio.IdListaPrecio = IdListaPrecio; DB.Precio db = new DB.Precio(Sesion); try { db.Leer(precio); return precio.Valor; } catch { return 0; } }