protected void btnAgendar_Click(object sender, EventArgs e)
        {
            AgendamentoDTO agendamentoDTO = new AgendamentoDTO();
            AgendamentoCT agendamentoCT = new AgendamentoCT();

            try
            {
                agendamentoDTO.IdVenda = Convert.ToInt32(idVenda);
                agendamentoDTO.IdFuncionario = Convert.ToInt32(ddlFuncionario.SelectedValue);
                agendamentoDTO.IdHorario = Convert.ToInt32(idHorario);
                if (valida(0, data))
                {
                    agendamentoDTO.DataAgendamento = Convert.ToDateTime(data);
                    if (agendamentoCT.Insere(agendamentoDTO))
                    {
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "alerta", "alert('Agendamento incluído!'); window.location.href='" + PaginaDeAgendamento + "';", true);
                    }
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "alerta", "alert('Erro ao incluir agendamento. Verifique a data informada!'); window.location.href='" + PaginaDeAgendamento + "';", true);
                }

            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alerta", "alert('Erro ao incluir agendamento. Verifique os dados informados!');", true);
            }
        }
예제 #2
0
 public DataTable SelecionarPorFiltro(AgendamentoDTO pAgendamentoDTO)
 {
     try
     {
         return AgendamentoDAO.SelecionarPesquisar(pAgendamentoDTO);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
예제 #3
0
 public Boolean Insere(AgendamentoDTO pAgendamentoDTO)
 {
     try
     {
         return AgendamentoDAO.Insere(pAgendamentoDTO);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
예제 #4
0
 public Boolean Excluir(AgendamentoDTO pAgendamentoDTO)
 {
     try
     {
         return AgendamentoDAO.Excluir(pAgendamentoDTO);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
예제 #5
0
 public Boolean Altera(AgendamentoDTO pAgendamentoDTO)
 {
     try
     {
         return AgendamentoDAO.Altera(pAgendamentoDTO);
     }
     catch (Exception e)
     {
         throw e;
     }
 }