Exemplo n.º 1
0
        public void MarcarUltimaDataRealizacao(int idProcesso, ProcessoAndamento fkCodProcAndRemarcado)
        {
            string[] andamentosAgenda =
            {
                "LICITAÇÃO MARCADA",
                // MF Inicio
                "LICITAÇÃO MARCADA EM CONTINUIDADE",
                // MF Fim
                "DISPUTA",
                "SESSÃO FINAL",
                "SESSÃO DE RESULTADO - HABILITAÇÃO",
                "SESSÃO DE RESULTADO - PROPOSTA COMERCIAL",
                "SESSÃO DE ABERTURA - PROPOSTA COMERCIAL",
                "SESSÃO DE ABERTURA - PROPOSTA TÉCNICA",
                "SESSÃO DE RESULTADO - PROPOSTA TÉCNICA"
            };

            DetachedCriteria dc = DetachedCriteria.For(typeof(ProcessoAndamento));

            dc.Add(Expression.Eq("Processo.Id", idProcesso));
            dc.Add(Expression.IsNull("AndamentoCorrigido"));
            dc.Add(Expression.IsNull("AndamentoAdiado"));
            dc.CreateAlias("FluxoAndamento", "fan");
            dc.CreateAlias("fan.Atividade", "ati");
            dc.Add(Expression.In("ati.Descricao", andamentosAgenda));
            dc.Add(Expression.Sql(" this_.dat_andamento_pan >= '" + DateTime.Now + "' order by this_.dat_andamento_pan desc "));
            ProcessoAndamento andamento = ProcessoAndamento.FindFirst(dc);

            if (andamento != null)
            {
                andamento.AndamentoAdiado = fkCodProcAndRemarcado;
                andamento.SaveAndFlush();
            }
        }
Exemplo n.º 2
0
        public string RegrasAndamentos(string tipoAndamento, string modalidade, int idProcesso)
        {
            string retorno = string.Empty;

            if (tipoAndamento.ToUpper().Equals("CONCLUÍDO") || tipoAndamento.ToUpper().Equals("EM CONFERÊNCIA"))
            {
                if (modalidade.ToUpper().Equals("PREGÃO ELETRÔNICO") || modalidade.ToUpper().Equals("PREGÃO PRESENCIAL"))
                {
                    DetachedCriteria dcPregoeiro = DetachedCriteria.For(typeof(ProcessoPapelPessoa));
                    dcPregoeiro.CreateAlias("Processo", "pro").CreateAlias("Papel", "pap");
                    dcPregoeiro.Add(Expression.Eq("pro.Id", idProcesso));
                    dcPregoeiro.Add(Expression.Eq("pap.Descricao", "PREGOEIRO"));

                    DetachedCriteria dcProcessoAndamento = DetachedCriteria.For(typeof(ProcessoAndamento));
                    dcProcessoAndamento.CreateAlias("Processo", "pro").CreateAlias("FluxoAndamento", "flu").CreateAlias("flu.Fase", "fas");
                    dcProcessoAndamento.Add(Expression.Eq("pro.Id", idProcesso));
                    dcProcessoAndamento.Add(Expression.Eq("fas.Descricao", "REALIZAÇÃO"));

                    if (!ProcessoPapelPessoa.Exists(dcPregoeiro) && ProcessoAndamento.Exists(dcProcessoAndamento))
                    {
                        retorno = "FAVOR CADASTRAR UM PREGOEIRO ANTES DE EFETUAR A CONCLUSÃO";
                    }
                }
            }
            return(retorno);
        }
