public List <Models.TransitoActualModel> GetTransitosTabla(string filtro) { string style = "height: 24px !important; width: 24px !important; margin-right: 15px !important; font-size: 24px !important; vertical-align: middle !important; color: #00796b !important;"; List <TRANSITO_ACTUALES> transitos = Logic_Transitos.ListarTransitosActuales(filtro); List <Models.TransitoActualModel> listado = new List <Models.TransitoActualModel>(); Models.TransitoActualModel tm = null; foreach (TRANSITO_ACTUALES transito in transitos) { tm = new Models.TransitoActualModel(); tm.data = transito; tm.Ver = "<span class=\"glyphicon glyphicon-list-alt \" aria-hidden='true' style='" + style + "' onclick=\"verTransito(" + tm.data.ID_TRANSITO + ", '" + tm.data.MAT_CABINA + "')\"></span>"; listado.Add(tm); } return(listado); }
public Models.TransitoActualModel VerTransito(string matCabina, Nullable <int> idTransito) { TRANSITO_ACTUALES tactual = null; Models.TransitoActualModel mod = new Models.TransitoActualModel(); var listaTransitos = Logic_Transitos.ListarTransitosActuales(matCabina); if (idTransito.HasValue) { tactual = listaTransitos.Where(x => x.ID_TRANSITO == idTransito).FirstOrDefault(); mod.data = tactual; mod.TEXTO_PRODUCTO = Logic_Transitos.ObtenerProductoPorID(tactual.ID_PRODUCTO).NOMBRE; mod.TEXTO_AGENCIA = Logic_Transitos.ObtenerEmpresaPorID(tactual.ID_AGENCIA).NOMBRE; mod.TEXTO_CLIENTE = Logic_Transitos.ObtenerEmpresaPorID(tactual.ID_CLIENTE).NOMBRE; mod.TEXTO_POSEEDOR = Logic_Transitos.ObtenerEmpresaPorID(tactual.ID_POSEEDOR).NOMBRE; mod.TEXTO_PROVEEDOR = Logic_Transitos.ObtenerEmpresaPorID(tactual.ID_PROVEEDOR).NOMBRE; string nombreConductor = string.Format("{0} {1}", Logic_Transitos.ObtenerConductorPorID(tactual.ID_CONDUCTOR).NOMBRE, Logic_Transitos.ObtenerConductorPorID(tactual.ID_CONDUCTOR).APELLIDOS); mod.TEXTO_CONDUCTOR = nombreConductor; } return(mod); }