private void CarregarLogsSms(Agenda agenda)
        {
            try
            {
                List <LogSmsAgenda> logs =
                    new LogSmsAgendaRepository()
                    .Retreave(new LogSmsAgenda()
                {
                    Agenda = agenda
                }, null, null);

                VsLogSmsAgendas = logs;
                this.gvLogSmsAgenda.DataSource = logs;
                this.gvLogSmsAgenda.DataBind();

                this.lblTotalRegistrosLogSms.Text     = logs.Count.ToString();
                this.infoTotalRegistrosLogSms.Visible = true;
            }
            catch (Exception e)
            {
                Log.Create(e);
                Email.Send("Agendamento de congelação - falha na aplicação", e);
                this.msgDialog.Show("Erro", "Ocorreu uma falha ao carregar os registros de log SMS da agenda.", UserControl.Message.Type.Error);
            }
        }
        public void CarregarLogSmsAgenda()
        {
            try
            {
                LogSmsAgenda logSmsAgenda = new LogSmsAgenda();
                logSmsAgenda = new LogSmsAgendaRepository().Details(new LogSmsAgenda()
                {
                    LogSmsAgendaID = LogSmsAgendaID
                });

                this.txtLogSmsAgendaID.Text = logSmsAgenda.LogSmsAgendaID.Value.ToString();

                Boolean smsEnviado = logSmsAgenda.SMSEnviado.Value;
                this.txtSMSEnviado.Text = smsEnviado ? "Sim" : "Não";
                this.txtSMSEnviado.Attributes["style"] = String.Format("color:{0} !important;", smsEnviado ? "green" : "red");
                this.txtSMSEnviado.CssClass            = String.Format("{0} {1}", this.txtSMSEnviado.CssClass, (smsEnviado ? "w3-pale-green" : "w3-pale-red"));
                this.txtSMSEnviado.Font.Bold           = true;

                this.txtSMSDataProcessamento.Text = logSmsAgenda.SMSDataProcessamento.Value.ToString("yyyy-MM-dd");
                this.txtSMSHoraProcessamento.Text = logSmsAgenda.SMSDataProcessamento.Value.ToString("HH:mm:ss");
                this.txtSMSMessageID.Text         = (logSmsAgenda.SMSMessageID != "NULL") ? logSmsAgenda.SMSMessageID : String.Empty;
                this.txtObservacao.Text           = logSmsAgenda.Observacao;

                this.CarregarAgenda(logSmsAgenda.Agenda);
            }
            catch (Exception e)
            {
                Log.Create(e);
                Email.Send("Agendamento de congelação - falha na aplicação", e);
                this.msgDialog.Show("Erro", "Ocorreu uma falha ao carregar o log de SMS de agenda.", UserControl.Message.Type.Error);
            }
        }
Esempio n. 3
0
        private void CarregarLogSmsAgenda()
        {
            try
            {
                LogSmsAgenda logSmsAgenda = new LogSmsAgenda();
                logSmsAgenda.SMSMessageID = this.txtSMSMessageID.Text.Length > 0 ? this.txtSMSMessageID.Text : null;

                if (this.rbtTodos.Checked)
                {
                    logSmsAgenda.SMSEnviado = null;
                }
                else if (this.rbtEnviado.Checked)
                {
                    logSmsAgenda.SMSEnviado = true;
                }
                else
                {
                    logSmsAgenda.SMSEnviado = false;
                }

                DateTime?dataInicial = null;
                DateTime?dataFinal   = null;

                if (!String.IsNullOrEmpty(this.txtDataInicial.Text))
                {
                    dataInicial = Convert.ToDateTime(this.txtDataInicial.Text);
                }

                if (!String.IsNullOrEmpty(this.txtDataFinal.Text))
                {
                    dataFinal = Convert.ToDateTime(this.txtDataFinal.Text);
                    TimeSpan hora = new TimeSpan(23, 59, 59);
                    dataFinal = dataFinal.Value.Add(hora);
                }

                List <LogSmsAgenda> logs = new LogSmsAgendaRepository().Retreave(logSmsAgenda, dataInicial, dataFinal);

                VsLogSmsAgendas = logs;
                this.gvLogSmsAgenda.DataSource = logs;
                this.gvLogSmsAgenda.DataBind();
                this.lblTotalRegistros.Text     = logs.Count.ToString();
                this.infoTotalRegistros.Visible = true;
            }
            catch (Exception e)
            {
                Log.Create(e);
                Email.Send("Agendamento de congelação - falha na aplicação", e);
                this.msgDialog.Show("Erro", "Ocorreu uma falha ao carregar os registros de log's de SMS das agendas.", UserControl.Message.Type.Error);
            }
        }