Ejemplo n.º 1
0
 private void textBox1_TextChanged(object sender, EventArgs e)
 {
     if (radioButton1.Checked == true)
     {
         dataGridView1.DataSource = null;
         if (textBox1.Text != "")
         {
             Nutricao nut = new Nutricao();
             nut.Consultar_Cliente_nome(dataGridView1, textBox1.Text);
         }
     }
     else
     {
         dataGridView1.DataSource = null;
         if (textBox1.Text != "")
         {
             Nutricao nut = new Nutricao();
             nut.Consultar_Cliente_cpf(dataGridView1, textBox1.Text);
         }
     }
 }
Ejemplo n.º 2
0
        private void button2_Click_1(object sender, EventArgs e)
        {
            string nome = textBox3.Text;
            string cpf  = textBox4.Text;
            string uf   = comboBox1.Text;

            Nutricao cliente = new Nutricao();

            cliente.set_cpf(cpf);
            cliente.set_nome(nome);
            cliente.set_uf(uf);
            cliente.set_Id_Nutricionista(Id_Nutricionista);

            if (flag == 0)
            {
                cliente.Cadastrar_cliente();
                textBox3.Text  = "";
                textBox4.Text  = "";
                comboBox1.Text = "";
                string nome_combo = comboBox1.Text;
            }
            else
            {
                cliente.editar_cliente();
                textBox3.Text  = "";
                textBox4.Text  = "";
                comboBox1.Text = "";
                string nome_combo = comboBox1.Text;
                this.Close();

                if (opcao == 1)
                {
                    cliente.Consultar_Cliente_nome(datagrid, busca);
                }
                else
                {
                    cliente.Consultar_Cliente_cpf(datagrid, busca);
                }
            }
        }
Ejemplo n.º 3
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (dataGridView1.SelectedRows.Count > 0)
     {
         String   busca = Convert.ToString(dataGridView1.CurrentRow.Cells[0].Value);
         Nutricao nut   = new Nutricao();
         if (radioButton1.Checked == true)
         {
             nut.excluir_cliente(busca, dataGridView1, textBox1.Text);
             nut.Consultar_Cliente_nome(dataGridView1, textBox1.Text);
         }
         else
         {
             nut.excluir_cliente(busca, dataGridView1, textBox1.Text);
             nut.Consultar_Cliente_cpf(dataGridView1, textBox1.Text);
         }
     }
     else
     {
         MessageBox.Show("Selecione um usuário para exclusão !");
     }
 }