Exemplo n.º 1
0
        private void BindLinks()
        {
            var subentidad = DAOFactory.SubEntidadDAO.FindById(ddlSubentidad.Selected);

            if (subentidad != null && subentidad.Sensor != null)
            {
                var coche = DAOFactory.CocheDAO.FindMobileByDevice(subentidad.Sensor.Dispositivo.Id);
                if (coche != null && coche.Id > 0)
                {
                    var link = string.Format("../../Monitor/MonitorHistorico/monitorHistorico.aspx?Planta={0}&TypeMobile={1}&Movil={2}&InitialDate={3}&FinalDate={4}&ShowMessages=0&ShowPOIS=0&Empresa={5}",
                                             coche.Linea != null ? coche.Linea.Id : -1,
                                             coche.TipoCoche.Id,
                                             coche.Id,
                                             SecurityExtensions.ToDataBaseDateTime(dtpFecha.SelectedDate.GetValueOrDefault().Subtract(TimeSpan.FromMinutes(npMinutes.Value))).ToString(CultureInfo.InvariantCulture),
                                             SecurityExtensions.ToDataBaseDateTime(dtpFecha.SelectedDate.GetValueOrDefault().AddMinutes(npMinutes.Value)).ToString(CultureInfo.InvariantCulture),
                                             coche.Empresa != null ? coche.Empresa.Id : coche.Linea != null ? coche.Linea.Empresa.Id : -1);

                    lnkHistorico.OnClientClick = string.Format("window.open('{0}', '" + CultureManager.GetMenu("OPE_MON_HISTORICO") + "')", link);

                    var linkCalidad = string.Format("../../Monitor/MonitorDeCalidad/monitorDeCalidad.aspx?Planta={0}&TypeMobile={1}&Movil={2}&InitialDate={3}&FinalDate={4}&Empresa={5}&Chofer={6}",
                                                    coche.Linea != null ? coche.Linea.Id : -1,
                                                    coche.TipoCoche.Id,
                                                    coche.Id,
                                                    SecurityExtensions.ToDataBaseDateTime(dtpFecha.SelectedDate.GetValueOrDefault().Subtract(TimeSpan.FromMinutes(npMinutes.Value))).ToDataBaseDateTime().ToString(CultureInfo.InvariantCulture),
                                                    SecurityExtensions.ToDataBaseDateTime(dtpFecha.SelectedDate.GetValueOrDefault().AddMinutes(npMinutes.Value)).ToDataBaseDateTime().ToString(CultureInfo.InvariantCulture),
                                                    coche.Empresa != null ? coche.Empresa.Id : coche.Linea != null ? coche.Linea.Empresa.Id : -1,
                                                    coche.Chofer != null ? coche.Chofer.Id : -1);

                    lnkCalidad.OnClientClick = string.Format("window.open('{0}', '" + CultureManager.GetMenu("OPE_MON_CALIDAD") + "')", linkCalidad);

                    lnkHistorico.Visible = lnkCalidad.Visible = lbl.Visible = true;
                }
            }
        }
Exemplo n.º 2
0
        protected override List <ConsumoCombustibleVo> GetResults()
        {
            var desde = SecurityExtensions.ToDataBaseDateTime(dpDesde.SelectedDate.GetValueOrDefault());
            var hasta = SecurityExtensions.ToDataBaseDateTime(dpHasta.SelectedDate.GetValueOrDefault());

            var consumos = DAOFactory.ConsumoCabeceraDAO.GetList(ddlDistrito.SelectedValues,
                                                                 ddlBase.SelectedValues,
                                                                 new[] { -1 }, // TRANSPORTISTAS
                                                                 new[] { -1 }, // DEPARTAMENTOS
                                                                 new[] { -1 }, // CENTROS DE COSTO
                                                                 new[] { -1 }, // TIPOS DE VEHICULO
                                                                 ddlVehiculo.SelectedValues,
                                                                 new[] { -1 }, // TIPOS DE EMPLEADO
                                                                 new[] { -1 }, // EMPLEADOS
                                                                 new[] { -1 }, // TIPOS DE PROVEEDOR
                                                                 new[] { -1 }, // PROVEEDORES
                                                                 new[] { -1 }, // DEPOSITOS ORIGEN
                                                                 new[] { -1 }, // DEPOSITOS DESTINO
                                                                 desde,
                                                                 hasta);

            var detalles = (from consumo in consumos
                            from detalle in consumo.Detalles.Cast <ConsumoDetalle>()
                            where detalle.Insumo.TipoInsumo.DeCombustible
                            select detalle).ToList();

            return(detalles.Select(c => new ConsumoCombustibleVo(c)).ToList());
        }
