예제 #1
0
        private void FrmReporteConsignaciones_Load(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            reportViewer1.LocalReport.DataSources.Clear();
            reportViewer1.ProcessingMode = ProcessingMode.Local;
            string appPath    = Application.StartupPath.Replace("\\bin\\Debug", "");
            string reportPath = @"\RDLS\RendicionConsignaciones.rdl";

            reportViewer1.LocalReport.ReportPath = appPath + reportPath;
            reportViewer1.ZoomPercent            = 130;

            using (var uow = UowFactory.Create <ILaPazUow>())
            {
                var proveedor = uow.Proveedores.Obtener(p => p.Id == ProveedorId);

                reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("ReporteDataset", Listado));

                var fecha = DateTime.Now.ToShortDateString();
                var hora  = DateTime.Now.ToShortTimeString();


                var parametros = new List <ReportParameter>
                {
                    new ReportParameter("Fecha", fecha),
                    new ReportParameter("Hora", hora),
                    new ReportParameter("Desde", Desde.ToShortDateString()),
                    new ReportParameter("Hasta", Hasta.ToShortDateString()),
                    new ReportParameter("ProveedorNombre", proveedor.Denominacion)
                };

                reportViewer1.LocalReport.SetParameters(parametros);
                this.reportViewer1.RefreshReport();
                this.Cursor = Cursors.Default;
            }
        }
        public string Texto()
        {
            var rt = "";

            rt += "Desde: " + Desde.ToShortDateString() + ", Hasta: " + Hasta.ToShortDateString();
            return(rt);
        }
 protected override Dictionary <string, string> GetFilterValues()
 {
     return(new Dictionary <string, string>
     {
         { CultureManager.GetLabel("DESDE"), Desde.ToShortDateString() + " " + Desde.ToShortTimeString() },
         { CultureManager.GetLabel("HASTA"), Hasta.ToShortDateString() + " " + Hasta.ToShortTimeString() }
     });
 }
예제 #4
0
        public string ToUri()
        {
            var query = HttpUtility.ParseQueryString(string.Empty);

            query["Descripcion"] = Descripcion;
            query["Desde"]       = Desde.ToString("yyyy-MM-dd");
            query["Hasta"]       = Hasta.ToString("yyyy-MM-dd");

            return(query.ToString());
        }
예제 #5
0
 protected override Dictionary <string, string> GetFilterValues()
 {
     return(new Dictionary <string, string>
     {
         { CultureManager.GetEntity("PARENTI09"), Nombre },
         { CultureManager.GetLabel("LEGAJO"), Legajo },
         { CultureManager.GetLabel("DESDE"), Desde.ToDisplayDateTime().ToShortDateString() },
         { CultureManager.GetLabel("HASTA"), Hasta.ToDisplayDateTime().ToShortDateString() }
     });
 }
예제 #6
0
 public string Serialize()
 {
     return(string.Format("{0};{1};{2};{3};{4};{5};{6}",
                          Empresa,
                          Linea,
                          Chofer,
                          Vehiculo,
                          Desde.ToString(CultureInfo.InvariantCulture),
                          Hasta.ToString(CultureInfo.InvariantCulture),
                          string.Join(",", TiposPoi.Select(x => x.ToString()).ToArray())));
 }
예제 #7
0
 protected override Dictionary <string, string> GetFilterValues()
 {
     return(new Dictionary <string, string>
     {
         { CultureManager.GetLabel("INTERNO"), Movil },
         { CultureManager.GetLabel("PATENTE"), Patente },
         { CultureManager.GetLabel("RESPONSABLE"), Responsable },
         { CultureManager.GetLabel("DESDE"), Desde.ToDisplayDateTime().ToShortDateString() },
         { CultureManager.GetLabel("HASTA"), Hasta.ToDisplayDateTime().ToShortDateString() }
     });
 }
