Example #1
0
 private void Mascotas_Load(object sender, EventArgs e)
 {
     opciones.DisplayMember = "COMPLETO";
     opciones.ValueMember   = "COMPLETO";
     opciones.DataSource    = Consultas.buscar("mascotas");
     dueño.DisplayMember    = "COMPLETO";
     dueño.ValueMember      = "COMPLETO";
     dueño.DataSource       = Consultas.buscar("duenio");
 }
Example #2
0
 private void Dueños_Load(object sender, EventArgs e)
 {
     opciones.DisplayMember = "COMPLETO";
     opciones.ValueMember   = "COMPLETO";
     opciones.DataSource    = Consultas.buscar("duenio");
     ciudad.DisplayMember   = "NOMBRE";
     ciudad.ValueMember     = "NOMBRE";
     ciudad.DataSource      = Consultas.buscar("ciudades");
 }
Example #3
0
 private void adopcion_TextChanged(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(adopcion.Text))
     {
         dataGridView1.DataSource = Consultas.buscarxRef("adopcion", "COMPLETO", adopcion.Text);
     }
     else
     {
         dataGridView1.DataSource = Consultas.buscar("adopcion");
     }
 }
Example #4
0
 private void rescate_TextChanged(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(rescate.Text))
     {
         dataGridView1.DataSource = Consultas.buscarxRef("rescate", "ID", rescate.Text);
     }
     else
     {
         dataGridView1.DataSource = Consultas.buscar("rescate");
     }
 }
Example #5
0
 private void Crear_adopcion_Load(object sender, EventArgs e)
 {
     id.Text               = Consultas.contar("adopcion", "ID").ToString();
     fecha.Text            = DateTime.Now.ToString("dd/MM/yyyy");
     dueño.DisplayMember   = "COMPLETO";
     dueño.ValueMember     = "COMPLETO";
     dueño.DataSource      = Consultas.buscar("duenio");
     mascota.DisplayMember = "COMPLETO";
     mascota.ValueMember   = "COMPLETO";
     mascota.DataSource    = Consultas.buscarColum("mascotas", "Rescatado", "ESTATUS");
 }
Example #6
0
 private void Vacuna_Activated(object sender, EventArgs e)
 {
     listBox1.DataSource = null;
     if (dog.Checked == true)
     {
         dataGridView1.DataSource = Consultas.buscar("detalle_vacuna_perros");
     }
     else
     {
         dataGridView1.DataSource = Consultas.buscar("detalle_vacuna_gatos");
     }
 }
Example #7
0
 private void acept_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(mascota.Text))
     {
         Consultas.actualizar_vacuna(tipo, id, vacuna1, vacuna2, vacuna3, vacuna4, vacuna5, vacuna6, vacuna7);
         this.Hide();
     }
     else
     {
         MessageBox.Show("Seleccione una mascota");
     }
 }
Example #8
0
 private void mascota_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(mascota.Text))
     {
         dt          = Consultas.buscarFila("mascotas", "ID", mascota.Text);
         animal.Text = dt.Rows[0][1].ToString();
         edad.Text   = dt.Rows[0][4].ToString();
         razgos.Text = dt.Rows[0][6].ToString();
         sexo        = dt.Rows[0][3].ToString();
         raza        = dt.Rows[0][5].ToString();
         nombre.Text = dt.Rows[0][2].ToString();
     }
 }