Exemplo n.º 3
0
        protected override List <ConsumoCombustibleVo> GetResults()
        {
            var desde = SecurityExtensions.ToDataBaseDateTime(dtFechaDesde.SelectedDate.GetValueOrDefault());
            var hasta = SecurityExtensions.ToDataBaseDateTime(dtFechaHasta.SelectedDate.GetValueOrDefault());

            var consumos = DAOFactory.ConsumoDetalleDAO.GetList(cbEmpresa.SelectedValues,
                                                                cbLinea.SelectedValues,
                                                                new[] { -1 }, // TRANSPORTISTAS
                                                                new[] { -1 }, // DEPARTAMENTOS
                                                                new[] { -1 }, // CENTROS DE COSTO
                                                                new[] { -1 }, // TIPOS DE VEHICULO
                                                                new[] { -1 }, // VEHICULOS
                                                                new[] { -1 }, // TIPOS DE EMPLEADO
                                                                new[] { -1 }, // EMPLEADOS
                                                                new[] { -1 }, // TIPOS DE PROVEEDOR
                                                                new[] { -1 }, // PROVEEDORES
                                                                new[] { -1 }, // DEPOSITOS ORIGEN
                                                                cbDeposito.SelectedValues,
                                                                desde,
                                                                hasta,
                                                                new[] { -1 })
                           .Where(c => c.ConsumoCabecera.Estado != ConsumoCabecera.Estados.Eliminado &&
                                  c.Insumo.Id == cbInsumo.Selected)
                           .OrderBy(c => c.ConsumoCabecera.Fecha);

            return(consumos.Select(c => new ConsumoCombustibleVo(c)).ToList());
        }
Exemplo n.º 4
0
        protected override List <ACWorkedHours> GetResults()
        {
            var desde = SecurityExtensions.ToDataBaseDateTime(dpDesde.SelectedDate.GetValueOrDefault());
            var hasta = SecurityExtensions.ToDataBaseDateTime(dpHasta.SelectedDate.GetValueOrDefault());

            return(ReportFactory.WorkedHoursDAO.GetWorkedHours(ddlEmpleado.Selected, desde, hasta).ToList());
        }
Exemplo n.º 5
0
        protected override List <MobileKilometer> GetResults()
        {
            var desde = SecurityExtensions.ToDataBaseDateTime(dpDesde.SelectedDate.GetValueOrDefault());
            var hasta = SecurityExtensions.ToDataBaseDateTime(dpHasta.SelectedDate.GetValueOrDefault());

            return(ReportFactory.MonthlyKilometersDAO.GetMobileKilometers(ddlMovil.Selected, desde, hasta, chkSoloEnRuta.Checked));
        }
Exemplo n.º 6
0
        protected override List <ConsumoVo> GetListData()
        {
            var desde = SecurityExtensions.ToDataBaseDateTime(dtpDesde.SelectedDate.Value);
            var hasta = SecurityExtensions.ToDataBaseDateTime(dtpHasta.SelectedDate.Value);

            var list = DAOFactory.ConsumoDetalleDAO.GetList(cbEmpresa.SelectedValues,
                                                            cbLinea.SelectedValues,
                                                            cbTransportista.SelectedValues,
                                                            new[] { -1 },
                                                            new[] { -1 },
                                                            cbTipoVehiculo.SelectedValues,
                                                            cbMovil.SelectedValues,
                                                            new[] { -1 },
                                                            new[] { -1 },
                                                            cbTipoProveedor.SelectedValues,
                                                            cbProveedor.SelectedValues,
                                                            cbDepositoOrigen.SelectedValues,
                                                            cbDepositoDestino.SelectedValues,
                                                            desde,
                                                            hasta,
                                                            new[] { -1 })
                       .Where(c => c.ConsumoCabecera.Estado != ConsumoCabecera.Estados.Eliminado);


            return(list.Select(v => new ConsumoVo(v)).ToList());
        }
