コード例 #1
0
        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;
            }
        }
コード例 #2
0
        public void AdicionarSeq(List <SequencialGed> seq)
        {
            TCEREDXEntities db = new TCEREDXEntities();

            db.SequencialGeds.AddRange(seq);
            db.SaveChanges();
        }
コード例 #3
0
        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;
            }
        }
コード例 #4
0
 public void AdicionarRange(List <Guia> seq)
 {
     try
     {
         TCEREDXEntities db = new TCEREDXEntities();
         db.Guias.AddRange(seq);
         db.SaveChanges();
     }
     catch (Exception ex)
     { throw ex; }
 }
コード例 #5
0
        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());
        }
コード例 #6
0
        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();
        }
コード例 #7
0
        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;
            }
        }
コード例 #8
0
        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;
            }
        }
コード例 #9
0
        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);
        }