예제 #8
0
        /**
         * @fn  public void cargarVariables()
         *
         * @brief   Carga las variables dentor de imacros con
         *          los datos necesarios para cargarlo
         *          al motor
         *
         * @author  WINMACROS
         * @date    14/07/2017
         */

        public void cargarVariables()
        {
            Sistema s = Sistema.Sis;

            s.ejecutarMacro(s.m_app, "nombreMotorC", Lot.Marc.Nombre);
            s.ejecutarMacro(s.m_app, "nombreLoteC", Lot.Nombre);
            s.ejecutarMacro(s.m_app, "fechaIniC", Desde.ToString("yyyy-MM-dd"));
            s.ejecutarMacro(s.m_app, "fechaFinC", Hasta.ToString("yyyy-MM-dd"));
            s.ejecutarMacro(s.m_app, "baseContC", Lot.Frec.BaseContactacion.ToString());
            s.ejecutarMacro(s.m_app, "prioLoteC", Lot.Frec.PrioridadLote.ToString());
            s.ejecutarMacro(s.m_app, "tiempoEsperaC", hallarTiempo());
        }
예제 #9
0
        private void DdlMoviles_SelectedValueChanged(object sender, EventArgs e)
        {
            if (!_limpiandoFiltros)
            {
                if (Movil != null)
                {
                    var movil = Uow.Moviles.Obtener(m => m.Id == Movil);

                    //Ver tarifa a cobrar
                    _movilId = movil.Id;


                    var promociones = Uow.PromocionesMoviles.Listado().Where(pm => pm.MovilId == _movilId && pm.FechaHasta != null).OrderByDescending(pm => pm.FechaAlta).FirstOrDefault();
                    if (promociones == null)
                    {
                        var tarifa = Uow.Tarifas.Listado().Where(t => t.Activo == true).OrderByDescending(t => t.FechaAlta).FirstOrDefault();
                        Diario       = tarifa.Monto;
                        Semanal      = tarifa.Semana;
                        PagoAtrasado = tarifa.PagoAtrasado;
                    }
                    else
                    {
                        var tarifa = Uow.Promociones.Obtener(p => p.Id == promociones.PromocionId);
                        Diario  = tarifa.Monto;
                        Semanal = tarifa.Semana;
                        var tarifaActual = Uow.Tarifas.Listado().Where(t => t.Activo == true).OrderByDescending(t => t.FechaAlta).FirstOrDefault();
                        PagoAtrasado = tarifaActual.PagoAtrasado;
                    }

                    var pagoBase = Uow.PagosMoviles.Listado().Where(pm => pm.MovilId == movil.Id).OrderByDescending(pm => pm.FechaAlta).FirstOrDefault();
                    if (pagoBase == null)
                    {
                        Desde = _clock.Now;
                        Hasta = Desde.AddDays(6);
                    }
                    else
                    {
                        DtpDesde.Enabled = false;
                        DtpDesde.Value   = pagoBase.Hasta.Value.AddDays(1);
                        Hasta            = Desde.AddDays(6);
                    }

                    var montosFavor = Uow.MovilesMontosFavor.Listado().Where(m => m.MovilId == movil.Id && m.ImpOcupado != m.Importe).Sum(m => m.Importe - m.ImpOcupado);
                    AFavor = montosFavor ?? 0;
                    //if (Desde.Month != Hasta.Month)
                    //{
                    //    MessageBox.Show("Generar dos pagos");
                    //}
                }
            }
        }
        public string TextoFiltro()
        {
            var filt = "";

            if (_porFecha)
            {
                filt += "DESDE: " + Desde.ToShortDateString() + ", HASTA: " + Hasta.ToShortDateString();
            }
            if (AutoDeposito != "")
            {
                filt += ", DEPOSITO: " + NombreDeposito;
            }
            if (AutoDepartamento != "")
            {
                filt += ", DEPARTAMENTO: " + NombreDepartamento;
            }
            if (ProductoIsOk)
            {
                filt += ", PRODUCTO: " + _producto;
            }
            return(filt);
        }
