private void button1_Click(object sender, EventArgs e)
 {
     MetodosCandidato g = new MetodosCandidato();
     g.ActualizarCand(ID, textBox1.Text, textBox2.Text, textBox5.Text, maskedTextBox1.Text, comboBox1.SelectedItem.ToString(), pictureBox1);
     mc = new MetodosComunes();
     mc.DetallesCandidato(ID, textBox1, textBox2, textBox3, textBox4, textBox5, maskedTextBox1, maskedTextBox2, pictureBox1);
 }
예제 #2
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Está seguro que desea limpiar toda la información de los campos del Padre/Tutor? ", "Advertencia",
       MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No)
     {
         return;
     }
     else
     {   mc = new MetodosComunes();
         mc.LimpiarCampos(nombre, apellido, dir);
         ced.Clear();
         tel.Clear();
     }//END IF
 }
예제 #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            Image Foto;

            if(nombre.Text.Length==0 || apellido.Text.Length==0 || ced.Text.Trim().Length<16 || dir.Text.Length==0){
                MessageBox.Show("Complete la información del tutor antes de regitrar","Información");
            }else{
            string query = "Select *From Candidatos where nombre='" + nombreNin.Text
                + "' AND apellido= '"+apellidoNin.Text+"' AND dir='"+dirNin.Text
                +"' AND fecha_nac= '"+fechaNac.Text+"' AND Tipo='Niño'";

            mc = new MetodosComunes();
            mc.GuardarTutor(nombre.Text, apellido.Text, ced.Text, dir.Text, tel.Text, query);
            this.Dispose();

            Candidato cand = new Candidato();
            Camara cam = new Camara("", "", "", "", "", "", "", 0,"", "", "", "", "",cand);

            Foto = cam.Captura.Image;
            Candidato c = new Candidato(Foto, cam, "", "", "", "", "", "","", -1, "", "","","", "");
            c.MdiParent = this.MdiParent;
            c.Show();
            }
        }
예제 #4
0
 private void VerCandidatos_Load(object sender, EventArgs e)
 {
     MetodosComunes mc = new MetodosComunes();
     mc.MostrarCandidatos(dataGridView1);
 }
예제 #5
0
        private void textBox1_KeyUp(object sender, KeyEventArgs e)
        {
            if (textBox1.Text.Trim().Equals(""))
            {
              MetodosComunes  m = new MetodosComunes();
              m.MostrarCandidatos(dataGridView1);
                return;
            }
            else
            {
                String Cad = "%" + textBox1.Text + "%";
                if (comboBox1.SelectedIndex == 0)
                {
                   String query = "Select Pk_candidato as 'ID', nombre as 'Nombre', apellido as 'Apellido', tipo as 'Tipo', "
                   + "tel as 'Teléfono', dir as 'Dirección', fecha_nac as 'Fecha de nacimiento', Estado as 'Estado' FROM Candidatos"
                   + " WHERE nombre like '"+Cad+"'";

                   MetodosNav nav = new MetodosNav();
                   nav.Buscar(query, dataGridView1);
                }
                else if (comboBox1.SelectedIndex == 1)
                {
                   String query = "Select Pk_candidato as 'ID', nombre as 'Nombre', apellido as 'Apellido', tipo as 'Tipo', "
                   + "tel as 'Teléfono', dir as 'Dirección', fecha_nac as 'Fecha de nacimiento', Estado as 'Estado' FROM Candidatos"
                   + " WHERE apellido like '" + Cad + "'";

                    MetodosNav nav = new MetodosNav();
                    nav.Buscar(query, dataGridView1);

                }
                else if (comboBox1.SelectedIndex == 2)
                {
                    String query = "Select Pk_candidato as 'ID', nombre as 'Nombre', apellido as 'Apellido', tipo as 'Tipo', "
                    + "tel as 'Teléfono', dir as 'Dirección', fecha_nac as 'Fecha de nacimiento', Estado as 'Estado' FROM Candidatos"
                    + " WHERE tipo like '" + Cad + "'";

                    MetodosNav nav = new MetodosNav();
                    nav.Buscar(query, dataGridView1);

                }
            }
        }
예제 #6
0
 private void DetallesTutor_Load(object sender, EventArgs e)
 {
     MetodosComunes m = new MetodosComunes();
     m.DetallesTutor(ID, textBox1, textBox2, textBox3, maskedTextBox1, textBox5);
     tbxOnLoad();
 }
예제 #7
0
 private void button1_Click(object sender, EventArgs e)
 {
     MetodosComunes m = new MetodosComunes();
     m.ActualizarTutor(this, ID, textBox1.Text, textBox2.Text, textBox3.Text, maskedTextBox1.Text);
 }
예제 #8
0
        private void button4_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("¿Está seguro que desea limpiar toda la información de los campos? ","Advertencia",
               MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No)
            {
                return;
            }
            else
            {
                MetodosComunes mc = new MetodosComunes();
                mc.LimpiarCampos(nombre, apellido, dir);
                colorpelo.SelectedIndex = -1;
                cbxEspc.SelectedIndex = -1;
                colorojos.SelectedIndex = -1;
                radioButton1.Checked = false;
                radioButton2.Checked = false;
                radioButton3.Checked = false;
                radioButton4.Checked = true;

                tipo.Clear();
                tel.Clear();
                ced.Clear();
                fechaNac.Clear();

            }
        }
