コード例 #1
0
 private void btnAgregar_Click(object sender, EventArgs e)
 {
     using (FormVehiculoTipoAddEdit form = new FormVehiculoTipoAddEdit(null))
     {
         if (form.ShowDialog() == DialogResult.OK)
         {
             tipoVehiculoBindingSource.DataSource = db.Tipo_Vehiculo.ToList();
         }
     }
 }
コード例 #2
0
        private void btnEditar_Click(object sender, EventArgs e)
        {
            var tv = tipoVehiculoBindingSource.Current;

            if (tv == null)
            {
                return;
            }

            using (FormVehiculoTipoAddEdit form = new FormVehiculoTipoAddEdit(tv as Tipo_Vehiculo))
            {
                if (form.ShowDialog() == DialogResult.OK)
                {
                    tipoVehiculoBindingSource.DataSource = db.Tipo_Vehiculo.ToList();
                }
            }
        }