예제 #11
0
        private void SetInitialFilterValues()
        {
            if (IsPostBack)
            {
                return;
            }

            if (Desde != DateTime.MinValue)
            {
                dpDesde.SelectedDate = Desde.ToDisplayDateTime();
            }

            if (Hasta != DateTime.MinValue)
            {
                dpHasta.SelectedDate = Hasta.ToDisplayDateTime();
            }

            if (Movil != 0)
            {
                ddlMovil.SelectedValue = Movil.ToString();
            }
        }
 /// <summary>
 /// Establece un automata donde contenedremos todas las gramaticas clases que se establecieron
 /// </summary>
 public Lenguaje()
 {
     //Establecemos una lista de las gramaticas que contiene el automata
     gramaticas[0]  = new And();
     gramaticas[1]  = new Boolean_();
     gramaticas[2]  = new Cadena();
     gramaticas[3]  = new Chart();
     gramaticas[4]  = new Colon();
     gramaticas[5]  = new ComentarioUnaLinea();
     gramaticas[6]  = new ComentarioVariasLineas();
     gramaticas[7]  = new Comparacion();
     gramaticas[8]  = new Decimal_();
     gramaticas[9]  = new Desde();
     gramaticas[10] = new Diferente();
     gramaticas[11] = new Disminuir();
     gramaticas[12] = new Division();
     gramaticas[13] = new Entero();
     gramaticas[14] = new Hacer();
     gramaticas[15] = new Hasta();
     gramaticas[16] = new Igual();
     gramaticas[17] = new Incrementar();
     gramaticas[18] = new Incremento();
     gramaticas[19] = new Mayor();
     gramaticas[20] = new MayorIgual();
     gramaticas[21] = new Menor();
     gramaticas[22] = new MenorIgual();
     gramaticas[23] = new Mientras();
     gramaticas[24] = new Multiplicacion();
     gramaticas[25] = new Negacion();
     gramaticas[26] = new Or();
     gramaticas[27] = new ParentesisAbrir();
     gramaticas[28] = new ParentesisCerrar();
     gramaticas[29] = new Resta();
     gramaticas[30] = new Si();
     gramaticas[31] = new Sino();
     gramaticas[32] = new Sino_Si();
     gramaticas[33] = new Suma();
 }
예제 #13
0
        private void ActualizarDiasMonto()
        {
            int      diasAPagar   = 0;
            TimeSpan cantidadDias = SetTimeToZero(Hasta) - SetTimeToZero(Desde);

            Dias = cantidadDias.Days + 1;

            //CARGA DE GRILLA DETALLE - Generar una fila por dia por pagar
            _detalle.Clear();
            for (int i = 0; i < Dias; i++)
            {
                PagoDia diario = new PagoDia();
                diario.Fecha = Desde.AddDays(i);
                TimeSpan atrasado     = SetTimeToZero(_clock.Now) - SetTimeToZero(diario.Fecha);
                int      DiasAtrasado = atrasado.Days;
                var      control      = 1;
                if (_clock.Now.DayOfWeek == DayOfWeek.Monday)
                {
                    control = 3;
                }
                if (DiasAtrasado > control)
                {
                    diario.Monto = PagoAtrasado ?? 0;
                    diasAPagar   = 0;
                }
                else
                {
                    diario.Monto = Diario;
                    diasAPagar  += 1;
                }

                _detalle.Add(diario);
            }

            //Ver si hay semana adelantada
            if (diasAPagar >= 7)
            {
                var semanas  = diasAPagar / 7;
                var adelanto = semanas * 7;
                foreach (PagoDia diario in _detalle)
                {
                    if (diario.Monto == Diario && adelanto > 0)
                    {
                        diario.Monto = Semanal;
                        adelanto    -= 1;
                    }
                }
            }

            //Ver si hay talleres que acreditar
            var talleres = Uow.TalleresMoviles.Listado().Where(t => t.MovilId == _movilId && t.Acreditado == false).FirstOrDefault();

            if (talleres != null)
            {
                int      diasTaller     = 0;
                TimeSpan cantidadTaller = SetTimeToZero(talleres.FechaHasta ?? _clock.Now) - SetTimeToZero(talleres.FechaDesde);
                diasTaller = cantidadTaller.Days + 1;
                Taller     = diasTaller;

                var descuentoTaller = Uow.Talleres.Listado().Where(t => t.Id == talleres.TallerId).FirstOrDefault().Porcentaje;
                if (_detalle.Count > 0)
                {
                    for (int i = 0; i < diasTaller; i++)
                    {
                        _detalle[i].Monto = _detalle[i].Monto - (_detalle[i].Monto * (descuentoTaller ?? 0) / 100);
                    }
                }
            }
            GridDetalle.DataSource = _detalle.ToList();


            //////////////////////////////
            SubTotal = _detalle.Sum(s => s.Monto);
            //if (Desde <= _clock.Now.AddDays(2))
            //{
            //    if (Dias >= 7)
            //    {
            //        var semanas = Dias / 7;
            //        var resto = Dias % 7;
            //        SubTotal = (semanas * Semanal + resto * Diario);
            //    }
            //}
        }
