private static void CargarLaboratorios() { var laboratorioBl = new LaboratorioBl(); var laboratorioList = laboratorioBl.GetLaboratoriossStaticCache(); _listaLaboratorios = laboratorioList; }
public JsonResult ObtenerEstablecimientosPorNombre(string nombre, string ExamenVA, TipoRegistroOrden tipoRegistro) { var laboratorioBl = new LaboratorioBl(); var laboratorioList = StaticCache.ObtenerLaboratorios(); laboratorioList = string.IsNullOrWhiteSpace(nombre) ? laboratorioList : laboratorioList.Where(x => x.Nombre.ToLower().Contains(nombre.Trim().ToLower()) || x.CodigoUnico.ToLower().Contains(nombre.Trim().ToLower())).ToList(); if (!string.IsNullOrWhiteSpace(ExamenVA) && (ExamenVA.ToUpper() == "VALIDADOR" || ExamenVA.ToUpper() == "ROMINS")) { var ClasificacionEESS = EstablecimientoSeleccionado.clasificacion.ToString(); if (ClasificacionEESS.TrimEnd().ToString().Contains("LAB INS")) { laboratorioList = laboratorioList.FindAll(p => p.IdLabIns == 1).ToList(); } else { laboratorioList = laboratorioList.FindAll(p => p.IdLabIns != 1).ToList(); } return(Json(laboratorioList, JsonRequestBehavior.AllowGet)); } if (tipoRegistro == TipoRegistroOrden.ORDEN_RECEPCION && (EstablecimientoSeleccionado.IdEstablecimiento == 991 || EstablecimientoSeleccionado.IdEstablecimiento == 23638)) { laboratorioList = laboratorioList.FindAll(p => p.IdLabIns == 1).ToList(); return(Json(laboratorioList, JsonRequestBehavior.AllowGet)); } if (tipoRegistro == TipoRegistroOrden.SOLO_ORDEN_MUESTRA) { if (ExamenVA.ToUpper() == "VALIDADOR") { var ClasificacionEESS = EstablecimientoSeleccionado.clasificacion.ToString(); if (ClasificacionEESS.TrimEnd().ToString().Contains("LAB INS")) { laboratorioList = laboratorioList.FindAll(p => p.IdLabIns == 1).ToList(); } else { laboratorioList = laboratorioList.FindAll(p => p.IdLabIns != 1).ToList(); } } else { laboratorioList = laboratorioList.FindAll(p => p.IdLabIns != 1).ToList(); } } else { laboratorioList = laboratorioList.FindAll(p => p.IdLabIns != 1).ToList(); } return(Json(laboratorioList, JsonRequestBehavior.AllowGet)); }