Exemplo n.º 7
0
        protected override List <DuracionEstadosVo> GetResults()
        {
            var inicio = DateTime.UtcNow;

            try
            {
                var results = DAOFactory.TicketDAO.GetList(new[] { ddlLocacion.Selected },
                                                           new[] { ddlPlanta.Selected },
                                                           new[] { -1 }, //TRANSPORTISTAS
                                                           new[] { -1 }, //DEPARTAMENTOS
                                                           new[] { -1 }, //CENTROS DE COSTO
                                                           new[] { cbTipoVehiculo.Selected },
                                                           new[] { -1 }, //VEHICULOS
                                                           new[] { -1 }, //ESTADOS
                                                           new[] { cbCliente.Selected },
                                                           new[] { cbPuntoEntrega.Selected },
                                                           new[] { -1 },
                                                           SecurityExtensions.ToDataBaseDateTime(dpDesde.SelectedDate.GetValueOrDefault()),
                                                           SecurityExtensions.ToDataBaseDateTime(dpHasta.SelectedDate.GetValueOrDefault()))
                              .Select(t => new DuracionEstadosVo(t))
                              .Where(t => (chkIncluirCiclo0.Checked || t.TiempoCiclo != TimeSpan.Zero) &&
                                     (chkIncluirObra0.Checked || t.TiempoEnObra != TimeSpan.Zero) &&
                                     (chkIncluirSinVehiculo.Checked || t.Vehiculo != string.Empty))
                              .ToList();
                var duracion = (DateTime.UtcNow - inicio).TotalSeconds.ToString("##0.00");

                STrace.Trace("Control de Ciclo", String.Format("Duración de la consulta: {0} segundos", duracion));
                return(results);
            }
            catch (Exception e)
            {
                STrace.Exception("Control de Ciclo", e, String.Format("Reporte: Control de Ciclo. Duración de la consulta: {0:##0.00} segundos", (DateTime.UtcNow - inicio).TotalSeconds));
                throw;
            }
        }
Exemplo n.º 8
0
        protected override List <MobilesTime> GetResults()
        {
            var desde = SecurityExtensions.ToDataBaseDateTime(dpDesde.SelectedDate.GetValueOrDefault());
            var hasta = SecurityExtensions.ToDataBaseDateTime(dpHasta.SelectedDate.GetValueOrDefault());

            return(ReportFactory.MobilesTimeDAO.GetMobilesTime(desde, hasta, GetMobilesIds()));
        }
Exemplo n.º 9
0
        /// <summary>
        /// Gets the results to be displayed at the grid.
        /// </summary>
        /// <returns></returns>
        protected override List <MobileActivityVo> GetResults()
        {
            var inicio = DateTime.UtcNow;
            var desde  = SecurityExtensions.ToDataBaseDateTime(dpDesde.SelectedDate.GetValueOrDefault());
            var hasta  = SecurityExtensions.ToDataBaseDateTime(dpHasta.SelectedDate.GetValueOrDefault());

            ToogleItems(lbVehiculos);

            var idEmpresa = cbEmpresa.Selected;
            var idLinea   = ddlBase.Selected;

            try
            {
                var activities = ReportFactory.MobileActivityDAO.GetMobileActivitys(desde, hasta, idEmpresa, idLinea, lbVehiculos.SelectedValues, Convert.ToInt32((double)npKm.Value));
                var duracion   = (DateTime.UtcNow - inicio).TotalSeconds.ToString("##0.00");

                STrace.Trace("Reporte de Actividad Vehicular", String.Format("Duración de la consulta: {0} segundos", duracion));

                var results = (from activity in activities select new MobileActivityVo(activity, desde, hasta, chkDetalleInfracciones.Checked)).ToList();

                DisplayTotals(results);

                return(results);
            }
            catch (Exception e)
            {
                STrace.Exception("Reporte de Actividad Vehicular", e, String.Format("Reporte: Reporte de Actividad Vehicular. Duración de la consulta: {0:##0.00} segundos", (DateTime.UtcNow - inicio).TotalSeconds));

                throw;
            }
        }
Exemplo n.º 10
0
        protected override List <StoppedHours> GetResults()
        {
            var iniDate = SecurityExtensions.ToDataBaseDateTime(dtpDesde.SelectedDate.Value);
            var finDate = SecurityExtensions.ToDataBaseDateTime(dtpHasta.SelectedDate.Value);

            return(ReportFactory.StoppedHoursDAO.GetVehicleStoppedTimeGroupedByInterval(ddlMovil.Selected, iniDate, finDate, chkUndefined.Checked));
        }
Exemplo n.º 11
0
        protected override List <MedicionVo> GetResults()
        {
            SaveQueryValues();

            var iniDate = SecurityExtensions.ToDataBaseDateTime(dtpFecha.SelectedDate.GetValueOrDefault().Subtract(TimeSpan.FromMinutes(npMinutes.Value)));
            var finDate = SecurityExtensions.ToDataBaseDateTime(dtpFecha.SelectedDate.GetValueOrDefault().AddMinutes(npMinutes.Value));

            var mediciones = DAOFactory.MedicionDAO.GetList(ddlDistrito.SelectedValues,
                                                            ddlBase.SelectedValues,
                                                            new[] { -1 },
                                                            new[] { -1 },
                                                            ddlTipoEntidad.SelectedValues,
                                                            GetEntidadesFiltradas(),
                                                            ddlSubentidad.SelectedValues,
                                                            new[] { DAOFactory.TipoMedicionDAO.FindByCode("TEMP").Id, DAOFactory.TipoMedicionDAO.FindByCode("CAUDAL").Id },
                                                            iniDate,
                                                            finDate);

            if (mediciones == null || mediciones.Count.Equals(0))
            {
                return(new List <MedicionVo>());
            }

            _maxVal = (from medicion in mediciones select medicion.ValorDouble).Max();
            _minVal = (from medicion in mediciones select medicion.ValorDouble).Min();

            BindLinks();

            return(mediciones.Select(m => new MedicionVo(m)).ToList());
        }