예제 #14
0
 private void monthCalendar1_DateSelected(object sender, DateRangeEventArgs e)
 {
     Desde.Clear();
     Desde.AppendText(monthCalendar1.SelectionStart.ToShortDateString());
     monthCalendar1.Visible = false;
 }
예제 #15
0
        protected override void OnExecute(Timer timer)
        {
            STrace.Trace(ComponentName, "Inicio de la tarea");

            var inicio = DateTime.UtcNow;

            var empresas = DaoFactory.EmpresaDAO.GetList().Where(e => e.GeneraRutaInversa);

            STrace.Trace(GetType().FullName, string.Format("Procesando empresas. Cantidad: {0}", empresas.Count()));

            try
            {
                foreach (var empresa in empresas)
                {
                    var vehiculos = DaoFactory.CocheDAO.FindList(new[] { empresa.Id }, new[] { -1 })
                                    .Where(c => c.Dispositivo != null);
                    var clientes = DaoFactory.ClienteDAO.GetList(new[] { empresa.Id }, new[] { -1 }).Select(c => c.Id).ToList();

                    var vehiculosPendientes = vehiculos.Count();
                    STrace.Trace(GetType().FullName, string.Format("Vehículos a procesar: {0}", vehiculosPendientes));

                    var eventosEntradas = DaoFactory.LogMensajeDAO.GetByVehiclesAndCode(vehiculos.Select(v => v.Id).ToArray(), MessageCode.InsideGeoRefference.GetMessageCode(), Desde, Hasta, 1);
                    var eventosSalidas  = DaoFactory.LogMensajeDAO.GetByVehiclesAndCode(vehiculos.Select(v => v.Id).ToArray(), MessageCode.OutsideGeoRefference.GetMessageCode(), Desde.AddDays(-7), Hasta, 1);

                    foreach (var vehiculo in vehiculos)
                    {
                        STrace.Trace(GetType().FullName, string.Format("Procesando vehículo: {0}", vehiculo.Id));

                        var entradas = eventosEntradas.Where(ev => ev.Coche.Id == vehiculo.Id &&
                                                             ev.Fecha > Desde &&
                                                             ev.Fecha < Hasta &&
                                                             ev.IdPuntoDeInteres.HasValue);

                        STrace.Trace(GetType().FullName, string.Format("Entradas a procesar: {0}", entradas.Count()));

                        var i = 1;
                        foreach (var entrada in entradas)
                        {
                            STrace.Trace(GetType().FullName, string.Format("Procesando entrada: {0}/{1}", i, entradas.Count()));

                            var ptoFin = DaoFactory.PuntoEntregaDAO.FindByClientesAndGeoreferencia(clientes, entrada.IdPuntoDeInteres.Value);
                            if (ptoFin == null)
                            {
                                continue;
                            }

                            var salidas = eventosSalidas.Where(ev => ev.Coche.Id == vehiculo.Id &&
                                                               ev.Fecha > entrada.Fecha.AddDays(-7) &&
                                                               ev.Fecha < entrada.Fecha.AddSeconds(-1) &&
                                                               ev.IdPuntoDeInteres.HasValue)
                                          .OrderByDescending(s => s.Fecha);

                            foreach (var salida in salidas)
                            {
                                var ptoInicio = DaoFactory.PuntoEntregaDAO.FindByClientesAndGeoreferencia(clientes, salida.IdPuntoDeInteres.Value);
                                if (ptoInicio != null)
                                {
                                    if (ptoInicio == ptoFin)
                                    {
                                        break;
                                    }

                                    var codigo = salida.Fecha.AddHours(-3).ToString("yyyyMMdd") + "|" + vehiculo.Interno + "|" + ptoInicio.Codigo + "-" + ptoFin.Codigo;
                                    var viaje  = new ViajeDistribucion
                                    {
                                        Alta         = DateTime.UtcNow,
                                        Codigo       = codigo.Length <= 32 ? codigo : codigo.Substring(0, 32),
                                        Empresa      = empresa,
                                        Estado       = ViajeDistribucion.Estados.Cerrado,
                                        Fin          = entrada.Fecha,
                                        Inicio       = salida.Fecha,
                                        InicioReal   = salida.Fecha,
                                        Linea        = vehiculo.Linea,
                                        NumeroViaje  = 1,
                                        RegresoABase = false,
                                        Tipo         = ViajeDistribucion.Tipos.Desordenado,
                                        Vehiculo     = vehiculo
                                    };

                                    var entrega1 = new EntregaDistribucion
                                    {
                                        Cliente         = ptoInicio.Cliente,
                                        PuntoEntrega    = ptoInicio,
                                        Descripcion     = ptoInicio.Descripcion,
                                        Estado          = EntregaDistribucion.Estados.Visitado,
                                        Orden           = 1,
                                        Programado      = salida.Fecha,
                                        ProgramadoHasta = salida.Fecha,
                                        Viaje           = viaje,
                                        Salida          = salida.Fecha
                                    };

                                    viaje.Detalles.Add(entrega1);

                                    var fechaFin   = entrada.Fecha;
                                    var kms        = 0.0;
                                    var origen     = new LatLon(ptoInicio.ReferenciaGeografica.Latitude, ptoInicio.ReferenciaGeografica.Longitude);
                                    var destino    = new LatLon(ptoFin.ReferenciaGeografica.Latitude, ptoFin.ReferenciaGeografica.Longitude);
                                    var directions = GoogleDirections.GetDirections(origen, destino, GoogleDirections.Modes.Driving, string.Empty, null);

                                    if (directions != null)
                                    {
                                        var duracion = directions.Duration;
                                        kms      = directions.Distance / 1000.0;
                                        fechaFin = salida.Fecha.Add(duracion);
                                    }

                                    var entrega2 = new EntregaDistribucion
                                    {
                                        Cliente         = ptoFin.Cliente,
                                        PuntoEntrega    = ptoFin,
                                        Descripcion     = ptoFin.Descripcion,
                                        Estado          = EntregaDistribucion.Estados.Visitado,
                                        Orden           = 2,
                                        Programado      = fechaFin,
                                        ProgramadoHasta = fechaFin,
                                        Viaje           = viaje,
                                        Entrada         = entrada.Fecha,
                                        KmCalculado     = kms
                                    };

                                    viaje.Detalles.Add(entrega2);

                                    DaoFactory.ViajeDistribucionDAO.SaveOrUpdate(viaje);
                                    break;
                                }
                            }
                            i++;
                        }

                        STrace.Trace(GetType().FullName, string.Format("Vehículos a procesar: {0}", --vehiculosPendientes));
                    }
                }

                STrace.Trace(GetType().FullName, "Tarea finalizada.");

                var fin      = DateTime.UtcNow;
                var duration = fin.Subtract(inicio).TotalMinutes;

                DaoFactory.DataMartsLogDAO.SaveNewLog(inicio, fin, duration, DataMartsLog.Moludos.GeneracionInversa, "Generación inversa finalizada exitosamente");
            }
            catch (Exception ex)
            {
                AddError(ex);
            }
            finally
            {
                ClearData();
            }
        }
