private void cargaAutomovil(int auto_id = Entidad.NUEVO) { try { ComboBoxManager cbm = new ComboBoxManager(); if (auto_id == Entidad.NUEVO) { automovil = new Automovil(); comboBoxMarca = cbm.Marca(comboBoxMarca); comboBoxTurno = cbm.Turno(comboBoxTurno); comboBoxChofer = cbm.Chofer(comboBoxChofer); } else { Automovil automovil_mapper = new Automovil(); this.automovil = automovil_mapper.Mapear(auto_id); checkBoxHabilitado.Checked = automovil.habilitado; textBoxModelo.Text = automovil.modelo; textBoxPatente.Text = automovil.patente; comboBoxMarca = cbm.Marca(comboBoxMarca, automovil.marca.nombre); comboBoxTurno = cbm.Turno(comboBoxTurno, automovil.turno.descripcion); comboBoxChofer = cbm.Chofer(comboBoxChofer, automovil.chofer.nombre + ' ' + automovil.chofer.apellido); } } catch (Exception exception) { MessageBox.Show(exception.Message, "Automovil error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void cargaDatos() { try { ComboBoxManager cbm = new ComboBoxManager(); string chofer_seleccionado = ""; string automovil_seleccionado = ""; if (SingletonUsuario.Instance.rol_actual.nombre == "Chofer") { chofer_seleccionado = cargaChoferSeleccionado(SingletonUsuario.Instance.id); comboBoxChofer.Enabled = false; automovil_seleccionado = cargaAutomovilSeleccionado(SingletonUsuario.Instance.id); } comboBoxChofer = cbm.Chofer(comboBoxChofer, chofer_seleccionado); comboBoxAutomovil = cbm.Automovil(comboBoxAutomovil, automovil_seleccionado); comboBoxCliente = cbm.Cliente(comboBoxCliente); comboBoxTurno = cbm.Turno(comboBoxTurno); dateTimePickerFechaInicio.Value = FechaSistema.getDateTime(); dateTimePickerFechaFin.Value = FechaSistema.getDateTime(); dateTimePickerFechaInicio.CustomFormat = "dd/MM/yyyy - HH:mm"; dateTimePickerFechaFin.CustomFormat = "dd/MM/yyyy - HH:mm"; } catch (Exception exception) { throw new Exception(exception.Message); } }
private void cargaDatos() { try { ComboBoxManager cbm = new ComboBoxManager(); comboBoxChofer = cbm.Chofer(comboBoxChofer); comboBoxTurno = cbm.Turno(comboBoxTurno); dateTimePickerFecha.Value = FechaSistema.getDateTime(); } catch (Exception exception) { MessageBox.Show(exception.Message, "Error en rendicion", MessageBoxButtons.OK, MessageBoxIcon.Error); } }