Exemplo n.º 12
0
        protected override string GetGraphXml()
        {
            using (var helper = new FusionChartsHelper())
            {
                var desde = dtFechaDesde.SelectedDate != null?SecurityExtensions.ToDataBaseDateTime(dtFechaDesde.SelectedDate.Value) : new DateTime();

                var hasta = desde.AddMonths(1).AddSeconds(-1);

                helper.AddConfigEntry("caption", string.Format(CultureManager.GetLabel("DESDE_HASTA"), desde.ToDisplayDateTime(), hasta.ToDisplayDateTime()));

                helper.AddConfigEntry("xAxisName", XAxisLabel);
                helper.AddConfigEntry("yAxisName", YAxisLabel);
                helper.AddConfigEntry("decimalPrecision", "2");
                helper.AddConfigEntry("hoverCapSepChar", " - ");

                _dias.Clear();
                var diasMes = GetDiasMes(desde.ToDisplayDateTime().Month, desde.ToDisplayDateTime().Year);

                for (var i = 0; i < diasMes; i++)
                {
                    var fechaDesde = desde.AddDays(i).AddSeconds(-1);
                    var fechaHasta = fechaDesde.AddDays(1);

                    var dm = DAOFactory.DatamartDAO.GetSummarizedDatamart(fechaDesde, fechaHasta, cbVehiculo.Selected);

                    var litrosConsumidos = dm.Consumo;
                    var kmRecorridos     = dm.Kilometros;
                    var hsEnMarcha       = dm.HsMarcha;

                    var litrosXKm   = litrosConsumidos > 0.0 && kmRecorridos > 0.0 ? litrosConsumidos / kmRecorridos : 0;
                    var litrosXHora = litrosConsumidos > 0.0 && hsEnMarcha > 0.0 ? litrosConsumidos / hsEnMarcha : 0;

                    _dias.Add((i + 1) + "/" + desde.ToDisplayDateTime().ToString("MM/yyyy"), new[] { litrosXHora, litrosXKm });
                }

                foreach (var pair in _dias)
                {
                    var item = new FusionChartsItem();

                    item.AddPropertyValue("color", "AFD8F8");
                    item.AddPropertyValue("name", pair.Key.Split('/')[0]);
                    item.AddPropertyValue("value", pair.Value[1].ToString(CultureInfo.InvariantCulture));

                    helper.AddItem(item);

                    item = new FusionChartsItem();

                    item.AddPropertyValue("color", "FF5904");
                    item.AddPropertyValue("value", pair.Value[0].ToString(CultureInfo.InvariantCulture));

                    helper.AddItem(item);
                }

                lblLitrosXKm.Text   = CultureManager.GetLabel("LITROS_X_KM");
                lblLitrosXHora.Text = CultureManager.GetLabel("LITROS_X_HORA");
                pnlInferior.Visible = true;

                return(helper.BuildXml());
            }
        }
Exemplo n.º 13
0
        protected void BtnSearchTicketsClick(object sender, EventArgs e)
        {
            var tickets = DAOFactory.TicketDAO.GetByTexto(ddlDistrito.SelectedValues,
                                                          ddlPlanta.SelectedValues,
                                                          ddlMovil.SelectedValues,
                                                          SecurityExtensions.ToDataBaseDateTime(dtDia.SelectedDate.Date),
                                                          SecurityExtensions.ToDataBaseDateTime(dtDia.SelectedDate.Date.AddDays(1)),
                                                          txtBuscar.Text.Trim());

            var viajes = DAOFactory.ViajeDistribucionDAO.GetByTexto(ddlDistrito.SelectedValues,
                                                                    ddlPlanta.SelectedValues,
                                                                    new[] { -1 }, // TRANSPORTISTAS
                                                                    ddlMovil.SelectedValues,
                                                                    SecurityExtensions.ToDataBaseDateTime(dtDia.SelectedDate.Date),
                                                                    SecurityExtensions.ToDataBaseDateTime(dtDia.SelectedDate.Date.AddDays(1)),
                                                                    txtBuscar.Text.Trim());

            lstTicket.Items.Clear();
            foreach (var ticket in tickets)
            {
                lstTicket.Items.Add(new ListItem(ticket.PuntoEntrega.Descripcion, "T-" + ticket.Id));
            }
            foreach (var viaje in viajes)
            {
                lstTicket.Items.Add(new ListItem(viaje.Codigo + " - " + viaje.NumeroViaje, "V-" + viaje.Id));
            }

            TabContainer2.ActiveTabIndex = 3;
        }