Example #9
0
        private void acept_Click(object sender, EventArgs e)
        {
            string sex, tipo;
            int    a;

            if (men.Checked == true)
            {
                sex = "Macho";
            }
            else
            {
                sex = "Hembra";
            }
            if (dog.Checked == true)
            {
                tipo = "Perro";
            }
            else
            {
                tipo = "Gato";
            }
            if (!string.IsNullOrEmpty(raza.Text) && !string.IsNullOrEmpty(edad.Text) && !string.IsNullOrEmpty(razgos.Text) && !string.IsNullOrEmpty(condicion.Text) && !string.IsNullOrEmpty(lugar.Text) && !string.IsNullOrEmpty(nombre.Text))
            {
                if (int.TryParse(nombre.Text, out a))
                {
                    MessageBox.Show("No numeros en nombre");
                }
                else
                {
                    if (int.TryParse(edad.Text, out a))
                    {
                        string ede      = Consultas.contar("mascotas", "ID").ToString();
                        string completo = id.Text + " : " + nombre.Text;
                        string vida     = (edad.Text + " " + tiempo.Text);
                        Consultas.crearRescate(tipo, raza.Text, sex, razgos.Text, condicion.Text, lugar.Text, fecha.Text, vida);
                        Consultas.crearMascota(null, tipo, nombre.Text, sex, vida, fecha.Text, razgos.Text, null, completo, raza.Text, "Rescatado");
                        this.Hide();
                    }
                    else
                    {
                        MessageBox.Show("Solo numeros en la edad");
                    }
                }
            }
            else
            {
                MessageBox.Show("Llene todo los campos");
            }
        }
Example #10
0
 private void buscar_TextChanged(object sender, EventArgs e)
 {
     mascota.DataSource = null;
     if (!string.IsNullOrEmpty(buscar.Text))
     {
         mascota.DisplayMember = "COMPLETO";
         mascota.ValueMember   = "COMPLETO";
         mascota.DataSource    = Consultas.buscarxRef("mascotas", "COMPLETO", buscar.Text);
     }
     else
     {
         mascota.DisplayMember = "COMPLETO";
         mascota.ValueMember   = "COMPLETO";
         mascota.DataSource    = Consultas.buscar("mascotas");
     }
 }
Example #11
0
        private void acept_Click(object sender, EventArgs e)
        {
            long   ce;
            string sex;
            int    a;

            if (men.Checked == true)
            {
                sex = "Masculino";
            }
            else
            {
                sex = "Femenino";
            }
            if (!string.IsNullOrEmpty(nombre.Text) && !string.IsNullOrEmpty(aparterno.Text) && !string.IsNullOrEmpty(amaterno.Text) && !string.IsNullOrEmpty(telefono.Text) && !string.IsNullOrEmpty(direccion.Text))
            {
                if (telefono.Text.Length == 10 && long.TryParse(telefono.Text, out ce))
                {
                    string refe = DateTime.Now.ToString("yyyy");
                    if (int.TryParse(refe, out a) && a >= 1999)
                    {
                        string completo = nombre.Text + " " + aparterno.Text + " " + amaterno.Text + " :" + id.Text;
                        if (long.TryParse(nombre.Text, out ce) && long.TryParse(aparterno.Text, out ce) && long.TryParse(amaterno.Text, out ce))
                        {
                            MessageBox.Show("No se permiten numeros en algunos campos");
                        }
                        else
                        {
                            Consultas.crearDuenio(id.Text, nombre.Text, aparterno.Text, amaterno.Text, sex, direccion.Text, telefono.Text, nacimineto.Value.ToString("dd/MM/yyyy"), fecha.Text, completo, ciudad.Text);
                            this.Hide();
                        }
                    }
                    else
                    {
                        MessageBox.Show("NO MENORES DE EDAD");
                    }
                }
                else
                {
                    MessageBox.Show("El telefono debe contener 10 digitos");
                }
            }
            else
            {
                MessageBox.Show("Llene todo los campos");
            }
        }
