private void Crear_dueño_Load(object sender, EventArgs e) { id.Text = (10000 + Consultas.contar("duenio", "ID")).ToString(); fecha.Text = DateTime.Now.ToString("dd/MM/yyyy"); ciudad.DisplayMember = "NOMBRE"; ciudad.ValueMember = "NOMBRE"; ciudad.DataSource = Consultas.buscar("ciudades"); }
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"); }
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"); } }
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(); }
private void Crear_rescate_Load(object sender, EventArgs e) { id.Text = (Consultas.contar("rescate", "ID")).ToString(); fecha.Text = DateTime.Now.ToString("dd/MM/yyyy"); }