예제 #16
0
        protected void LblSubCentroDeCostoOnClick(object sender, EventArgs e)
        {
            var lbl = sender as LinkButton;

            if (lbl == null)
            {
                return;
            }
            int idScc;

            if (!int.TryParse(lbl.Attributes["IdSCC"], out idScc) || idScc <= 0)
            {
                return;
            }
            var scc = DAOFactory.SubCentroDeCostosDAO.FindById(idScc);

            if (scc == null)
            {
                return;
            }

            var vDataSource = new List <List <string> >();
            var vehiculos   = DAOFactory.CocheDAO.GetList(new[] { Empresa },
                                                          new[] { Linea },
                                                          new[] { -1 }, // TIPO VEHICULO
                                                          new[] { -1 }, // TRANSPORTISTA
                                                          new[] { Departamento },
                                                          new[] { scc.CentroDeCostos.Id },
                                                          new[] { idScc });

            foreach (var veh in vehiculos)
            {
                var objetivoTotal = scc.Objetivo * Dias;
                var entregados    = DAOFactory.EntregaDistribucionDAO.GetList(new[] { Empresa },
                                                                              new[] { Linea },
                                                                              new[] { -1 }, // TRANSPORTISTAS
                                                                              new[] { Departamento },
                                                                              new[] { scc.CentroDeCostos.Id },
                                                                              new[] { scc.Id },
                                                                              new[] { veh.Id },
                                                                              new[] { -1 }, // VIAJES
                                                                              new[] { (int)EntregaDistribucion.Estados.Completado },
                                                                              Desde.ToDataBaseDateTime(),
                                                                              Hasta.ToDataBaseDateTime()).Count;
                var diasHistorico       = GetDiasDeSemana(DateTime.UtcNow.AddDays(-30), DateTime.UtcNow);
                var objetivoHistorico   = scc.Objetivo * diasHistorico;
                var entregadosHistorico = DAOFactory.EntregaDistribucionDAO.GetList(new[] { Empresa },
                                                                                    new[] { Linea },
                                                                                    new[] { -1 }, // TRANSPORTISTAS
                                                                                    new[] { Departamento },
                                                                                    new[] { scc.CentroDeCostos.Id },
                                                                                    new[] { scc.Id },
                                                                                    new[] { veh.Id },
                                                                                    new[] { -1 }, // VIAJES
                                                                                    new[] { (int)EntregaDistribucion.Estados.Completado },
                                                                                    DateTime.UtcNow.AddDays(-30).ToDataBaseDateTime(),
                                                                                    DateTime.UtcNow.ToDataBaseDateTime()).Count;

                var vRegister = new List <string>
                {
                    veh.Interno,
                    objetivoTotal.ToString("#0"),
                    entregados.ToString("#0"),
                    objetivoTotal > 0 ? ((double)entregados / (double)objetivoTotal * 100.0).ToString("#0.00") : "0,00",
                    objetivoHistorico > 0 ? ((double)entregadosHistorico / (double)objetivoHistorico * 100.0).ToString("#0.00") : "0,00"
                };
                vDataSource.Add(vRegister);
            }

            gridVehiculos.Columns[0].HeaderText = CultureManager.GetEntity("PARENTI03");
            gridVehiculos.Columns[1].HeaderText = CultureManager.GetLabel("OBJETIVO");
            gridVehiculos.Columns[2].HeaderText = CultureManager.GetLabel("REALIZADO");
            gridVehiculos.Columns[3].HeaderText = "%";
            gridVehiculos.Columns[4].HeaderText = "% " + CultureManager.GetLabel("HISTORICO");
            gridVehiculos.DataSource            = vDataSource;
            gridVehiculos.DataBind();
            gridVehiculos.SelectedIndex = -1;
            pnlVehiculos.Visible        = true;
        }
