示例#1
0
        public IEnumerable <AgendamentoInfo> ObterTodosAgendamentosEnfileirar()
        {
            try
            {
                using (_contexto.Connection)
                {
                    _contexto.GetConnection();
                    var q            = AgendamentoInfoQueries.SelecionarAgendamentosEnfileirar();
                    var agendamentos = _contexto
                                       .Connection
                                       .Query <AgendamentoInfo>(q, new { });


                    foreach (var ag in agendamentos)
                    {
                        ag.AtualizaEmail(_contexto
                                         .Connection
                                         .Query <EmailInfo>(EmailInfoQueries.SelectEmailInfoPorId(ag.IdProcesso.ToString()), new { Id = ag.IdProcesso.ToString() }).FirstOrDefault());
                    }

                    return(agendamentos);
                }
            }
            catch (SQLiteException ex)
            {
                throw ex;
            }
        }
示例#2
0
        public AgendamentoInfo ObterAgendamento(string Id)
        {
            try
            {
                using (_contexto.Connection)
                {
                    _contexto.GetConnection();


                    var agendamento = _contexto
                                      .Connection
                                      .Query <AgendamentoInfo>(AgendamentoInfoQueries.SelectAgendamentoInfoPorId(Id.ToString()), new { Id = Id }).FirstOrDefault();

                    agendamento.AtualizaEmail(_contexto
                                              .Connection
                                              .Query <EmailInfo>(EmailInfoQueries.SelectEmailInfoPorId(Id.ToString()), new { Id = Id }).FirstOrDefault());

                    return(agendamento);
                }
            }
            catch (SQLiteException ex)
            {
                throw ex;
            }
        }