예제 #9
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (nombre.Text.Length == 0 || apellido.Text.Length == 0 || fechaNac.Text.Trim().Length<10 || dir.Text.Length==0)
            {
                MessageBox.Show("Complete los campos obligatorios");
            }
            else if (cbxEspc.SelectedIndex == -1 || procedencia.Text.Length == 0 || colorpelo.SelectedIndex == -1 || colorojos.SelectedIndex==-1 || (radioButton1.Checked == false && radioButton2.Checked == false))
            {
                MessageBox.Show("Complete la información del perfil", "Información");

            }
            else if (pictureBox1.Image == null)
            {
                MessageBox.Show("Debe cargar una foto al perfil", "Información");
            }
            else
            {
                if (tipo.Text == "Adulto" && ced.Text.Length == 0)
                {
                    MessageBox.Show("Digite la información de la cédula", "",
                        MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else if (tipo.Text == "Niño")
                {
                    try

                    {
                        int experiencia = 1;
                        string s = "";

                        if (radioButton3.Checked == true) { experiencia = 1; }
                        else
                            if (radioButton4.Checked == true) { experiencia = 0; }

                        if (radioButton1.Checked == true) { s = "Masculino"; }
                        else
                            if (radioButton2.Checked == true) { s = "Femenino"; }

                    MetodosCandidato g = new MetodosCandidato();
                    MessageBox.Show(g.InsertarCandidato(nombre.Text, apellido.Text, dir.Text, tel.Text, tipo.Text, fechaNac.Text, procedencia.Text, s, cbxEspc.SelectedItem.ToString(), colorpelo.SelectedItem.ToString(), colorojos.SelectedItem.ToString(), experiencia, pictureBox1));

                    MessageBox.Show("Recuerde registrar al padre/tutor del niño\n"
                            + "De manera obligatoria cada niño tiene que registrar\n"
                            +"la información del padre o tutor", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information);

                        button1.Enabled = false;
                        button2.Enabled = false;
                        button3.Enabled = false;
                        button4.Enabled = false;
                        button6.Enabled = true;
                        nombre.Enabled = false;
                        apellido.Enabled = false;
                        fechaNac.Enabled = false;
                        dir.Enabled = false;
                        tel.Enabled = false;
                        tipo.Enabled = false;
                        cbxEspc.Enabled = false;
                        procedencia.Enabled = false;
                        colorpelo.Enabled = false;
                        colorojos.Enabled = false;
                        radioButton1.Enabled = false;
                        radioButton2.Enabled = false;
                        radioButton3.Enabled = false;
                        radioButton4.Enabled = false;

                    }
                    catch (SqlException ex) { MessageBox.Show(ex.Message); }

                }
                else if (tipo.Text == "Adulto" && ced.Text.Length != 0)
                {
                    try
                    {

                        int experiencia = 1;
                        string s = "";

                        MetodosCandidato g = new MetodosCandidato();
                        MetodosComunes mc = new MetodosComunes();

                        if (radioButton3.Checked == true) { experiencia = 1; }
                        else
                            if (radioButton4.Checked == true) { experiencia = 0; }

                        if (radioButton1.Checked == true) { s = "Masculino"; }
                        else
                            if (radioButton2.Checked == true) { s = "Femenino"; }

                        MessageBox.Show(g.InsertarCandidatoAdulto(nombre.Text, apellido.Text, dir.Text, tel.Text, tipo.Text, fechaNac.Text, ced.Text, procedencia.Text, s, cbxEspc.SelectedItem.ToString(), colorpelo.SelectedItem.ToString(), colorojos.SelectedItem.ToString(), experiencia, pictureBox1), "Información",
                        MessageBoxButtons.OK, MessageBoxIcon.Information);

                        mc.LimpiarCampos(nombre, apellido, dir);
                        colorpelo.SelectedIndex = -1;
                        colorojos.SelectedIndex = -1;
                        procedencia.Clear();
                        cbxEspc.SelectedIndex = -1;
                        radioButton1.Checked = false;
                        radioButton2.Checked = false;
                        radioButton3.Checked = false;
                        radioButton4.Checked = true;

                        tipo.Clear();
                        tel.Clear();
                        ced.Clear();
                        fechaNac.Clear();
                        pictureBox1.Image = null;

                    }
                    catch (SqlException ex) { MessageBox.Show(ex.Message); }

                }//if abstracto
            }//if principal del botón
        }
        private void DetallesCandidato_Load(object sender, EventArgs e)
        {
            mc = new MetodosComunes();
            textBox6.Text = ID.ToString();
            mc.DetallesCandidato(ID, textBox1, textBox2, textBox3, textBox4, textBox5, maskedTextBox1, maskedTextBox2, pictureBox1);
            textBox6.Enabled = false;
            textBox1.Enabled = false;
            textBox2.Enabled = false;
            textBox3.Enabled = false;
            textBox4.Enabled = false;
            textBox5.Enabled = false;
            maskedTextBox1.Enabled = false;
            textBox7.Enabled = false;
            maskedTextBox2.Enabled = false;

            String cad = textBox4.Text.Substring(6,4);
            String an = DateTime.Now.ToString();
            String anAct = an.Substring(6,4);
            int nac = Convert.ToInt32(cad);
            int a = Convert.ToInt32(anAct);
            int edad = a - nac;

            textBox7.Text = ""+ edad+ " años";
        }
        private void button2_Click(object sender, EventArgs e)
        {
            MetodosComunes m = new MetodosComunes();
            if (m.ActualizarCliente(ID, Convert.ToInt32(textBox5.Text), textBox3.Text, maskedTextBox1.Text, textBox4.Text) == true) {
                DataCliente dc = new DataCliente();
                dc.MostrarClientes();
                this.Dispose();
            }
            else
            {
                return;

            }
        }