Example #12
0
        private void acept_Click(object sender, EventArgs e)
        {
            string sex, tipo;
            int    a;

            if (men.Checked == true)
            {
                sex = "Macho";
            }
            else
            {
                sex = "Hembra";
            }
            if (dog.Checked == true)
            {
                tipo = "Perro";
            }
            else
            {
                tipo = "Gato";
            }
            if (!string.IsNullOrEmpty(nombre.Text) && !string.IsNullOrEmpty(edad.Text) && !string.IsNullOrEmpty(razgos.Text) && !string.IsNullOrEmpty(tiempo.Text))
            {
                if (int.TryParse(edad.Text, out a))
                {
                    string completo = id.Text + " : " + nombre.Text + " | " + dueño.Text;
                    if (int.TryParse(nombre.Text, out a))
                    {
                        MessageBox.Show("No se permiten numeros el nombre");
                    }
                    else
                    {
                        string vida = (edad.Text + " " + tiempo.Text);
                        Consultas.actualizar_Mascota(id.Text, tipo, nombre.Text, sex, vida, razgos.Text, dueño.Text, completo, raza.Text);
                        Consultas.actualizar_Relacion(dueño.Text, id.Text);
                    }
                }
                else
                {
                    MessageBox.Show("Solo numeros en la edad");
                }
            }
            else
            {
                MessageBox.Show("Llene todo los campos");
            }
        }
Example #13
0
 private void buscar_TextChanged(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(buscar.Text))
     {
         opciones.DataSource    = null;
         opciones.DisplayMember = "COMPLETO";
         opciones.ValueMember   = "COMPLETO";
         opciones.DataSource    = Consultas.buscarxRef("duenio", "COMPLETO", buscar.Text);
     }
     else
     {
         opciones.DataSource    = null;
         opciones.DisplayMember = "COMPLETO";
         opciones.ValueMember   = "COMPLETO";
         opciones.DataSource    = Consultas.buscar("duenio");
     }
 }
Example #14
0
 private void dog_CheckedChanged(object sender, EventArgs e)
 {
     if (dog.Checked == true)
     {
         raza.DataSource    = null;
         raza.DisplayMember = "NOMBRE";
         raza.ValueMember   = "NOMBRE";
         raza.DataSource    = Consultas.buscarColum("razas", "Perro", "ANIMAL");
     }
     else
     {
         raza.DataSource    = null;
         raza.DisplayMember = "NOMBRE";
         raza.ValueMember   = "NOMBRE";
         raza.DataSource    = Consultas.buscarColum("razas", "Gato", "ANIMAL");
     }
 }
Example #15
0
        private void Crear_mascota_Load(object sender, EventArgs e)
        {
            if (cen == 1)
            {
                agregar.Visible = false;
            }
            else
            {
                agregar.Visible = true;
            }

            dueño.DisplayMember = "COMPLETO";
            dueño.ValueMember   = "COMPLETO";
            dueño.DataSource    = Consultas.buscar("duenio");
            fecha.Text          = DateTime.Now.ToString("dd/MM/yyyy");
            id.Text             = Consultas.contar("mascotas", "ID").ToString();
        }
Example #16
0
 private void dog_CheckedChanged(object sender, EventArgs e)
 {
     listBox1.DataSource = null;
     if (dog.Checked == true)
     {
         listBox1.DisplayMember   = "NOMBRE";
         listBox1.ValueMember     = "NOMBRE";
         listBox1.DataSource      = Consultas.buscarColum("vacunas", "PERRO", "MASCOTA");
         dataGridView1.DataSource = Consultas.buscar("detalle_vacuna_perros");
     }
     else
     {
         listBox1.DisplayMember   = "NOMBRE";
         listBox1.ValueMember     = "NOMBRE";
         listBox1.DataSource      = Consultas.buscarColum("vacunas", "Gato", "MASCOTA");
         dataGridView1.DataSource = Consultas.buscar("detalle_vacuna_gatos");
     }
 }
