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); } }
public DataTable SelecionarPorFiltro(AgendamentoDTO pAgendamentoDTO) { try { return AgendamentoDAO.SelecionarPesquisar(pAgendamentoDTO); } catch (Exception e) { throw e; } }
public Boolean Insere(AgendamentoDTO pAgendamentoDTO) { try { return AgendamentoDAO.Insere(pAgendamentoDTO); } catch (Exception e) { throw e; } }
public Boolean Excluir(AgendamentoDTO pAgendamentoDTO) { try { return AgendamentoDAO.Excluir(pAgendamentoDTO); } catch (Exception e) { throw e; } }
public Boolean Altera(AgendamentoDTO pAgendamentoDTO) { try { return AgendamentoDAO.Altera(pAgendamentoDTO); } catch (Exception e) { throw e; } }