Beispiel #1
0
 public Viaje()
 {
     InitializeComponent();
     this.dao      = new DAOViajes();
     this.viaje    = new Viajes();
     this.choferes = new List <ViajeChofer>();
     this.clientes = new List <ViajePersona>();
 }
Beispiel #2
0
 private void cargarTodo()
 {
     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();
     turnos                      = tur.getAllTurn();
     this.cbTurno.Enabled        = false;
     this.comboChofer.Enabled    = false;
     this.btCalcular.Enabled     = false;
     this.btRendir.Enabled       = false;
     this.fechaRendicion.Enabled = true;
     setComboTurno();
     dgViajesRealizados.DataSource = null;
     dgMontoTotal.DataSource       = null;
     //dgViajesRealizados.Refresh();
     //dgMontoTotal.Refresh();
 }
Beispiel #3
0
        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();
            }
        }