private void btneditarunidad_Click(object sender, EventArgs e) { if (ValidarCampos()) { FormUnidades frm = Owner as FormUnidades; unidadDAL.Modificar(RecuperarInformacion()); frm.LlenarGrid(); Close(); } }
private void button1_Click(object sender, EventArgs e)//agregar unidad { if (ValidarCampos()) { unidadDAL.Agregar(RecuperarInformacion()); FormUnidades frm = Owner as FormUnidades;//Se direcciona del formulario hijo al padre,el objeto ya existe, solo se hace referencia frm.LlenarGrid(); //frm.dataGridView1.Rows.Insert(0, "1", txtPlacas.Text, txtModelo.Text, txtcapacidad.Text, txtnoserie.Text, txtseguro.Text); Close(); } }
//METODOS PARA ABRIR OTROS FORMULARIOS Y MOSTRAR FORM DE LOGO Al CERRAR ---------------------------------------------------------- private void btnUnidades_Click(object sender, EventArgs e) { FormUnidades fm1 = new FormUnidades(); fm1.FormClosed += new FormClosedEventHandler(MostrarFormLogoAlCerrarForms); pictureBox1.Visible = false; pictureBox2.Visible = true; pictureBox4.Visible = false; pictureBox3.Visible = false; AbrirFormEnPanel(fm1); }