public List<Lote> ListarLotesTipificar(int idUsuario, int idOrigem, int idServico) { try { Lote _lote = new Lote(); List<Lote> _lotes = new List<Lote>(); List<Lote> _lotes_temp = new List<Lote>(); LoteItem _item = new LoteItem(); List<LoteItem> _itens = new List<LoteItem>(); this._queryParams.Clear(); this._queryParams["Usuario_ID"] = idUsuario; this._queryParams["Origem_ID"] = idOrigem; this._queryParams["Servico_ID"] = idServico; _lotes = _repository.ListarLotes(this._queryParams).Where(l => l.StatusLote == 1010).ToList<Lote>(); foreach (Lote lote in _lotes) { lote.Itens.AddRange(ListarItensLote(lote.ID, idUsuario, idServico, true, 1000)); } /* int n=0; foreach (var tmp_lote in _lote.Itens) { if (tmp_lote.StatusImagem == 2000) { tmp_lote.Itens.RemoveRange(n, 1); } n++; } foreach (var _lt in _lotes[].Itens.){ _lt.Itens. _lotes_temp.AddRange(_lt.Itens.Where(x => x.StatusImagem == 1000).ToList<Lote>()); }*/ return _lotes; } catch (Exception ex) { throw ex; } }
private LoteItem ConverteBaseLoteItens(IDataReader dt) { LoteItem _item = new LoteItem(); _item = (new LoteItem { ID = int.Parse(dt["IdLoteItem"].ToString()), IdLote = int.Parse(dt["IdLote"].ToString()), NomeFinal = dt["ImgNomeFinal"].ToString(), NomeOriginal = dt["ImgNomeOriginal"].ToString(), SequenciaCaptura = int.Parse(dt["SequenciaCaptura"].ToString()), Verso = Boolean.Parse(dt["Verso"].ToString()), DataCaptura = DateTime.Parse(dt["DataCriacao"].ToString()), StatusImagem = int.Parse(dt["StatusImagem"].ToString()), DocumentoModelo = (new DocumentoModelo { ID = int.Parse(dt["IdDocumentoModelo"].ToString()) }), UsuarioCaptura = (new Usuario { ID = int.Parse(dt["IdUsuarioCaptura"].ToString()) }) }); return _item; }