Exemple #1
0
 public void Clear()
 {
     Points.Set(null);
     Monitor.ClearLayer(LayerRecorrido);
     Monitor.ClearLayer(LayerMarkers);
     Monitor.ClearLayer(LayerViajeProgramado);
 }
Exemple #2
0
        protected void BindViaje(ViajeDistribucion viaje)
        {
            ControlandoId.Set(viaje.Id);

            btAplicar.Enabled   = !viaje.Controlado;
            btControlar.Visible = !viaje.Controlado;
            btModificar.Visible = viaje.Controlado;

            lblTipo.Text = CultureManager.GetLabel(
                viaje.Tipo == 2 ? "TIPODISTRI_RECORRIDO_FIJO"
                : viaje.Tipo == 1 ? "TIPODISTRI_DESORDENADA"
                : "TIPODISTRI_NORMAL");
            lblVehiculo.Text = viaje.Vehiculo.Interno;
            lblCodigo.Text   = viaje.Codigo;
            lblFecha.Text    = viaje.Inicio.ToString("dd-MM-yyyy");
            lblEmpleado.Text = viaje.Empleado != null ? viaje.Empleado.Entidad.Descripcion : string.Empty;
            lblBase.Text     = viaje.Linea.Descripcion;
            CalcularKm(viaje);

            var entregas = GetEntregasAControlar(viaje);

            gridEntregas.DataSource = entregas;
            gridEntregas.DataBind();

            gridEntregas.FooterRow.Cells[5].Text = entregas.Where(e => e.KmGps.HasValue).Sum(e => Math.Round(e.KmGps.Value * 10.0) / 10).ToString("0.0 km");
            gridEntregas.FooterRow.Cells[6].Text = entregas.Where(e => e.KmCalculado.HasValue).Sum(e => Math.Round(e.KmCalculado.Value * 10.0) / 10).ToString("0.0 km");
            gridEntregas.FooterRow.Cells[7].Text = "<div id='kmTotal'>" + entregas.Where(e => e.KmControlado.HasValue).Sum(e => Math.Round(e.KmControlado.Value * 10.0) / 10).ToString("0.0 km") + "</div>";
        }