private IEnumerable <OsTi> Filtrar(HelpDeskFiltro filtro) { var chamados = _repositorio.Get.Where(ot => ot.ChamadoWeb == true); if (filtro.Codigo != null) { chamados = chamados.Where(ot => ot.IdOsTi == filtro.Codigo); } if (!string.IsNullOrEmpty(filtro.Descricao)) { chamados = chamados.Where(ot => ot.Titulo.ToLower().Contains(filtro.Descricao.ToLower())); } if (filtro.IdStatus != null) { chamados = chamados.Where(ot => ot.IdStatus == filtro.IdStatus); } if (filtro.IdUsuario != null) { chamados = chamados.Where(ot => ot.IdUsuario == filtro.IdUsuario); } if (filtro.IdSetor != null) { chamados = chamados.Where(ot => ot.IdSetor == filtro.IdSetor); } return(chamados); }
public ActionResult Filtro(HelpDeskFiltro filtro) { return(PartialView("_Filtro", filtro)); }