private void comboChofer_SelectedIndexChanged(object sender, EventArgs e) { this.cbTurno.Enabled = false; ViajeChofer c = this.comboChofer.SelectedItem as ViajeChofer; this.txtCNombre.Text = c.getName(); this.txtCApellido.Text = c.getLastname(); this.txtCDoc.Text = c.getDoc(); this.txtCTel.Text = c.getPhone(); this.txtCMail.Text = c.getEmail(); this.dtCFecha.Value = c.getDate(); this.idechofer = c.getId(); this.btCalcular.Enabled = true; }
private void cargarPorUsuario() { this.fechaRendicion.Value = DateUtils.getDateFromConfig(); this.choferes = new List <ViajeChofer>(); this.turnos = new List <Turno>(); this.dao = new DAOViajes(); this.tur = new DAOAutomovil(); this.daoren = new DAORendicionViaje(); this.cbTurno.Enabled = false; this.comboChofer.Enabled = false; this.btCalcular.Enabled = false; this.btRendir.Enabled = false; this.fechaRendicion.Enabled = true; turnos = tur.getAllTurn(); setComboTurno(); List <ViajeChofer> ca = daoren.getviajessinturno(this.idechofer); if (ca.Count().Equals(0)) { MessageBox.Show("Usted no posee viajes"); this.fechaRendicion.Enabled = false; } else { ViajeChofer c = ca.First(); this.idechofer = c.getId(); this.txtCNombre.Text = c.getName(); this.txtCApellido.Text = c.getLastname(); this.txtCDoc.Text = c.getDoc(); this.txtCTel.Text = c.getPhone(); this.txtCMail.Text = c.getEmail(); this.dtCFecha.Value = c.getDate(); //this.btCalcular.Enabled = true; dgViajesRealizados.DataSource = null; dgMontoTotal.DataSource = null; //dgViajesRealizados.Refresh(); //dgMontoTotal.Refresh(); } }