Esempio n. 1
0
        public static string DataMarcacao(int idProcesso)
        {
            string[] andamentosAgenda =
            {
                "LICITAÇÃO MARCADA",
                "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);
            string            retorno   = string.Empty;

            if (andamento != null && Utilidade.UtdValidador.ValidarData(Convert.ToString(andamento.DataAndamento)))
            {
                retorno = andamento.DataAndamento.ToString("dd/MM/yyyy");
            }
            return(retorno);
        }
Esempio n. 2
0
        public static DateTime DataProcesso(int id, string tipoData)
        {
            DetachedCriteria dc = DetachedCriteria.For(typeof(ProcessoAndamento));

            dc.CreateAlias("FluxoAndamento", "fa");
            dc.CreateAlias("fa.Atividade", "at");
            dc.Add(Expression.Eq("Processo.Id", id));
            dc.Add(Expression.Eq("at.Descricao", tipoData));
            dc.AddOrder(Order.Asc("DataCadastro"));

            ProcessoAndamento pa = ProcessoAndamento.FindFirst(dc);

            if (pa != null)
            {
                return(pa.DataAndamento);
            }

            return(DateTime.MinValue);
        }