public static IList <clsTipoCondicionComercial> ListarCondicionesComercialesPorTipo(Enums.TipoCondicionComercial tipo) { IList <clsTipoCondicionComercial> listaCondiciones = new List <clsTipoCondicionComercial>(); try { //Abrir Conexion conn = BaseDatos.Conexion(); objParams = SqlHelperParameterCache.GetSpParameterSet(conn, "SP_C_CLIENTES_CONDICIONES_COMERCIALES"); objParams[0].Value = tipo; SqlCommand command = new SqlCommand("SP_C_CLIENTES_CONDICIONES_COMERCIALES", conn); command.Parameters.AddRange(objParams); command.CommandType = CommandType.StoredProcedure; dreader = command.ExecuteReader(); while (dreader.Read()) { clsTipoCondicionComercial condicion = new clsTipoCondicionComercial(); condicion.Id = Convert.ToInt64(dreader[0]); condicion.Nombre = dreader[1].ToString(); condicion.DiasPlazo = Convert.ToInt16(dreader[2]); condicion.TipoCondicionComercial = (Enums.TipoCondicionComercial)dreader[3]; listaCondiciones.Add(condicion); } } catch (Exception ex) { Log.EscribirLog(ex.Message); } finally { conn.Close(); } return(listaCondiciones); }
public static IList <clsTipoCondicionComercial> ListarCondicionesComercialesPorTipo(Enums.TipoCondicionComercial tipo) { return(AccesoDatos.Clientes.clsCondicionComercialDAO.ListarCondicionesComercialesPorTipo(tipo)); }