Exemplo n.º 3
0
        public static bool VerificarUltimaRealizacaoDataMaiorQueDataRemarcacao(int idProcesso)
        {
            DetachedCriteria dc = DetachedCriteria.For(typeof(ProcessoAndamento));

            dc.Add(Expression.Eq("Processo.Id", idProcesso));
            dc.Add(Expression.IsNull("AndamentoCorrigido"));
            dc.Add(Expression.IsNull("AndamentoAdiado"));
            dc.CreateAlias("FluxoAndamento", "fan");
            dc.CreateAlias("fan.Atividade", "ati");
            dc.Add(Expression.Sql(@"
			 this_.pk_cod_processo_andamento_pan in 
			(select pan.pk_cod_processo_andamento_pan from adm_licitar.tb_processo_andamento_pan pan
			inner join adm_licitar.tb_fluxo_andamento_fan fan on fan.pk_cod_fluxo_andamento_fan = pan.fk_cod_fluxo_andamento_fan
			inner join adm_licitar.tb_atividade_ati ati on ati.pk_cod_atividade_ati = fan.fk_cod_atividade_ati
			and fk_cod_processo_andamento_remarcado_pan is null	
			and fk_cod_processo_andamento_pan is null
			where fk_cod_processo_pro = "             + idProcesso + @"  and txt_descricao_ati in
			(
			 'LICITAÇÃO MARCADA', 'LICITAÇÃO MARCADA EM CONTINUIDADE', 'DISPUTA', 'SESSÃO FINAL',  'SESSÃO DE RESULTADO - HABILITAÇÃO',  'SESSÃO DE RESULTADO - PROPOSTA COMERCIAL', 'SESSÃO DE ABERTURA - PROPOSTA COMERCIAL',  'SESSÃO DE ABERTURA - PROPOSTA TÉCNICA', 'SESSÃO DE RESULTADO - PROPOSTA TÉCNICA'
			) and dat_andamento_pan >= '"
                                  + DateTime.Now +
                                  @"' order by dat_andamento_pan desc limit 1)"));


            ;
            ProcessoAndamento andamento = ProcessoAndamento.FindOne(dc);

            if (andamento != null)
            {
                return(true);
            }
            return(false);
        }
Exemplo n.º 4
0
        public ProcessoAndamento getObjetoUltimoAndamentoProcesso(int idProcesso)
        {
            string idStrAndamento = "";
            string select         = @"
			SELECT pan.pk_cod_processo_andamento_pan
			FROM adm_licitar.tb_processo_pro pro, adm_licitar.tb_processo_andamento_pan pan
			WHERE pro.pk_cod_processo_pro = pan.fk_cod_processo_pro
			AND pan.fk_cod_processo_andamento_pan is null			
			AND pro.pk_cod_processo_pro = @pk_cod_processo_pro
			ORDER BY pan.dat_cadastro_pan DESC, pan.pk_cod_processo_andamento_pan DESC
			LIMIT 1"            ;

            select = select.Replace("@pk_cod_processo_pro", idProcesso.ToString());

            DataTable dt = Consultar(select);

            foreach (DataRow row in dt.Rows)
            {
                idStrAndamento = row["pk_cod_processo_andamento_pan"].ToString();
            }

            int id = 0;

            int.TryParse(idStrAndamento, out id);

            if (id > 0)
            {
                return(ProcessoAndamento.Find(id));
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 5
0
        public static bool VerificarSeJaFoiDadoAndamentoAgendaComDataIgual(int idProcesso, DateTime data)
        {
            string[] andamentosAgenda =
            {
                "LICITAÇÃO MARCADA",
                // MF Inicio
                "LICITAÇÃO MARCADA EM CONTINUIDADE",
                // MF Fim
                "DISPUTA",
                "SESSÃO FINAL",
                "SESSÃO DE RESULTADO - HABILITAÇÃO",
                "SESSÃO DE RESULTADO - PROPOSTA COMERCIAL",
                "SESSÃO DE ABERTURA - PROPOSTA COMERCIAL",
                "SESSÃO DE ABERTURA - PROPOSTA TÉCNICA",
                "SESSÃO DE RESULTADO - PROPOSTA TÉCNICA"
            };

            DetachedCriteria dc = DetachedCriteria.For(typeof(ProcessoAndamento));

            dc.Add(Expression.Eq("Processo.Id", idProcesso));
            dc.Add(Expression.IsNull("AndamentoCorrigido"));
            dc.Add(Expression.IsNull("AndamentoAdiado"));
            dc.CreateAlias("FluxoAndamento", "fan");
            dc.CreateAlias("fan.Atividade", "ati");
            dc.Add(Expression.In("ati.Descricao", andamentosAgenda));
            dc.Add(Expression.Sql(" this_.dat_andamento_pan = '" + data + "' "));
            ProcessoAndamento[] andamentos = ProcessoAndamento.FindAll(dc);

            if (andamentos.Length > 0)
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 6
0
        public int  RetornarUltimoIdDataMarcacao(int idProcesso, int processoAndamentoAdiado)
        {
            string[] andamentosAgenda =
            {
                "LICITAÇÃO MARCADA",
                "LICITAÇÃO MARCADA EM CONTINUIDADE",
                "DISPUTA",
                "SESSÃO FINAL",
                "SESSÃO DE RESULTADO - HABILITAÇÃO",
                "SESSÃO DE RESULTADO - PROPOSTA COMERCIAL",
                "SESSÃO DE ABERTURA - PROPOSTA COMERCIAL",
                "SESSÃO DE ABERTURA - PROPOSTA TÉCNICA",
                "SESSÃO DE RESULTADO - PROPOSTA TÉCNICA"
            };

            DetachedCriteria dc = DetachedCriteria.For(typeof(ProcessoAndamento));

            dc.Add(Expression.Eq("Processo.Id", idProcesso));
            dc.Add(Expression.IsNull("AndamentoCorrigido"));
            dc.CreateAlias("AndamentoAdiado", "adi");
            dc.Add(Expression.Eq("adi.Id", processoAndamentoAdiado));
            dc.CreateAlias("FluxoAndamento", "fan");
            dc.CreateAlias("fan.Atividade", "ati");
            dc.Add(Expression.In("ati.Descricao", andamentosAgenda));
            dc.Add(Expression.Sql(" this_.dat_andamento_pan >= '" + DateTime.Now + "' order by this_.dat_andamento_pan desc "));
            ProcessoAndamento andamento = ProcessoAndamento.FindFirst(dc);

            return(andamento.Id);
        }
Exemplo n.º 7
0
        public ProcessoAndamento[] listarAndamentosProcesso(string idProcesso)
        {
            DetachedCriteria pesquisa = DetachedCriteria.For(typeof(ProcessoAndamento));

            pesquisa.Add(Expression.Eq("Processo.Id", int.Parse(idProcesso)));
            Order[] ordem = new Order[] { Order.Desc("DataCadastro") };

            return(ProcessoAndamento.FindAll(pesquisa, ordem));
        }
Exemplo n.º 8
0
        public ProcessoAndamento[] listarAndamentosProcesso(int idPai)
        {
            DetachedCriteria dc = DetachedCriteria.For(typeof(ProcessoAndamento));

            dc.AddOrder(Order.Asc("DataCadastro"));
            dc.Add(Expression.Eq("Processo.Id", idPai));
            dc.Add(Expression.IsNull("AndamentoCorrigido"));

            return(ProcessoAndamento.FindAll(dc));
        }
Exemplo n.º 9
0
        public static bool VerificarSeExisteAssociacaoAntesDeExcluir(int idProcessoAndamentoExcluir)
        {
            DetachedCriteria dc = DetachedCriteria.For(typeof(ProcessoAndamento));

            dc.Add(Expression.Eq("AndamentoCorrigido.Id", idProcessoAndamentoExcluir));
            if (ProcessoAndamento.FindAll(dc).Length > 0)
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 10
0
        public void DescartarAgenda(int idProcessoAndamento, int idProcessoAndamentoRemarcado)
        {
            DetachedCriteria dc = DetachedCriteria.For(typeof(Agenda));

            dc.Add(Expression.Eq("ProcessoAndamento.Id", idProcessoAndamento));
            Agenda[] agendas = Agenda.FindAll(dc);
            for (int i = 0; i < agendas.Length; i++)
            {
                ProcessoAndamento procAnd = ProcessoAndamento.Find(idProcessoAndamentoRemarcado);
                agendas[i].ProcessoAndamentoRemarcado = new ProcessoAndamento(idProcessoAndamentoRemarcado);
                agendas[i].UpdateAndFlush();
            }
        }
Exemplo n.º 11
0
        public ProcessoAndamento getUltimoAndamentoProcessoPorTipo(int idProcesso, string tipoAndamento)
        {
            DetachedCriteria dc = DetachedCriteria.For(typeof(ProcessoAndamento));

            dc.CreateAlias("FluxoAndamento", "fan");
            dc.CreateAlias("fan.Atividade", "ati");

            dc.Add(Expression.Eq("Processo.Id", idProcesso));
            dc.Add(Expression.Eq("ati.Descricao", tipoAndamento));
            dc.AddOrder(Order.Desc("DataCadastro"));
            dc.AddOrder(Order.Desc("Id"));

            return(ProcessoAndamento.FindFirst(dc));
        }
Exemplo n.º 12
0
        public bool RetornaPublicacaoEdital(int idProcesso)
        {
            bool             retorno         = false;
            DetachedCriteria dcPesqPubEdital = DetachedCriteria.For(typeof(ProcessoAndamento), "pan");

            dcPesqPubEdital.CreateAlias("FluxoAndamento", "fan").CreateAlias("fan.Atividade", "ati").CreateAlias("Processo", "pro")
            .Add(Expression.Eq("ati.Descricao", "Publicação de Edital").IgnoreCase()).Add(Expression.Eq("pro.Id", idProcesso));
            dcPesqPubEdital.SetProjection(Property.ForName("Id"));
            if (ProcessoAndamento.Exists(dcPesqPubEdital))
            {
                retorno = true;
            }

            return(retorno);
        }
Exemplo n.º 13
0
        public void DesMarcarUltimaDataRealizacao(int fkCodProcAndRemarcado)
        {
            DetachedCriteria dc = DetachedCriteria.For(typeof(ProcessoAndamento));

            dc.Add(Expression.Eq("AndamentoAdiado", ProcessoAndamento.Find(fkCodProcAndRemarcado)));

            ProcessoAndamento[] andamento = ProcessoAndamento.FindAll(dc);

            if (andamento.Length > 0)
            {
                foreach (ProcessoAndamento procAnd in andamento)
                {
                    procAnd.AndamentoAdiado = null;
                    procAnd.SaveAndFlush();
                }
            }
        }
Exemplo n.º 14
0
        public static bool VerificarSeJaPassouPelaFase(string descricaoFase, int idProcesso)
        {
            DetachedCriteria dc = DetachedCriteria.For(typeof(ProcessoAndamento));

            dc.Add(Expression.Eq("Processo.Id", idProcesso));
            dc.CreateAlias("FluxoAndamento", "fan");
            dc.CreateAlias("fan.Fase", "fas");
            dc.Add(Expression.InsensitiveLike("fas.Descricao", descricaoFase));
            ProcessoAndamento[] andamentos = ProcessoAndamento.FindAll(dc);

            if (andamentos.Length > 0)
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 15
0
        ///Método criado para a central de digitalização de processos salvar andamentos retornando o id do andamento usado
        public int SalvarAndamento(int idProcesso, ref FileUpload fileUpload, Pessoa pessoa, string descricaoModalidade, string faseProcesso, string endereco, string observacaoAndamento)
        {
            Processo          oProcesso          = Processo.Find(idProcesso);
            ProcessoAndamento oProcessoAndamento = new ProcessoAndamento();
            SrvFluxoAndamento srvFluxo           = new SrvFluxoAndamento();
            SrvProcesso       srvProc            = new SrvProcesso();

            SrvMotivoAndamento srvMotivoAnd = new SrvMotivoAndamento();

            oProcessoAndamento.Cadastrante   = pessoa;
            oProcessoAndamento.DataCadastro  = DateTime.Now;
            oProcessoAndamento.DataAndamento = DateTime.Now;
            oProcessoAndamento.Andamento     = observacaoAndamento;
            oProcessoAndamento.Processo      = srvProc.ListarProcesso(idProcesso);

            oProcessoAndamento.FluxoAndamento = srvFluxo.RetornaFluxoAndamento(oProcesso.Classificacao.Modalidade.Descricao, descricaoModalidade, faseProcesso);

            if (!string.IsNullOrEmpty(fileUpload.FileName))
            {
                if (!ValidarExtensao(fileUpload.FileName))
                {
                    throw new Exception("Por favor, verificar se a extensão do arquivo está correta. Tipo de arquivo inválido. Só é aceito arquivos: .pdf, .p7s. Para mairores detalhes entre em contato com a CTI.");
                }
                else
                {
                    if (oProcessoAndamento.FluxoAndamento != null)
                    {
                        oProcessoAndamento.SaveAndFlush();
                        SalvarArquivo(oProcessoAndamento.Id, ref fileUpload, endereco.Replace("@ESTRUTURAREPOSITORIO", SrvDigitalizacao.getEnderecoRegraRepositorio(idProcesso, oProcessoAndamento.Id)));
                        DAOGenerico dao = new DAOGenerico();
                        //dao.AtualizarTabelaoComPublicacaoEdital(oProcessoAndamento.Processo.Id,oProcessoAndamento.Id.ToString());
                    }
                    else
                    {
                        throw new Exception("NÃO EXISTE FLUXO ANDAMENTO CADASTRADO PARA ESSE TIPO DE PROCESSO");
                    }
                }
            }
            else
            {
                throw new Exception("É necessário escolher um arquivo para anexar ao processo.");
            }
            return(oProcessoAndamento.Id);
        }
Exemplo n.º 16
0
        public void AdiamentodeAndamentosCorrigidos(int idUltimoCorrige, int fkProcAndAdiado)
        {
            try
            {
                DetachedCriteria pesqAndamentosCorrigidos = DetachedCriteria.For(typeof(ProcessoAndamento));
                pesqAndamentosCorrigidos.Add(Expression.Eq("AndamentoCorrigido.Id", idUltimoCorrige)).AddOrder(Order.Desc("Id"));

                ProcessoAndamento procAnd = ProcessoAndamento.FindFirst(pesqAndamentosCorrigidos);
                if (procAnd != null)
                {
                    procAnd.AndamentoAdiado = new ProcessoAndamento(fkProcAndAdiado);
                    procAnd.Update();

                    AdiamentodeAndamentosCorrigidos(procAnd.Id, fkProcAndAdiado);
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Exemplo n.º 17
0
        public ProcessoAndamento[] listarAndamentosProcesso(int idPai, bool corrigido, bool desc)
        {
            DetachedCriteria dc = DetachedCriteria.For(typeof(ProcessoAndamento));

            if (desc)
            {
                dc.AddOrder(Order.Desc("DataCadastro"));
            }
            else
            {
                dc.AddOrder(Order.Asc("DataCadastro"));
            }

            dc.AddOrder(Order.Desc("Id"));
            dc.Add(Expression.Eq("Processo.Id", idPai));
            if (corrigido)
            {
                dc.Add(Expression.IsNull("AndamentoCorrigido"));
            }

            return(ProcessoAndamento.FindAll(dc));
        }
Exemplo n.º 18
0
        //Método para listar os arquivos digitalizados de um processo.
        public static ArrayList listarArquivosDigitalizados(ProcessoAndamento processoAndamento)
        {
            int idProcesso = processoAndamento.Processo.Id;

            return(listarArquivosDigitalizados(idProcesso));
        }
Exemplo n.º 19
0
        //Gera Endereço da Regra 500 apartir do idProcesso e idAndamento
        public static string getEnderecoRegraRepositorio(int idAndamento)
        {
            ProcessoAndamento processoAndamento = ProcessoAndamento.Find(idAndamento);

            return(getEnderecoRegraRepositorio(processoAndamento.Processo.Id, processoAndamento.Id));
        }