Exemplo n.º 14
0
        protected void BtnGuardar_OnClick(object sender, EventArgs e)
        {
            ValidarDatosVigencia();

            using (var transaction = SmartTransaction.BeginTransaction())
            {
                if (EditObject.Id == 0)
                {
                    GuardarNuevaLinea();
                }

                var nuevaVigencia = new VigenciaPlanLinea
                {
                    Inicio          = SecurityExtensions.ToDataBaseDateTime(dtDesde.SelectedDate.Value),
                    LineaTelefonica = EditObject,
                    Plan            = cbPlan.Selected > 0 ? DAOFactory.PlanDAO.FindById(cbPlan.Selected) : null
                };

                ValidarCondicionesVigencia(nuevaVigencia);

                EditObject.Vigencias.Add(nuevaVigencia);

                DAOFactory.LineaTelefonicaDAO.SaveOrUpdate(EditObject);

                transaction.Commit();
            }
            Response.Redirect(RedirectUrl);
        }
Exemplo n.º 15
0
        protected override List <ConsumoCombustibleVo> GetResults()
        {
            var desde = SecurityExtensions.ToDataBaseDateTime(dtFechaDesde.SelectedDate.GetValueOrDefault());
            var hasta = SecurityExtensions.ToDataBaseDateTime(dtFechaHasta.SelectedDate.GetValueOrDefault());

            var consumos = DAOFactory.ConsumoCabeceraDAO.GetList(cbEmpresa.SelectedValues,
                                                                 cbLinea.SelectedValues,
                                                                 new[] { -1 }, // TRANSPORTISTAS
                                                                 new[] { -1 }, // DEPARTAMENTOS
                                                                 new[] { -1 }, // CENTROS DE COSTO
                                                                 cbTipoVehiculo.SelectedValues,
                                                                 cbVehiculo.SelectedValues,
                                                                 new[] { -1 }, // TIPOS DE EMPLEADO
                                                                 new[] { -1 }, // EMPLEADOS
                                                                 new[] { -1 }, // TIPOS DE PROVEEDOR
                                                                 new[] { -1 }, // PROVEEDORES
                                                                 new[] { -1 }, // DEPOSITOS ORIGEN
                                                                 new[] { -1 }, // DEPOSITOS DESTINO
                                                                 desde,
                                                                 hasta)
                           .Where(c => c.Estado != ConsumoCabecera.Estados.Eliminado);

            var detalles = (from consumo in consumos
                            from detalle in consumo.Detalles.Cast <ConsumoDetalle>()
                            where detalle.Insumo.TipoInsumo.DeCombustible
                            select detalle).ToList();

            return(detalles.Select(c => new ConsumoCombustibleVo(c)).ToList());
        }
Exemplo n.º 16
0
        private SearchData LoadSearchData()
        {
            var data = ViewState["SearchData"] as SearchData;

            if (data != null)
            {
                return(data);
            }

            var desde = SecurityExtensions.ToDataBaseDateTime(dpDesde.SelectedDate.GetValueOrDefault());
            var hasta = SecurityExtensions.ToDataBaseDateTime(dpHasta.SelectedDate.GetValueOrDefault());

            if (cbEntidad.SelectedValues.Contains(0))
            {
                cbEntidad.ToogleItems();
            }

            data = new SearchData
            {
                EntidadesId    = cbEntidad.SelectedValues,
                SubentidadesId = cbSubEntidad.SelectedValues,
                MensajesId     = cbMensajes.SelectedStringValues,
                InitialDate    = desde,
                FinalDate      = hasta
            };
            SaveSearchData(data);
            return(data);
        }
Exemplo n.º 17
0
        protected override void BtnSearchClick(object sender, EventArgs e)
        {
            base.BtnSearchClick(sender, e);

            var desde = SecurityExtensions.ToDataBaseDateTime(dpDesde.SelectedDate.GetValueOrDefault());
            var hasta = SecurityExtensions.ToDataBaseDateTime(dpHasta.SelectedDate.GetValueOrDefault());

            Stadistics = ReportFactory.OperatorStadisticsDAO.GetOperatorStadistics(ddlEmpleado.Selected, desde, hasta);

            var showResults = Stadistics != null && Stadistics.HasActiveDays();

            if (showResults)
            {
                OperatorMobiles = ReportFactory.OperatorMobilesDAO.GetOperatorMobiles(ddlEmpleado.Selected, desde, hasta).Select(om => new OperatorMobilesVo(om)).ToList();

                AddResultsToSession();
            }

            ifDetalleVehiculo.Visible = ifMoviles.Visible = showResults;

            if (NotFound != null)
            {
                NotFound.Text = !showResults?CultureManager.GetSystemMessage("NO_RESULT_FOR_CURRENT_FILTERS") : null;
            }
        }