Example #17
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(opciones.Text))
     {
         string sex;
         long   a;
         if (men.Checked == true)
         {
             sex = "Masculino";
         }
         else
         {
             sex = "Femenino";
         }
         if (!string.IsNullOrEmpty(nombre.Text) && !string.IsNullOrEmpty(aparterno.Text) && !string.IsNullOrEmpty(amaterno.Text) && !string.IsNullOrEmpty(telefono.Text) && !string.IsNullOrEmpty(direccion.Text))
         {
             if (telefono.Text.Length == 10 && long.TryParse(telefono.Text, out a))
             {
                 dt = Consultas.buscarDato("IDDUENIO", "duenio", opciones.Text, "COMPLETO");
                 string completo = nombre.Text + " " + aparterno.Text + " " + amaterno.Text + " :" + dt.Rows[0][0];
                 if (long.TryParse(nombre.Text, out a) && long.TryParse(aparterno.Text, out a) && long.TryParse(amaterno.Text, out a))
                 {
                     MessageBox.Show("No se permiten numeros en algunos campos");
                 }
                 else
                 {
                     Consultas.actualizar_duenio(nombre.Text, aparterno.Text, amaterno.Text, sex, direccion.Text, telefono.Text, nacimineto.Value.ToString("dd/MM/yyyy"), completo, opciones.Text, ciudad.Text);
                 }
             }
             else
             {
                 MessageBox.Show("El telefono debe contener 10 digitos");
             }
         }
         else
         {
             MessageBox.Show("Llene todo los campos");
         }
     }
 }
Example #18
0
 private void mascota_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(mascota.Text))
     {
         vacuna.DataSource = null;
         dt   = Consultas.buscarFila("mascotas", "COMPLETO", mascota.Text);
         id   = dt.Rows[0][0].ToString();
         tipo = dt.Rows[0][1].ToString();
         edad = dt.Rows[0][4].ToString();
         if (tipo == "Perro")
         {
             vacuna.DisplayMember = "NOMBRE";
             vacuna.ValueMember   = "NOMBRE";
             vacuna.DataSource    = Consultas.buscarColum("vacunas", tipo.ToUpper(), "MASCOTA");
         }
         else
         {
             vacuna.DisplayMember = "NOMBRE";
             vacuna.ValueMember   = "NOMBRE";
             vacuna.DataSource    = Consultas.buscarColum("vacunas", tipo, "MASCOTA");
         }
     }
 }
Example #19
0
 private void label1_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(id.Text))
     {
         if (tipo == "Perro")
         {
             dt = Consultas.buscarFila("detalle_vacuna_perros", "IDPERRO", id.Text);
             if (!string.IsNullOrEmpty(dt.Rows[0][1].ToString()))
             {
                 vacuna1.Checked = true;
             }
             else
             {
                 vacuna1.Checked = false;
             }
             if (!string.IsNullOrEmpty(dt.Rows[0][2].ToString()))
             {
                 vacuna2.Checked = true;
             }
             else
             {
                 vacuna2.Checked = false;
             }
             if (!string.IsNullOrEmpty(dt.Rows[0][3].ToString()))
             {
                 vacuna3.Checked = true;
             }
             else
             {
                 vacuna3.Checked = false;
             }
             if (!string.IsNullOrEmpty(dt.Rows[0][4].ToString()))
             {
                 vacuna4.Checked = true;
             }
             else
             {
                 vacuna4.Checked = false;
             }
             if (!string.IsNullOrEmpty(dt.Rows[0][5].ToString()))
             {
                 vacuna5.Checked = true;
             }
             else
             {
                 vacuna5.Checked = false;
             }
             if (!string.IsNullOrEmpty(dt.Rows[0][6].ToString()))
             {
                 vacuna6.Checked = true;
             }
             else
             {
                 vacuna6.Checked = false;
             }
         }
         else
         {
             dt = Consultas.buscarFila("detalle_vacuna_gatos", "IDGATO", id.Text);
             if (!string.IsNullOrEmpty(dt.Rows[0][1].ToString()))
             {
                 vacuna1.Checked = true;
             }
             else
             {
                 vacuna1.Checked = false;
             }
             if (!string.IsNullOrEmpty(dt.Rows[0][2].ToString()))
             {
                 vacuna2.Checked = true;
             }
             else
             {
                 vacuna2.Checked = false;
             }
             if (!string.IsNullOrEmpty(dt.Rows[0][3].ToString()))
             {
                 vacuna3.Checked = true;
             }
             else
             {
                 vacuna3.Checked = false;
             }
             if (!string.IsNullOrEmpty(dt.Rows[0][4].ToString()))
             {
                 vacuna4.Checked = true;
             }
             else
             {
                 vacuna4.Checked = false;
             }
             if (!string.IsNullOrEmpty(dt.Rows[0][5].ToString()))
             {
                 vacuna5.Checked = true;
             }
             else
             {
                 vacuna5.Checked = false;
             }
             if (!string.IsNullOrEmpty(dt.Rows[0][6].ToString()))
             {
                 vacuna6.Checked = true;
             }
             else
             {
                 vacuna6.Checked = false;
             }
             if (!string.IsNullOrEmpty(dt.Rows[0][7].ToString()))
             {
                 vacuna7.Checked = true;
             }
             else
             {
                 vacuna7.Checked = false;
             }
         }
     }
 }
