private void VehiculosForm_Load(object sender, EventArgs e)
        {
            //LLenar todos los combobox
            VehiculosManager objvehiculo = new VehiculosManager();

            metroComboBoxMarca.DataSource    = objvehiculo.MarcasVehiculos();
            metroComboBoxMarca.DisplayMember = "Marcas";
            metroComboBoxMarca.ValueMember   = "IDMarca";

            metroComboBoxModelo.DataSource    = objvehiculo.ModelosVehiculosTodos();
            metroComboBoxModelo.DisplayMember = "Modelo";
            metroComboBoxModelo.ValueMember   = "IDModeloVehiculo";

            metroComboBoxChoferes.DataSource    = objvehiculo.Choferes();
            metroComboBoxChoferes.DisplayMember = "Chofer";
            metroComboBoxChoferes.ValueMember   = "IDEmpleado";

            metroComboBoxCombustible.DataSource    = objvehiculo.Combustibles();
            metroComboBoxCombustible.DisplayMember = "Descripcion";
            metroComboBoxCombustible.ValueMember   = "IDCombustible";

            metroComboBoxPoliza.DataSource    = objvehiculo.PolizaSeguros();
            metroComboBoxPoliza.DisplayMember = "Descripcion";
            metroComboBoxPoliza.ValueMember   = "IDPolizaSeguro";

            bindingSourceVehiculos.DataSource = objvehiculo.listaVehiculosActivos();

            metroGridvehiculos.DataSource = objvehiculo.listaVehiculosActivos();



            //binding object
            PropertyDescriptor Activochk = bindingSourceVehiculos.GetItemProperties(null)["Activo"];

            metroCheckBoxActivo.Checked = (bool)Activochk.GetValue(bindingSourceVehiculos.Current);
            metroTextBoxPatente.DataBindings.Add("Text", bindingSourceVehiculos, "Patente", true);
            metroComboBoxMarca.DataBindings.Add("Text", bindingSourceVehiculos, "Marcas", true);
            metroComboBoxModelo.DataBindings.Add("Text", bindingSourceVehiculos, "Modelo", true);
            metroTextBoxNochasis.DataBindings.Add("Text", bindingSourceVehiculos, "Nochasis", true);
            metroTextBoxNomotor.DataBindings.Add("Text", bindingSourceVehiculos, "NoMotor", true);
            metroComboBoxCombustible.DataBindings.Add("Text", bindingSourceVehiculos, "TipoCombustible", true);
            metroTextBoxyear.DataBindings.Add("Text", bindingSourceVehiculos, "Year", true);
            metroDateTimeFechaCompra.DataBindings.Add("Text", bindingSourceVehiculos, "FechaCompra", true);
            metroDateTimeFechaTransferencia.DataBindings.Add("Text", bindingSourceVehiculos, "FechaTransferencia", true);
            metroDateTimeVTV.DataBindings.Add("Text", bindingSourceVehiculos, "VigenciaVTV", true);
            metroComboBoxChoferes.DataBindings.Add("Text", bindingSourceVehiculos, "Chofer", true);

            metroTextBoxTitular.DataBindings.Add("Text", bindingSourceVehiculos, "Titular", true);
            metroTextBoxKm.DataBindings.Add("Text", bindingSourceVehiculos, "KM", true);
        }
Exemple #2
0
 public AdminActividadesMantenimientoForm()
 {
     InitializeComponent();
     VehiculosManager = new VehiculosManager();
 }
Exemple #3
0
 public MantenimientoForm()
 {
     InitializeComponent();
     Vehiculos = new VehiculosManager();
     taller    = new TallerManager();
 }