예제 #1
0
        private void BtnEditar_Click(object sender, EventArgs e)
        {
            DataGridViewRow dataGridRow = this.dgvVehiculos.CurrentRow;

            if (dataGridRow != null)
            {
                if (frmNuevoVehiculo != null)
                {
                    frmNuevoVehiculo.Close();
                }

                DataRow    row       = ((DataRowView)dataGridRow.DataBoundItem).Row;
                EVehiculos eVehiculo = new EVehiculos(row);

                frmNuevoVehiculo = new FrmNuevoVehiculo
                {
                    Dock            = DockStyle.Fill,
                    FormBorderStyle = FormBorderStyle.None,
                    TopLevel        = false,
                    IsEditar        = true
                };
                frmNuevoVehiculo.AsignarDatos(eVehiculo);
                frmNuevoVehiculo.OnVehiculoEditSuccess += FrmNuevoVehiculo_OnVehiculoAddSuccess;
                this.container = new PoperContainer(frmNuevoVehiculo);
                frmNuevoVehiculo.Show();
                this.container.Show(btnAgregar);
            }
        }
예제 #2
0
 private void BtnAgregar_Click(object sender, EventArgs e)
 {
     if (frmNuevoVehiculo == null)
     {
         frmNuevoVehiculo = new FrmNuevoVehiculo
         {
             Dock            = DockStyle.Fill,
             FormBorderStyle = FormBorderStyle.None,
             TopLevel        = false
         };
         frmNuevoVehiculo.OnVehiculoAddSuccess += FrmNuevoVehiculo_OnVehiculoAddSuccess;
         this.container = new PoperContainer(frmNuevoVehiculo);
     }
     frmNuevoVehiculo.Show();
     this.container.Show(btnAgregar);
 }