Example #20
0
        private void opciones_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(opciones.Text))
            {
                if (tipo == "Perro")
                {
                    vacuna1.Text       = "Parvo";
                    vacuna2.Text       = "Parvo/Corona";
                    vacuna3.Text       = "Triple";
                    vacuna4.Text       = "Quintuple";
                    vacuna5.Text       = "Sextuple";
                    vacuna6.Text       = "Rabia";
                    vacuna7.Visible    = false;
                    raza.DataSource    = null;
                    raza.DisplayMember = "NOMBRE";
                    raza.ValueMember   = "NOMBRE";
                    raza.DataSource    = Consultas.buscarColum("razas", "Perro", "ANIMAL");
                }
                else
                {
                    vacuna1.Text       = "Leucemia ";
                    vacuna2.Text       = "Triple veirica ";
                    vacuna3.Text       = "Leucemia 2";
                    vacuna4.Text       = "Triple virica 2";
                    vacuna5.Text       = "PIF";
                    vacuna6.Text       = "AntiRabica";
                    vacuna7.Visible    = true;
                    vacuna7.Text       = "PIF 2";
                    raza.DataSource    = null;
                    raza.DisplayMember = "NOMBRE";
                    raza.ValueMember   = "NOMBRE";
                    raza.DataSource    = Consultas.buscarColum("razas", "Gato", "ANIMAL");
                }

                dt      = Consultas.buscarFila("mascotas", "COMPLETO", opciones.Text);
                id.Text = dt.Rows[0][0].ToString();
                tipo    = dt.Rows[0][1].ToString();
                if (tipo == "Perro")
                {
                    cat.Checked = false; dog.Checked = true;
                }
                else
                {
                    dog.Checked = false; cat.Checked = true;
                }
                nombre.Text = dt.Rows[0][2].ToString();
                string sex = dt.Rows[0][3].ToString();
                if (sex == "Macho")
                {
                    women.Checked = false; men.Checked = true;
                }
                else
                {
                    men.Checked = false; women.Checked = true;
                }
                edad.Text   = dt.Rows[0][4].ToString();
                raza.Text   = dt.Rows[0][5].ToString();
                razgos.Text = dt.Rows[0][6].ToString();
                dueño.Text  = dt.Rows[0][8].ToString();
                fecha.Text  = dt.Rows[0][9].ToString();
            }
        }
Example #21
0
 private void RyA_Load(object sender, EventArgs e)
 {
     dataGridView1.DataSource = Consultas.buscar("rescate");
     dataGridView2.DataSource = Consultas.buscar("adopcion");
 }
Example #22
0
 private void Crear_rescate_Load(object sender, EventArgs e)
 {
     id.Text    = (Consultas.contar("rescate", "ID")).ToString();
     fecha.Text = DateTime.Now.ToString("dd/MM/yyyy");
 }