Exemplo n.º 18
0
        protected void GridEntidadesOnRowDataBound(object sender, C1GridViewRowEventArgs e)
        {
            if (e.Row.RowType == C1GridViewRowType.DataRow)
            {
                var entidad = e.Row.DataItem as EntidadPadre;
                if (entidad != null)
                {
                    var lbl = e.Row.FindControl("lblTipoEntidad") as Label;
                    if (lbl != null)
                    {
                        lbl.Text = entidad.TipoEntidad.Descripcion;
                    }

                    var lnk = e.Row.FindControl("lblDescripcion") as LinkButton;
                    if (lnk != null)
                    {
                        lnk.Text = entidad.Descripcion;
                        lnk.Attributes.Add("ID_ENTIDAD", entidad.Id.ToString());
                    }

                    var ultimaMedicion = GetUltimaMedicion(entidad, dtHasta.SelectedDate.HasValue ? SecurityExtensions.ToDataBaseDateTime(dtHasta.SelectedDate.Value) : DateTime.MinValue, -1);
                    lbl = e.Row.FindControl("lblFechaUltimoReporte") as Label;
                    if (lbl != null)
                    {
                        lbl.Text = ultimaMedicion != null?ultimaMedicion.FechaMedicion.ToDisplayDateTime().ToString("dd/MM/yyyy HH:mm") : "";
                    }

                    lbl = e.Row.FindControl("lblValorUltimoReporte") as Label;
                    if (lbl != null)
                    {
                        lbl.Text = ultimaMedicion != null ? ultimaMedicion.Valor : "";
                    }

                    var icono = GetIcon(entidad, dtHasta.SelectedDate.HasValue ? SecurityExtensions.ToDataBaseDateTime(dtHasta.SelectedDate.Value) : DateTime.MinValue, -1);
                    var img   = e.Row.FindControl("imgEstado") as Image;
                    if (img != null)
                    {
                        img.ImageUrl = "~/images/" + icono.Split('|')[0];
                        img.ToolTip  = icono.Split('|')[1];
                    }

                    var btnEnt = e.Row.FindControl("btnMonitorEntidades") as ImageButton;
                    if (btnEnt != null)
                    {
                        btnEnt.Attributes.Add("ID_ENTIDAD", entidad.Id.ToString());
                        btnEnt.ToolTip  = CultureManager.GetMenu("OPE_MON_ENTIDAD");
                        btnEnt.ImageUrl = ResolveUrl("~/OPE_MON_ENTIDAD.image");
                    }

                    var btnSub = e.Row.FindControl("btnMonitorSubEntidades") as ImageButton;
                    if (btnSub != null)
                    {
                        btnSub.Attributes.Add("ID_ENTIDAD", entidad.Id.ToString());
                        btnSub.ToolTip  = CultureManager.GetMenu("OPE_MON_SUBENTIDAD");
                        btnSub.ImageUrl = ResolveUrl("~/OPE_MON_SUBENTIDAD.image");
                    }
                }
            }
        }
Exemplo n.º 19
0
 /// <summary>
 /// Adds report search results to session.
 /// </summary>
 private void AddResultsToSession()
 {
     Session.Add("Stadistics", Stadistics);
     Session.Add("Drivers", MobileDrivers);
     Session.Add("FechaDesde", SecurityExtensions.ToDataBaseDateTime(dpDesde.SelectedDate.GetValueOrDefault()));
     Session.Add("FechaHasta", SecurityExtensions.ToDataBaseDateTime(dpHasta.SelectedDate.GetValueOrDefault()));
     Session.Add("ResumenMobile", ddlVehiculo.Selected);
 }
Exemplo n.º 20
0
 private void AddResultsToSession()
 {
     Session.Add("Stadistics", Stadistics);
     Session.Add("Mobiles", OperatorMobiles);
     Session.Add("Empleado", ddlEmpleado.Selected);
     Session.Add("Desde", SecurityExtensions.ToDataBaseDateTime(dpDesde.SelectedDate.GetValueOrDefault()));
     Session.Add("Hasta", SecurityExtensions.ToDataBaseDateTime(dpHasta.SelectedDate.GetValueOrDefault()));
 }
Exemplo n.º 21
0
        protected override List <Medicion> GetResults()
        {
            var desde = dtFecha.SelectedDate != null?SecurityExtensions.ToDataBaseDateTime(dtFecha.SelectedDate.Value) : new DateTime();

            var hasta = desde.AddMonths(1).AddSeconds(-1);

            return(MedicionesPorFecha(hasta));
        }
