private void bottonBuscarModifInf_Click(object sender, EventArgs e) { int cod = int.Parse(textBoxModifInf.Text); Infraccion inf = adm.buscarInfraccion(cod); if (inf == null) { MessageBox.Show("Infaccion inexistente - Ingrese a la opcion Agregar Infraccion"); } else { textBoxDescModifInf.Text = inf.dameDesc(); textBoxImporteModifInf.Text = inf.dameImporte().ToString(); comboBoxModifInf.Text = inf.dameTipo(); // } }
private void buttonAceptarSuc_Click(object sender, EventArgs e) { infrac = adm.buscarInfraccion(int.Parse(this.textBoxCodI.Text)); // FALTA VALIDACION CAMPOS VACIOS if (infrac == null) { MessageBox.Show("ERROR - Código de infracción inválido"); } else { // FALTA PONERLE VALOR A VEHICULO SI NO ESTABA REGISTRADO int codigo = adm.darCodigoDeSuceso(); DateTime f = this.dateTimePicker.Value; Suceso suc = new Suceso(f, codigo, infrac, vehi); adm.agregarSuceso(suc); MessageBox.Show("El número de suceso es: " + codigo); Close(); } }
private void buttonCrearInfracc_Click(object sender, EventArgs e) { int cod = int.Parse(textBoxCodInfrac.Text); Infraccion inf = adm.buscarInfraccion(cod); if (inf != null) { MessageBox.Show("Infraccion ya existente"); } else { //ver si hay otra manera de trabajr esto con el combobox int seleccionada = comboBoxTipoInfrac.SelectedIndex; if (seleccionada == 0)//el primer item del combo es LEVE { FDescLeves fdescL = new FDescLeves(adm); fdescL.ShowDialog(); int porc10Dias = fdescL.porcDesc10Dias(); int porc20Dias = fdescL.porcDesc20Dias(); infrac = new Leve(porc20Dias, porc10Dias, cod, textBoxDescInfrac.Text, float.Parse(textBoxImporteInfrac.Text)); //MessageBox.Show(infrac.ToString()); } else //el segundo item del combo el GRAVE { FDescGraves fDescG = new FDescGraves(adm); fDescG.ShowDialog(); int porDesc = fDescG.porcDescGraves(); infrac = new Grave(porDesc, cod, textBoxDescInfrac.Text, float.Parse(textBoxImporteInfrac.Text)); //MessageBox.Show(infrac.ToString()); } adm.agregarInfraccion(infrac); MessageBox.Show("Infraccion creada con exito"); } /* foreach (Infraccion f in adm.darInfracciones()) { * MessageBox.Show(f.ToString()); * }*/ }