コード例 #1
0
        private void btnNuevo_Click(object sender, EventArgs e)
        {
            FormAgregarUnidad frm = new FormAgregarUnidad(true, false);

            AddOwnedForm(frm);
            frm.ShowDialog();
        }
コード例 #2
0
        private void btnEditar_Click(object sender, EventArgs e)
        {
            FormAgregarUnidad frm = new FormAgregarUnidad(false, true); //Se crea el objeto del formulario Aux

            AddOwnedForm(frm);                                          //Se direcciona del form padre al hijo
            if (dataGridView1.SelectedRows.Count > 0)
            {
                frm.txtPlacas.Text    = unidadBLL.Placa;
                frm.txtModelo.Text    = unidadBLL.Modelo;
                frm.txtcapacidad.Text = unidadBLL.Capacidad;
                frm.txtnoserie.Text   = unidadBLL.numeroDeSerie;
                frm.txtseguro.Text    = unidadBLL.Seguro;
                frm.txtOperador.Text  = unidadBLL.Operador;
                frm.txtTelefono.Text  = unidadBLL.Telefono;
                frm.IDAux             = unidadBLL.ID;

                frm.ShowDialog();
            }
            else
            {
                MessageBox.Show("Seleccione una fila.");
            }
        }