Exemplo n.º 22
0
        protected override List <SupportTicketVo> GetListData()
        {
            var user    = DAOFactory.UsuarioDAO.FindById(Usuario.Id);
            var desde   = dtDesde.SelectedDate.HasValue ? SecurityExtensions.ToDataBaseDateTime(dtDesde.SelectedDate.GetValueOrDefault()): new DateTime?();
            var hasta   = dtHasta.SelectedDate.HasValue ? SecurityExtensions.ToDataBaseDateTime(dtHasta.SelectedDate.GetValueOrDefault()): new DateTime?();
            var tickets = DAOFactory.SupportTicketDAO.GetList(ddlLocacion.Selected, user, cbEstado.SelectedIndex - 1, desde, hasta, SearchString);

            return(tickets.Select(ticket => new SupportTicketVo(ticket)).ToList());
        }
Exemplo n.º 23
0
        protected override List <OperatorActivityVo> GetResults()
        {
            var desde = SecurityExtensions.ToDataBaseDateTime(dpDesde.SelectedDate.GetValueOrDefault());
            var hasta = SecurityExtensions.ToDataBaseDateTime(dpHasta.SelectedDate.GetValueOrDefault());

            var results = ReportFactory.OperatorActivityDAO.GetOperatorActivitys(desde, hasta, ddlDistrito.Selected, ddlBase.Selected, lbEmpleados.SelectedValues, Convert.ToInt32((double)npKm.Value));

            return((from result in results select new OperatorActivityVo(result)).ToList());
        }
Exemplo n.º 24
0
        protected override List <AcumulatedHours> GetResults()
        {
            var desde = SecurityExtensions.ToDataBaseDateTime(dpDesde.SelectedDate.GetValueOrDefault());
            var hasta = SecurityExtensions.ToDataBaseDateTime(dpHasta.SelectedDate.GetValueOrDefault());

            ToogleItems(lbEmpleados);

            return(ReportFactory.AcumulatedHoursDAO.GetAcumulatedHours(GetSelectedEmployees(), desde, hasta));
        }
Exemplo n.º 25
0
        private IEnumerable <Logictracker.Types.ReportObjects.MobileRoutes> GetRoutes(int vehicleId)
        {
            var desde = dtFecha.SelectedDate != null?SecurityExtensions.ToDataBaseDateTime(dtFecha.SelectedDate.GetValueOrDefault().AddHours(npHoraDesde.Value)) : DateTime.Today.ToDataBaseDateTime().AddHours(npHoraDesde.Value);

            var hasta = dtFecha.SelectedDate != null?SecurityExtensions.ToDataBaseDateTime(dtFecha.SelectedDate.GetValueOrDefault().AddHours(npHoraHasta.Value)).AddMinutes(59) : DateTime.Today.ToDataBaseDateTime().AddHours(npHoraHasta.Value).AddMinutes(59);

            var routes = ReportFactory.MobileRoutesDAO.GetMobileRoutes(vehicleId, desde, hasta);

            return(MergeResults(routes));
        }
Exemplo n.º 26
0
        protected override List <LoginAuditVo> GetResults()
        {
            var currentUser = DAOFactory.UsuarioDAO.FindById(Usuario.Id);
            var users       = (from Usuario u in DAOFactory.UsuarioDAO.FindByUsuario(currentUser) select u.Id).ToList();

            return(DAOFactory.LoginAuditDAO.GetAuditHistory(users,
                                                            SecurityExtensions.ToDataBaseDateTime(dpDesde.SelectedDate.GetValueOrDefault()),
                                                            SecurityExtensions.ToDataBaseDateTime(dpHasta.SelectedDate.GetValueOrDefault()))
                   .Select(a => new LoginAuditVo(a)).ToList());
        }
