public void DevolverGuia(string text) { try { TCEREDXEntities db = new TCEREDXEntities(); List <Guia> guiaResult = (from g in db.Guias where g.NumeroGuia == text select g).ToList(); foreach (Guia g in guiaResult) { g.Devolvido = true; } List <Processo> proResult = (from g in db.Processoes where g.NumeroGuia == text select g).ToList(); foreach (Processo g in proResult) { g.Devolvido = true; } db.SaveChanges(); } catch (Exception ex) { throw ex; } }
public void AdicionarSeq(List <SequencialGed> seq) { TCEREDXEntities db = new TCEREDXEntities(); db.SequencialGeds.AddRange(seq); db.SaveChanges(); }
public void DigitalizarProcesso(Processo p) { try { TCEREDXEntities db = new TCEREDXEntities(); var proResult = (from g in db.Processoes where g.NumeroGuia == p.NumeroGuia && g.NProcesso == p.NProcesso && g.AnoProcesso == p.AnoProcesso select g).ToList().AsEnumerable(); foreach (Processo g in proResult) { g.Digitalizado = true; g.PastaDestino = p.PastaDestino; } var pro2Result = (from g in db.Processoes where g.NumeroGuia == p.NumeroGuia && g.NProcesso == p.NProcesso && g.AnoProcesso == p.AnoProcesso select g).ToList().Count(); if (pro2Result == 0) { DALGuia guia = new DALGuia(); guia.DigitalizarGuia(p); } db.SaveChanges(); } catch (Exception ex) { throw ex; } }
public void AdicionarRange(List <Guia> seq) { try { TCEREDXEntities db = new TCEREDXEntities(); db.Guias.AddRange(seq); db.SaveChanges(); } catch (Exception ex) { throw ex; } }
public List <Processo> CarregarPRocessos(string text) { TCEREDXEntities db = new TCEREDXEntities(); var lista = db.Processoes.AsEnumerable(); List <Processo> result = db.Processoes.AsEnumerable().Where(x => x.NumeroGuia.Contains(text)).ToList(); return(result.ToList()); }
private void AtualizarSequencial(Processo p, int Seq) { TCEREDXEntities db = new TCEREDXEntities(); var proResult = (from g in db.SequencialGeds where g.Numero.ToString() == p.NProcesso && g.Ano == p.AnoProcesso select g); foreach (SequencialGed seq in proResult) { seq.Sequencial = seq.Sequencial + 1; } db.SaveChanges(); }
public Guia CarregarGuia(String numGuia) { try { TCEREDXEntities db = new TCEREDXEntities(); Guia guiaResult = (from g in db.Guias where g.NumeroGuia == numGuia select g).Single(); return(guiaResult); } catch (Exception ex) { throw ex; } }
internal void DigitalizarGuia(Processo p) { try { TCEREDXEntities db = new TCEREDXEntities(); List <Guia> guiaResult = (from g in db.Guias where g.NumeroGuia == p.NumeroGuia && p.AnoGuia == g.AnoGuia select g).ToList(); foreach (Guia g in guiaResult) { g.Digitalizado = true; } db.SaveChanges(); } catch (Exception ex) { throw ex; } }
public int ObterSequencial(Processo p) { TCEREDXEntities db = new TCEREDXEntities(); int proResult = (from g in db.SequencialGeds where g.Numero.ToString() == p.NProcesso && g.Ano == p.AnoProcesso select g.Sequencial).Max(); if (proResult == 0) { InserirSequencial(p); } else { AtualizarSequencial(p, proResult); } proResult = proResult + 1; return(proResult); }