示例#1
0
        private void BuscarAgendamentoData(string DataAgenda)
        {
            SqlConnection conexao = new SqlConnection(stringConn);

            _Sql = "Select * from Agenda where Data = @DataAgenda";
            try
            {
                conexao.Open();
                SqlCommand comando = new SqlCommand(_Sql, conexao);
                comando.Parameters.AddWithValue("@DataAgenda", DataAgenda);
                comando.CommandText = _Sql;
                SqlDataReader dr = comando.ExecuteReader();

                if (dr.Read())
                {
                    FrmPesquisarAgendamento PesquisarAgendamento = new FrmPesquisarAgendamento(dtp_Data.Text);
                    PesquisarAgendamento.ShowDialog();
                }
                else
                {
                    MessageBox.Show("Nenhum resultado encontrado. Tente outra opção!", "Caixa Fácil", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Caixa Fácil", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                conexao.Close();
            }
        }
 private void Menu_ProcurarTodosOsAgendamentos_Click(object sender, EventArgs e)
 {
     if (AreaAtuacao == "SALÃO DE BELEZA" || AreaAtuacao == "PRESTAÇÃO DE SERVIÇO" || AreaAtuacao == "SALÃO DE BELEZA E LOJA")
     {
         FrmPesquisarAgendamento pesquisarAgendamento = new FrmPesquisarAgendamento("Apartir de hoje");
         pesquisarAgendamento.ShowDialog();
     }
 }
        private void btn_Pesquisar_Click(object sender, EventArgs e)
        {
            FrmPesquisarAgendamento pesquisarAgendamento = new FrmPesquisarAgendamento("");

            pesquisarAgendamento.ShowDialog();
            if (pesquisarAgendamento.NomeCliente != "")
            {
                Codigo             = pesquisarAgendamento.Codigo;
                txt_Cliente.Text   = pesquisarAgendamento.NomeCliente;
                txt_Servico.Text   = pesquisarAgendamento.Servico;
                dtp_Data.Text      = pesquisarAgendamento.Data;
                mask_Horario.Text  = pesquisarAgendamento.Horario;
                txt_Email.Text     = pesquisarAgendamento.Email;
                mask_Telefone.Text = pesquisarAgendamento.Telefone;
            }
        }