Exemplo n.º 27
0
        private void Search()
        {
            try
            {
                ValidateEntity(cbEmpresa.Selected, "PARENTI01");
                ValidateEntity(cbLinea.Selected, "PARENTI02");
                //ValidateEntity(cbBocaDeCarga.Selected, "BOCADECARGA");
                ValidateEmpty((DateTime?)dtDia.SelectedDate, (string)"DIA");
                if (!WebSecurity.IsSecuredAllowed(Securables.HormigonProgramarFuturo))
                {
                    ValidateHigher(DateTime.UtcNow.ToDisplayDateTime(), dtDia.SelectedDate.Value.Date, "DIA");
                }
                var cargaPromedio = ValidateEmpty((string)txtCargaMaxima.Text, (string)"PROGRAMACION_CARGA_MAXIMA");
                ValidateInt32(cargaPromedio, "PROGRAMACION_CARGA_MAXIMA");
                var mixers = ValidateEmpty((string)txtCantidadMixers.Text, (string)"PROGRAMACION_CANTIDAD_MIXERS");
                ValidateInt32(mixers, "PROGRAMACION_CANTIDAD_MIXERS");

                Carga          = Convert.ToInt32((string)txtCargaMaxima.Text.Trim());
                CantidadMixers = Convert.ToInt32((string)txtCantidadMixers.Text);
                var desde = dtDia.SelectedDate != null?SecurityExtensions.ToDataBaseDateTime(dtDia.SelectedDate.Value).Date : DateTime.MinValue;

                var hasta = desde.AddDays(1);
                var list  = DAOFactory.PedidoDAO.GetList(new[] { cbEmpresa.Selected },
                                                         new[] { cbLinea.Selected },
                                                         new[] { cbBocaDeCarga.Selected },
                                                         new[] { Pedido.Estados.Pendiente,
                                                                 Pedido.Estados.EnCurso,
                                                                 Pedido.Estados.Entregado },
                                                         desde,
                                                         hasta)
                            .OrderBy(p => p.FechaEnObra)
                            .ToList();



                if (list.Count > 0)
                {
                    repPedidos.Visible    = true;
                    repPedidos.DataSource = list;
                    repPedidos.DataBind();
                    CreateGraphic(list);
                    panelResultado.Visible = true;
                }
                else
                {
                    repPedidos.Visible = false;
                    ShowResourceError("NO_MATCHES_FOUND");
                    panelResultado.Visible = false;
                }
            }
            catch (Exception ex)
            {
                ShowError(ex);
            }
        }
Exemplo n.º 28
0
        protected override string GetGraphXml()
        {
            ToogleItems(lbBase);

            using (var helper = new FusionChartsMultiSeriesHelper())
            {
                SetGraphConfiguration(helper);

                var iniDate  = SecurityExtensions.ToDataBaseDateTime(dtpDate.SelectedDate.GetValueOrDefault());
                var finDate  = SecurityExtensions.ToDataBaseDateTime(dtpDate.SelectedDate.GetValueOrDefault()).AddHours(23).AddMinutes(59).AddSeconds(59);
                var colorGen = new ColorGenerator();

                var noCategoriesAdded = true;
                var hasValue          = false;
                if (lbBase.GetSelectedIndices().Length == 0)
                {
                    lbBase.ToogleItems();
                }

                foreach (var index in lbBase.GetSelectedIndices())
                {
                    var data = ReportFactory.IdleTimesDAO.GetAllMovilesStoppedInPlanta(Convert.ToInt32((string)lbBase.Items[index].Value),
                                                                                       iniDate, finDate, chkUndefined.Checked);

                    var dataset = new FusionChartsDataset {
                        Name = lbBase.Items[index].Text
                    };
                    dataset.SetPropertyValue("SeriesName", lbBase.Items[index].Text);
                    dataset.SetPropertyValue("color", HexColorUtil.ColorToHex(colorGen.GetNextColor()));

                    foreach (var item in data)
                    {
                        if (noCategoriesAdded)
                        {
                            helper.AddCategory(item.Date.ToShortTimeString());
                        }
                        dataset.addValue(item.TotalVehicles.ToString(CultureInfo.InvariantCulture));
                        if (!item.TotalVehicles.Equals(0))
                        {
                            hasValue = true;
                        }
                    }

                    helper.AddDataSet(dataset);
                    noCategoriesAdded = false;
                }

                if (!hasValue)
                {
                    throw new Exception(CultureManager.GetError("NO_MOBILE_IN_BASE"));
                }

                return(helper.BuildXml());
            }
        }
Exemplo n.º 29
0
 protected override List <TicketMantenimientoVo> GetListData()
 {
     return(DAOFactory.TicketMantenimientoDAO.GetList(cbTaller.SelectedValues,
                                                      cbEmpresa.SelectedValues,
                                                      cbLinea.SelectedValues,
                                                      cbVehiculo.SelectedValues,
                                                      SecurityExtensions.ToDataBaseDateTime(dtDesde.SelectedDate.Value),
                                                      SecurityExtensions.ToDataBaseDateTime(dtHasta.SelectedDate.Value))
            .Select(t => new TicketMantenimientoVo(t))
            .ToList());
 }
Exemplo n.º 30
0
        private void CargarMesActual()
        {
            var desde = dtFecha.SelectedDate != null?SecurityExtensions.ToDataBaseDateTime(dtFecha.SelectedDate.Value) : new DateTime();

            var hasta = desde.AddMonths(1).AddSeconds(-1);

            var valor = GetValorMedicion(desde, hasta);

            var key = desde.ToDisplayDateTime().ToString("MM/yyyy");

            _meses.Add(key, valor);
        }