Exemple #1
0
        private void acept_Click(object sender, EventArgs e)
        {
            int a;

            if (!string.IsNullOrEmpty(dueño.Text) && !string.IsNullOrEmpty(mascota.Text) && !string.IsNullOrEmpty(nombre.Text))
            {
                if (int.TryParse(nombre.Text, out a))
                {
                    MessageBox.Show("No numeros en el nombre");
                }
                else
                {
                    dt   = Consultas.buscarFila("duenio", "COMPLETO", dueño.Text);
                    idd  = dt.Rows[0][0].ToString();
                    nomd = dt.Rows[0][1].ToString();
                    Consultas.crearAdopcion(idd, nomd, mascota.Text, nombre.Text, fecha.Text);
                    Consultas.crearRelacion(idd, mascota.Text);
                    string completo = mascota.Text + " : " + nombre.Text + " | " + dueño.Text;
                    Consultas.actualizar_Mascota(mascota.Text, animal.Text, nombre.Text, sexo, edad.Text, razgos.Text, dueño.Text, completo, raza);
                    Consultas.actualizar_dato("mascotas", "ESTATUS", "Adoptado", mascota.Text, "ID");
                    this.Hide();
                }
            }
            else
            {
                MessageBox.Show("Llene todo los campos");
            }
        }