public static IList<PaperlessUsuario1HousesBL> RefrescarTiposTransitoTransbordo(List<PaperlessUsuario1HousesBL> houses) { IList<PaperlessTipoTransito> tipos = new List<PaperlessTipoTransito>(); try { //Abrir Conexion conn = BaseDatos.NuevaConexion(); foreach (var house in houses) { objParams = SqlHelperParameterCache.GetSpParameterSet(conn, "SP_C_PAPERLESS_USUARIO1_TRANSBORDOTRANSITO"); objParams[0].Value = house.Id; SqlCommand command = new SqlCommand("SP_C_PAPERLESS_USUARIO1_TRANSBORDOTRANSITO", conn); command.Parameters.AddRange(objParams); command.CommandType = CommandType.StoredProcedure; dreader = command.ExecuteReader(); while (dreader.Read()) { var tipo = new PaperlessTipoTransito(); tipo.Id = Convert.ToInt64(dreader["Id"]); tipo.Nombre = dreader["Descripcion"].ToString(); house.TransbordoTransito = tipo; } dreader.Close(); } } catch (Exception ex) { Base.Log.Log.EscribirLog(ex.Message); } finally { conn.Close(); } return houses; }
public static IList<PaperlessTipoTransito> ListarTiposTransitoTransbordo() { IList<PaperlessTipoTransito> tipos = new List<PaperlessTipoTransito>(); try { //Abrir Conexion conn = BaseDatos.NuevaConexion(); SqlCommand command = new SqlCommand("SP_L_PAPERLESS_TIPO_TRANSITO_TRANSBORDO", conn); command.CommandType = CommandType.StoredProcedure; dreader = command.ExecuteReader(); while (dreader.Read()) { var tipo = new PaperlessTipoTransito(); tipo.Id = Convert.ToInt64(dreader["Id"]); tipo.Nombre = dreader["Descripcion"].ToString(); tipos.Add(tipo); } } catch (Exception ex) { Base.Log.Log.EscribirLog(ex.Message); } finally { conn.Close(); } return tipos; }