예제 #17
0
        protected override void BtnSearchClick(object sender, EventArgs e)
        {
            Empresa       = ddlEmpresa.Selected;
            Linea         = ddlPlanta.Selected;
            Departamento  = ddlDepartamento.Selected;
            Desde         = dtDesde.SelectedDate.Value;
            Hasta         = dtHasta.SelectedDate.Value;
            Dias          = GetDiasDeSemana(dtDesde.SelectedDate.Value, dtHasta.SelectedDate.Value);
            DiasHistorico = GetDiasDeSemana(DateTime.UtcNow.AddDays(-30), DateTime.UtcNow);

            var ccDataSource = new List <List <string> >();
            var centros      = DAOFactory.CentroDeCostosDAO.GetList(new[] { Empresa },
                                                                    new[] { Linea },
                                                                    new[] { Departamento });

            foreach (var cc in centros)
            {
                var subCentros = DAOFactory.SubCentroDeCostosDAO.GetList(new[] { Empresa },
                                                                         new[] { Linea },
                                                                         new[] { Departamento },
                                                                         new[] { cc.Id });
                var cantSubCentros = subCentros.Count();
                var objetivoTotal  = (from subcc in subCentros
                                      let vehiculos = DAOFactory.CocheDAO.GetList(new[] { Empresa },
                                                                                  new[] { Linea },
                                                                                  new[] { -1 }, // TIPO VEHICULO
                                                                                  new[] { -1 }, // TRANSPORTISTA
                                                                                  new[] { Departamento },
                                                                                  new[] { cc.Id },
                                                                                  new[] { subcc.Id })
                                                      select(subcc.Objetivo * vehiculos.Count() * Dias)).Sum();

                var entregados = DAOFactory.EntregaDistribucionDAO.GetList(new[] { Empresa },
                                                                           new[] { Linea },
                                                                           new[] { -1 }, // TRANSPORTISTAS
                                                                           new[] { Departamento },
                                                                           new[] { cc.Id },
                                                                           new[] { -1 }, // SUBCC
                                                                           new[] { -1 }, // VEHICULOS
                                                                           new[] { -1 }, // VIAJES
                                                                           new[] { (int)EntregaDistribucion.Estados.Completado },
                                                                           Desde.ToDataBaseDateTime(),
                                                                           Hasta.ToDataBaseDateTime()).Count;
                var ccRegister = new List <string>
                {
                    cc.Id.ToString("#0"),
                    cc.Descripcion,
                    cantSubCentros.ToString("#0"),
                    objetivoTotal.ToString("#0"),
                    entregados.ToString("#0"),
                    objetivoTotal > 0 ? ((double)entregados / (double)objetivoTotal * 100.0).ToString("#0.00") : "0,00"
                };
                ccDataSource.Add(ccRegister);
            }

            gridCentrosDeCostos.Columns[0].HeaderText = CultureManager.GetEntity("PARENTI37");
            gridCentrosDeCostos.Columns[1].HeaderText = CultureManager.GetMenu("SUBCENTROS_COSTOS");
            gridCentrosDeCostos.Columns[2].HeaderText = CultureManager.GetLabel("OBJETIVO");
            gridCentrosDeCostos.Columns[3].HeaderText = CultureManager.GetLabel("REALIZADO");
            gridCentrosDeCostos.Columns[4].HeaderText = "%";
            gridCentrosDeCostos.DataSource            = ccDataSource;
            gridCentrosDeCostos.DataBind();
            gridCentrosDeCostos.SelectedIndex = -1;
            pnlCc.Visible        = true;
            pnlSubcc.Visible     = false;
            pnlVehiculos.Visible = false;
        }
예제 #18
0
        protected override void OnLoadComplete(EventArgs e)
        {
            base.OnLoadComplete(e);

            lblEmpleado.Text = string.Format(CultureManager.GetLabel("NOMBRE_LEGAJO"), Nombre, Legajo, Desde.ToDisplayDateTime().ToShortDateString(), Hasta.ToDisplayDateTime().ToShortDateString());
        }
예제 #19
0
        protected override void OnLoadComplete(EventArgs e)
        {
            base.OnLoadComplete(e);

            lblInterno.Text = string.Format(CultureManager.GetLabel("INTERNO_PATENTE_RESPONSABLE"), Movil, Patente, Responsable, Desde.ToDisplayDateTime().ToShortDateString(), Hasta.ToDisplayDateTime().ToShortDateString());
        }