/// <summary> /// Generates the Datasets and Categories for the CSV. /// </summary> protected override void GetGraphCategoriesAndDatasets() { var datasets = new List <FusionChartsDataset>(); var consumos = new FusionChartsDataset { Name = CultureManager.GetLabel("MOTORES") }; foreach (var consumo in _motores) { consumos.addValue(consumo.VolumenConsumido.ToString(CultureInfo.InvariantCulture)); } datasets.Add(consumos); var niveles = new FusionChartsDataset { Name = ddlTanque.SelectedItem.Text }; foreach (var r in ReportObjectsList) { niveles.addValue(r.VolumenConsumido.ToString(CultureInfo.InvariantCulture)); } datasets.Add(niveles); var categories = ReportObjectsList.Select(nivel => String.Format("{0} - {1}", nivel.Fecha.ToShortDateString(), nivel.Fecha.ToShortTimeString())).ToList(); GraphCategories = categories; GraphDataSet = datasets; }
protected override void Schedule() { var selectedGeocercas = GetGeofencesList(); if (DAL.DAO.BaseClasses.QueryExtensions.IncludesAll(selectedGeocercas)) { if (DAL.DAO.BaseClasses.QueryExtensions.IncludesAll(lbTipoDomicilio.SelectedValues)) { ShowError("Por favor, seleccione un Tipo de Referencia Geográfica."); } else { ShowError("No se encontraron Referencias Geográficas para los filtros seleccionados"); } } else { CbSchedulePeriodicidad.Items.Clear(); CbSchedulePeriodicidad.Items.Insert(0, new ListItem(CultureManager.GetLabel("DIARIO"), "D")); CbSchedulePeriodicidad.Items.Insert(1, new ListItem(CultureManager.GetLabel("SEMANAL"), "S")); CbSchedulePeriodicidad.Items.Insert(2, new ListItem(CultureManager.GetLabel("MENSUAL"), "M")); ModalSchedule.Show(); } }
/// <summary> /// Report data binding. /// </summary> /// <param name="e"></param> protected override void OnLoad(EventArgs e) { base.OnLoad(e); var showResults = false; MobileActivity activity = null; if (!To.ToShortDateString().Equals(DateTime.UtcNow.ToShortDateString())) { activity = GetResults(); showResults = activity != null; } if (showResults) { DisplayResults(activity); } else { infoLabel1.Mode = InfoLabelMode.INFO; infoLabel1.Text = CultureManager.GetSystemMessage(NoRouteInfo); } var mobile = activity != null ? activity.Movil : DAOFactory.CocheDAO.FindById(Mobile).Interno; lblTitle.Text = string.Format(CultureManager.GetLabel(RepGeocercasTitle), mobile); tblResults.Visible = showResults; lnkResumenDeRuta.Enabled = showResults; }
protected override void GetGraphCategoriesAndDatasets() { var datasets = new List <FusionChartsDataset>(); var hoursInShift = new FusionChartsDataset { Name = CultureManager.GetLabel("HS_EN_TURNO") }; var hoursOutOfShift = new FusionChartsDataset { Name = CultureManager.GetLabel("HS_FUERA_DE_TURNO") }; foreach (var item in ReportObjectsList) { hoursInShift.addValue(item.HoursInShift.ToString(CultureInfo.InvariantCulture)); hoursOutOfShift.addValue(item.HoursOutOfShift.ToString(CultureInfo.InvariantCulture)); } var categories = ReportObjectsList.Select(nivel => String.Format("{0} - {1}", nivel.Date.ToShortDateString(), nivel.Date.ToShortTimeString())).ToList(); datasets.Add(hoursOutOfShift); datasets.Add(hoursInShift); GraphCategories = categories; GraphDataSet = datasets; }
protected void BindResoluciones() { cbResolucion.Items.Clear(); cbResolucion.Items.Add(""); cbResolucion.Items.Add(CultureManager.GetLabel("SUPPORT_RESOLUTION_SOLVED")); cbResolucion.Items.Add(CultureManager.GetLabel("SUPPORT_RESOLUTION_NOTSOLVED")); }
/// <summary> /// Generates the CSV data of the Stadistic Iframe. /// </summary> /// <param name="builder"></param> private void GenerateStadisticsColumns(BaseCsvBuilder builder) { if (Stadistics == null) { return; } var separator = Usuario.CsvSeparator; builder.GenerateRow(CultureManager.GetLabel("DETALLE_VEHICULO")); builder.GenerateRow(String.Concat(CultureManager.GetLabel("RECORRIDO"), separator, CultureManager.GetLabel("TOTAL"), ":", Stadistics.KilometrosTotales, separator, CultureManager.GetLabel("PROMEDIO_DIARIO"), ":", Stadistics.KilometrosPromedio, separator)); builder.GenerateRow(String.Concat(CultureManager.GetLabel("DIAS"), separator, CultureManager.GetLabel("TOTALES"), ":", Stadistics.Dias, separator, CultureManager.GetLabel("CON_ACTIVIDAD"), ":", Stadistics.DiasActivo, separator, CultureManager.GetLabel("SIN_ACTIVIDAD"), ":", Stadistics.Dias - Stadistics.DiasActivo, separator)); builder.GenerateRow(String.Concat(CultureManager.GetLabel("VELOCIDAD"), separator, CultureManager.GetLabel("MAXIMA_ALCANZADA"), ":", Stadistics.VelocidadMaxima, separator, CultureManager.GetLabel("PROMEDIO"), ":", Stadistics.VelocidadPromedio, separator)); builder.GenerateRow(String.Concat(CultureManager.GetLabel("TIEMPOS"), separator, CultureManager.GetLabel("MOVIMIENTO"), ":", Stadistics.HorasMovimiento, separator, CultureManager.GetLabel("DETENCION"), ":", Stadistics.HorasDetenido, separator, CultureManager.GetLabel("SIN_REPORTAR"), ":", Stadistics.HorasSinReportar, separator)); builder.GenerateRow(String.Concat(CultureManager.GetLabel("INFRACCIONES"), separator, CultureManager.GetLabel("CANTIDAD"), ":", Stadistics.Infracciones, separator, CultureManager.GetLabel("TIEMPO"), ":", Stadistics.HsInfraccion, separator)); builder.GenerateRow(""); }
public ViajeDistribucionVo(ViajeDistribucion viaje) { Distribucion = viaje; Id = viaje.Id; IdEmpresa = viaje.Empresa.Id; IdLinea = viaje.Linea != null ? viaje.Linea.Id : 0; IdVehiculo = viaje.Vehiculo != null ? viaje.Vehiculo.Id : 0; IdTipoVehiculo = viaje.TipoCoche != null ? viaje.TipoCoche.Id : 0; Codigo = viaje.Codigo; Inicio = viaje.Inicio.ToDisplayDateTime(); InicioReal = viaje.InicioReal.HasValue ? viaje.InicioReal.Value.ToDisplayDateTime() : (DateTime?)null; Vehiculo = viaje.Vehiculo != null ? viaje.Vehiculo.Interno : string.Empty; Paradas = viaje.EntregasTotalCount; Estado = viaje.Estado; HasCoche = viaje.Vehiculo != null; Tipo = viaje.Tipo == ViajeDistribucion.Tipos.Ordenado ? CultureManager.GetLabel("TIPODISTRI_NORMAL") : viaje.Tipo == ViajeDistribucion.Tipos.Desordenado ? CultureManager.GetLabel("TIPODISTRI_DESORDENADA") : viaje.Tipo == ViajeDistribucion.Tipos.RecorridoFijo ? CultureManager.GetLabel("TIPODISTRI_RECORRIDO_FIJO") : string.Empty; var entregasNomencladas = viaje.EntregasNomencladasCount; Nomenclado = entregasNomencladas == Paradas; NoNomencladas = Nomenclado ? 0 : Paradas - entregasNomencladas; }
private void GenerateColumns(BaseCsvBuilder builder) { builder.GenerateRow(String.Concat(Separator, Separator, Separator, Separator, CultureManager.GetLabel("TOTALES"), Separator, Separator, Separator, Separator, CultureManager.GetLabel("INFRACCIONES"))); builder.GenerateRow(String.Concat(CultureManager.GetLabel("CHOFER"), Separator, CultureManager.GetLabel("LEGAJO"), Separator, CultureManager.GetEntity("PARENTI37"), Separator, CultureManager.GetEntity("PARENTI04"), Separator, Separator, CultureManager.GetLabel("KILOMETROS"), Separator, CultureManager.GetLabel("MOVIMIENTO"), Separator, CultureManager.GetLabel("PUNTAJE"), Separator, Separator, CultureManager.GetLabel("LEVES"), Separator, CultureManager.GetLabel("MEDIAS"), Separator, CultureManager.GetLabel("GRAVES"), Separator, CultureManager.GetLabel("TOTALES"), Separator)); }
protected void GridEstadosItemDataBound(object sender, C1GridViewRowEventArgs e) { if (e.Row.RowType != C1GridViewRowType.DataRow) { return; } var detail = e.Row.DataItem as HistoriaTicketMantenimiento; if (detail == null) { return; } e.Row.BackColor = TicketMantenimiento.EstadosTicket.GetColor(detail.Estado); e.Row.Cells[0].Text = detail.Fecha.ToDisplayDateTime().ToString("dd/MM/yyyy HH:mm"); e.Row.Cells[1].Text = detail.Usuario.NombreUsuario; e.Row.Cells[2].Text = CultureManager.GetLabel(TicketMantenimiento.EstadosTicket.GetLabelVariableName(detail.Estado)); e.Row.Cells[3].Text = CultureManager.GetLabel(TicketMantenimiento.NivelesComplejidad.GetLabelVariableName(detail.NivelComplejidad)); e.Row.Cells[4].Text = detail.FechaTurno.HasValue ? detail.FechaTurno.Value.ToDisplayDateTime().ToString("dd/MM/yyyy HH:mm") : string.Empty; e.Row.Cells[5].Text = detail.FechaRecepcion.HasValue ? detail.FechaRecepcion.Value.ToDisplayDateTime().ToString("dd/MM/yyyy HH:mm") : string.Empty; e.Row.Cells[6].Text = detail.FechaVerificacion.HasValue ? detail.FechaVerificacion.Value.ToDisplayDateTime().ToString("dd/MM/yyyy HH:mm") : string.Empty; e.Row.Cells[7].Text = detail.FechaTrabajoTerminado.HasValue ? detail.FechaTrabajoTerminado.Value.ToDisplayDateTime().ToString("dd/MM/yyyy HH:mm") : string.Empty; e.Row.Cells[8].Text = detail.FechaEntrega.HasValue ? detail.FechaEntrega.Value.ToDisplayDateTime().ToString("dd/MM/yyyy HH:mm") : string.Empty; e.Row.Cells[9].Text = detail.FechaTrabajoAceptado.HasValue ? detail.FechaTrabajoAceptado.Value.ToDisplayDateTime().ToString("dd/MM/yyyy HH:mm") : string.Empty; e.Row.Cells[10].Text = detail.Descripcion; }
protected void InitializeMonitor() { Monitor.DrawLine += MonitorDrawLine; Monitor.FeatureModified += MonitorFeatureModified; Monitor.EnableTimer = false; if (IsPostBack) { return; } Monitor.DrawLineMethod = EventMethods.PostBack; Monitor.ModFeatureMethod = EventMethods.PostBack; Monitor.ImgPath = Config.Monitor.GetMonitorImagesFolder(Page); Monitor.GoogleMapsScript = Config.Map.GoogleMapsKey; Monitor.AddLayers(LayerFactory.GetGoogleStreet(CultureManager.GetLabel("LAYER_GSTREET"), MinZoomLevel), //LayerFactory.GetCompumap(CultureManager.GetLabel("LAYER_COMPUMAP"), Config.Map.CompumapTiles, MIN_ZOOM_LEVEL), LayerFactory.GetOpenStreetMap(CultureManager.GetLabel("LAYER_OSM")), LayerFactory.GetGoogleSatellite(CultureManager.GetLabel("LAYER_GSAT"), MinZoomLevel), LayerFactory.GetGoogleHybrid(CultureManager.GetLabel("LAYER_GHIBRIDO"), MinZoomLevel), LayerFactory.GetGooglePhysical(CultureManager.GetLabel("LAYER_GFISICO"), MinZoomLevel), LayerFactory.GetVector(LayerRecorrido, true, StyleFactory.GetHandlePoint()), LayerFactory.GetMarkers(LayerMarkers, true)); Monitor.AddControls(ControlFactory.GetLayerSwitcher(), ControlFactory.GetNavigation(), ControlFactory.GetPanZoomBar(), ControlFactory.GetToolbar(false, false, false, true, false, true, false, false, LayerRecorrido)); if (MapLoad != null) { MapLoad(Monitor, EventArgs.Empty); } }
protected override string GetGraphXml() { using (var helper = new FusionChartsHelper()) { helper.AddConfigEntry("caption", string.Format(CultureManager.GetLabel(DesdeHasta), dpDesde.SelectedDate.GetValueOrDefault().ToShortDateString(), dpHasta.SelectedDate.GetValueOrDefault().ToShortDateString())); helper.AddConfigEntry("xAxisName", XAxisLabel); helper.AddConfigEntry("yAxisName", YAxisLabel); helper.AddConfigEntry("decimalPrecision", "2"); helper.AddConfigEntry("numberSuffix", "km"); helper.AddConfigEntry("hoverCapSepChar", " - "); helper.AddConfigEntry("rotateNames", "1"); foreach (var kilometer in ReportObjectsList) { var item = new FusionChartsItem(); item.AddPropertyValue("color", "AFD8F8"); item.AddPropertyValue("name", kilometer.Interno.Replace('&', 'y')); item.AddPropertyValue("value", kilometer.Kilometers.ToString(CultureInfo.InvariantCulture)); item.AddPropertyValue("hoverText", kilometer.Interno.Replace('&', 'y')); helper.AddItem(item); } return(helper.BuildXml()); } }
protected override void GetGraphCategoriesAndDatasets() { var datasets = new List <FusionChartsDataset>(); var hsTurnoOn = new FusionChartsDataset { Name = CultureManager.GetLabel("HS_TURNO_ON") }; var hsTurnoOff = new FusionChartsDataset { Name = CultureManager.GetLabel("HS_TURNO_OFF") }; var hsOn = new FusionChartsDataset { Name = CultureManager.GetLabel("HS_ON") }; var hsOff = new FusionChartsDataset { Name = CultureManager.GetLabel("HS_OFF") }; var categories = new List <string>(); foreach (var r in ReportObjectsList) { categories.Add(r.Fecha.ToShortDateString()); hsTurnoOn.addValue(r.HsTurnoOn.ToString(CultureInfo.InvariantCulture)); hsTurnoOff.addValue(r.HsTurnoOff.ToString(CultureInfo.InvariantCulture)); hsOn.addValue(r.HsOn.ToString(CultureInfo.InvariantCulture)); hsOff.addValue(r.HsOff.ToString(CultureInfo.InvariantCulture)); } datasets.Add(hsTurnoOn); datasets.Add(hsTurnoOff); datasets.Add(hsOn); datasets.Add(hsOff); GraphCategories = categories; GraphDataSet = datasets; }
protected override string GetGraphXml() { using (var helper = new FusionChartsHelper()) { helper.AddConfigEntry("caption", string.Format(CultureManager.GetLabel(DesdeHasta), dpDesde.SelectedDate.GetValueOrDefault().ToShortDateString(), dpHasta.SelectedDate.GetValueOrDefault().ToShortDateString())); helper.AddConfigEntry("xAxisName", XAxisLabel); helper.AddConfigEntry("yAxisName", YAxisLabel); helper.AddConfigEntry("decimalPrecision", "2"); helper.AddConfigEntry("numberSuffix", "hs"); helper.AddConfigEntry("hoverCapSepChar", " - "); helper.AddConfigEntry("rotateNames", "1"); foreach (var time in ReportObjectsList) { var item = new FusionChartsItem(); item.AddPropertyValue("color", "AFD8F8"); item.AddPropertyValue("name", time.Intern.Replace('&', 'y')); item.AddPropertyValue("value", time.ElapsedTime.ToString(CultureInfo.InvariantCulture)); var hours = TimeSpan.FromHours(time.ElapsedTime); item.AddPropertyValue("hoverText", string.Concat(time.Intern.Replace('&', 'y'), string.Format(" - {0}dd {1}hh {2}mm {3}ss", hours.Days, hours.Hours, hours.Minutes, hours.Seconds))); helper.AddItem(item); } return(helper.BuildXml()); } }
/// <summary> /// Autoconfigurar con opciones básicas /// </summary> public void Initialize(bool googleMapsEnabled) { if (!Page.IsPostBack) { const int minZoomLevel = 4; ImgPath = Config.Monitor.GetMonitorImagesFolder(Page); GoogleMapsScript = Config.Map.GoogleMapsKey; if (googleMapsEnabled) { AddLayers(LayerFactory.GetGoogleStreet(CultureManager.GetLabel("LAYER_GSTREET"), minZoomLevel), //LayerFactory.GetCompumap(CultureManager.GetLabel("LAYER_COMPUMAP"), Config.Map.CompumapTiles, minZoomLevel), LayerFactory.GetOpenStreetMap(CultureManager.GetLabel("LAYER_OSM")), LayerFactory.GetGoogleSatellite(CultureManager.GetLabel("LAYER_GSAT"), minZoomLevel), LayerFactory.GetGoogleHybrid(CultureManager.GetLabel("LAYER_GHIBRIDO"), minZoomLevel), LayerFactory.GetGooglePhysical(CultureManager.GetLabel("LAYER_GFISICO"), minZoomLevel)); } else { AddLayers(LayerFactory.GetOpenStreetMap(CultureManager.GetLabel("LAYER_OSM"))); } AddControls(ControlFactory.GetLayerSwitcher(), ControlFactory.GetNavigation(), ControlFactory.GetPanZoomBar()); SetDefaultCenter(-34.6134981326759, -58.4255323559046); SetCenter(-34.6134981326759, -58.4255323559046, 10); } }
/// <summary> /// Gets graph xml definition based on the report data. /// </summary> /// <returns></returns> protected override string GetGraphXml() { using (var helper = new FusionChartsHelper()) { helper.AddConfigEntry("caption", CultureManager.GetLabel(MaximasDiarias)); helper.AddConfigEntry("xAxisName", XAxisLabel); helper.AddConfigEntry("yAxisName", YAxisLabel); helper.AddConfigEntry("decimalPrecision", "2"); helper.AddConfigEntry("numberSuffix", "km/h"); helper.AddConfigEntry("hoverCapSepChar", " -"); helper.AddConfigEntry("rotateNames", "1"); foreach (var speed in ReportObjectsList) { var item = new FusionChartsItem(); if (!speed.Dia.DayOfWeek.Equals(DayOfWeek.Saturday) & !speed.Dia.DayOfWeek.Equals(DayOfWeek.Sunday)) { item.AddPropertyValue("color", "008ED6"); } item.AddPropertyValue("name", speed.Dia.ToString("dd/MM")); item.AddPropertyValue("value", speed.Velocidad.ToString("#0")); item.AddPropertyValue("hoverText", string.Concat(CultureManager.GetLabel(Dia), string.Format(" {0:dd/MM/yyyy}", speed.Dia), " - ", CultureManager.GetLabel("ALCANZADA_POR"), " ", speed.CometidoPor)); helper.AddItem(item); } return(helper.BuildXml()); } }
protected void GridPresupuestoItemDataBound(object sender, C1GridViewRowEventArgs e) { if (e.Row.RowType != C1GridViewRowType.DataRow) { return; } var detail = e.Row.DataItem as HistoriaTicketMantenimiento; if (detail == null) { return; } e.Row.BackColor = TicketMantenimiento.EstadosPresupuesto.GetColor(detail.EstadoPresupuesto); e.Row.Cells[0].Text = detail.Fecha.ToDisplayDateTime().ToString("dd/MM/yyyy HH:mm"); e.Row.Cells[1].Text = detail.Usuario.NombreUsuario; e.Row.Cells[2].Text = detail.Presupuesto; e.Row.Cells[3].Text = detail.Monto.ToString("#0.00"); e.Row.Cells[4].Text = detail.FechaPresupuestada.HasValue ? detail.FechaPresupuestada.Value.ToDisplayDateTime().ToString("dd/MM/yyyy HH:mm") : string.Empty; e.Row.Cells[5].Text = CultureManager.GetLabel(TicketMantenimiento.EstadosPresupuesto.GetLabelVariableName(detail.EstadoPresupuesto)); e.Row.Cells[6].Text = detail.PrimerPresupuesto; e.Row.Cells[7].Text = detail.FechaPresupuestoOriginal.HasValue ? detail.FechaPresupuestoOriginal.Value.ToDisplayDateTime().ToString("dd/MM/yyyy HH:mm") : string.Empty; e.Row.Cells[8].Text = detail.FechaRecotizacion.HasValue ? detail.FechaRecotizacion.Value.ToDisplayDateTime().ToString("dd/MM/yyyy HH:mm") : string.Empty; e.Row.Cells[9].Text = detail.FechaAprobacion.HasValue ? detail.FechaAprobacion.Value.ToDisplayDateTime().ToString("dd/MM/yyyy HH:mm") : string.Empty; }
/// <summary> /// Gets the filter values for the exported report version. /// </summary> /// <returns></returns> protected override Dictionary <string, string> GetFilterValues() { var hsInfraccion = TimeSpan.FromHours(Stadistics.HsInfraccion); return(new Dictionary <string, string> { { CultureManager.GetEntity("PARENTI01"), ddlDistrito.SelectedItem.Text }, { CultureManager.GetEntity("PARENTI02"), ddlBase.SelectedItem.Text }, { CultureManager.GetEntity("PARENTI03"), ddlVehiculo.SelectedItem.Text }, { CultureManager.GetLabel("DESDE"), dpDesde.SelectedDate.GetValueOrDefault().ToShortDateString() + " " + dpDesde.SelectedDate.GetValueOrDefault().ToShortTimeString() }, { CultureManager.GetLabel("HASTA"), dpHasta.SelectedDate.GetValueOrDefault().ToShortDateString() + " " + dpHasta.SelectedDate.GetValueOrDefault().ToShortTimeString() }, { CultureManager.GetLabel("TOTAL"), Stadistics.KilometrosTotales.ToString("#0.00") + " km" }, { CultureManager.GetLabel("PROMEDIO_DIARIO"), Stadistics.KilometrosPromedio.ToString("#0.00") + " km" }, { CultureManager.GetLabel("TOTALES"), Stadistics.Dias.ToString("#0") }, { CultureManager.GetLabel("CON_ACTIVIDAD"), Stadistics.DiasActivo.ToString("#0") }, { CultureManager.GetLabel("SIN_ACTIVIDAD"), (Stadistics.Dias - Stadistics.DiasActivo).ToString("#0") }, { CultureManager.GetLabel("MAXIMA_ALCANZADA"), Stadistics.VelocidadMaxima + " km/h" }, { CultureManager.GetLabel("PROMEDIO"), Stadistics.VelocidadPromedio + " km/h" }, { CultureManager.GetLabel("MOVIMIENTO"), CultureManager.GetLabel("DIAS") + ": " + Stadistics.HorasMovimiento.Days + " - " + CultureManager.GetLabel("HORAS") + ": " + Stadistics.HorasMovimiento.Hours.ToString("00") + ":" + Stadistics.HorasMovimiento.Minutes.ToString("00") + ":" + Stadistics.HorasMovimiento.Seconds.ToString("00") }, { CultureManager.GetLabel("DETENCION"), CultureManager.GetLabel("DIAS") + ": " + Stadistics.HorasDetenido.Days + " - " + CultureManager.GetLabel("HORAS") + ": " + Stadistics.HorasDetenido.Hours.ToString("00") + ":" + Stadistics.HorasDetenido.Minutes.ToString("00") + ":" + Stadistics.HorasDetenido.Seconds.ToString("00") }, { CultureManager.GetLabel("SIN_REPORTAR"), CultureManager.GetLabel("DIAS") + ": " + Stadistics.HorasSinReportar.Days + " - " + CultureManager.GetLabel("HORAS") + ": " + Stadistics.HorasSinReportar.Hours.ToString("00") + ":" + Stadistics.HorasSinReportar.Minutes.ToString("00") + ":" + Stadistics.HorasSinReportar.Seconds.ToString("00") }, { CultureManager.GetLabel("CANTIDAD"), Stadistics.Infracciones.ToString("#0") }, { CultureManager.GetLabel("TIEMPO"), hsInfraccion.Hours.ToString("00") + ":" + hsInfraccion.Minutes.ToString("00") + ":" + hsInfraccion.Seconds.ToString("00") } }); }
protected override string GetGraphXml() { using (var helper = new FusionChartsHelper()) { helper.AddConfigEntry("caption", CultureManager.GetLabel("MAXIMAS_DIARIAS")); helper.AddConfigEntry("xAxisName", XAxisLabel); helper.AddConfigEntry("yAxisName", YAxisLabel); helper.AddConfigEntry("decimalPrecision", "0"); helper.AddConfigEntry("showValues", "0"); helper.AddConfigEntry("numberSuffix", string.Empty); helper.AddConfigEntry("rotateNames", "1"); helper.AddConfigEntry("limitsDecimalPrecision", "0"); helper.AddConfigEntry("hoverCapSepChar", "-"); foreach (var t in ReportObjectsList) { var item = new FusionChartsItem(); item.AddPropertyValue("name", t.Date.ToString("dd/MM")); item.AddPropertyValue("hoverText", t.Max.ToString("0")); item.AddPropertyValue("value", t.Max.ToString("0")); helper.AddItem(item); } if (ReportObjectsList.Count.Equals(0)) { ThrowError("NO_MATCHES_FOUND"); } return(helper.BuildXml()); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int id; if (Request.QueryString["id"] == null || !int.TryParse(Request.QueryString["id"], out id)) { LblInfo.Text = CultureManager.GetError("NO_ENTREGA_INFO"); return; } var entrega = DAOFactory.EntregaDistribucionDAO.FindById(id); if (entrega != null) { var icono = entrega.PuntoEntrega.ReferenciaGeografica.Icono != null?Path.Combine(IconDir, entrega.PuntoEntrega.ReferenciaGeografica.Icono.PathIcono) : ResolveUrl("~/point.png"); imgIcono.Src = icono; lblCodigo.Text = string.Format("{0} - {1}<br>{2}", entrega.PuntoEntrega.Codigo, entrega.PuntoEntrega.Descripcion, GeocoderHelper.GetDescripcionEsquinaMasCercana(entrega.PuntoEntrega.ReferenciaGeografica.Latitude, entrega.PuntoEntrega.ReferenciaGeografica.Longitude)); lblDescripcion.Text = entrega.Descripcion; lblProgramado.Text = entrega.Programado.ToDisplayDateTime().ToString("HH:mm"); //lblGps.Text = entrega.KmGps.HasValue ? entrega.KmGps.Value.ToString(CultureInfo.InvariantCulture) : "N/D"; lblEntrada.Text = entrega.Entrada.HasValue ? entrega.Entrada.Value.ToDisplayDateTime().ToString("HH:mm") : string.Empty; lblManual.Text = entrega.Manual.HasValue ? entrega.Manual.Value.ToDisplayDateTime().ToString("HH:mm") : string.Empty; lblSalida.Text = entrega.Salida.HasValue ? entrega.Salida.Value.ToDisplayDateTime().ToString("HH:mm") : string.Empty; //lblCalculado.Text = entrega.KmCalculado.HasValue ? entrega.KmCalculado.Value.ToString(CultureInfo.InvariantCulture) : "N/D"; //lblControlado.Text = entrega.Viaje.Controlado && entrega.KmControlado.HasValue ? entrega.KmControlado.Value.ToString(CultureInfo.InvariantCulture) : "N/D"; lblEstado.Text = CultureManager.GetLabel(EntregaDistribucion.Estados.GetLabelVariableName(entrega.Estado)); lnkEditarPunto.OnClientClick = string.Format("window.open('../Parametrizacion/GeoRefAlta.aspx?id={0}')", entrega.PuntoEntrega.ReferenciaGeografica.Id); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int id; if (Request.QueryString["id"] == null || !int.TryParse(Request.QueryString["id"], out id)) { LblInfo.Text = CultureManager.GetError("NO_ENTREGA_INFO"); return; } var entrega = DAOFactory.EntregaDistribucionDAO.FindById(id); if (entrega != null) { lblEntrega.Text = entrega.Descripcion; lblViaje.Text = entrega.Viaje.Codigo; lblVehiculo.Text = entrega.Viaje.Vehiculo != null ? entrega.Viaje.Vehiculo.Interno : CultureManager.GetError("NO_VEHICLE_ASSIGNED"); lblEstado.Text = CultureManager.GetLabel(EntregaDistribucion.Estados.GetLabelVariableName(entrega.Estado)); if (entrega.ReferenciaGeografica != null) { lblDireccion.Text = GeocoderHelper.GetDescripcionEsquinaMasCercana(entrega.ReferenciaGeografica.Latitude, entrega.ReferenciaGeografica.Longitude); } lblEntrada.Text = (entrega.Entrada.HasValue ? entrega.Entrada.Value.ToDisplayDateTime().ToString("yyyy/MM/dd HH:mm") : string.Empty); lblManual.Text = (entrega.Manual.HasValue ? entrega.Manual.Value.ToDisplayDateTime().ToString("yyyy/MM/dd HH:mm") : string.Empty); lblSalida.Text = (entrega.Salida.HasValue ? entrega.Salida.Value.ToDisplayDateTime().ToString("yyyy/MM/dd HH:mm") : string.Empty); lnkMonitorCiclo.Attributes.Add("id", entrega.Viaje.Id.ToString("#0")); } } }
protected override string GetGraphXml() { using (var helper = new FusionChartsMultiSeriesHelper()) { SetGraphConfiguration(helper); var hoursInShift = new FusionChartsDataset { Name = CultureManager.GetLabel("HS_EN_TURNO") }; hoursInShift.SetPropertyValue("seriesName", CultureManager.GetLabel("HS_EN_TURNO")); var hoursOutOfShift = new FusionChartsDataset { Name = CultureManager.GetLabel("HS_FUERA_DE_TURNO") }; hoursOutOfShift.SetPropertyValue("seriesName", CultureManager.GetLabel("HS_FUERA_DE_TURNO")); hoursOutOfShift.SetPropertyValue("color", "1E90FF"); if (!ReportObjectsList.Any(d => !d.HoursInShift.Equals(0) || !d.HoursOutOfShift.Equals(0))) { return(helper.BuildXml()); } foreach (var item in ReportObjectsList) { helper.AddCategory(item.Date.ToShortTimeString()); hoursInShift.addValue(item.HoursInShift.ToString(CultureInfo.InvariantCulture)); hoursOutOfShift.addValue(item.HoursOutOfShift.ToString(CultureInfo.InvariantCulture)); } helper.AddDataSet(hoursInShift); helper.AddDataSet(hoursOutOfShift); return(helper.BuildXml()); } }
protected override void OnRowDataBound(C1GridView grid, C1GridViewRowEventArgs e, VehicleInfractionDetailVo dataItem) { var cellCalificacion = GridUtils.GetCell(e.Row, VehicleInfractionDetailVo.IndexCalificacion); switch (Convert.ToInt32(cellCalificacion.Text)) { case 1: e.Row.BackColor = Color.FromArgb(238, 221, 130); cellCalificacion.Text = CultureManager.GetLabel(Leve); break; case 2: e.Row.BackColor = Color.FromArgb(255, 140, 0); cellCalificacion.Text = CultureManager.GetLabel(Media); break; case 3: e.Row.BackColor = Color.FromArgb(255, 69, 0); cellCalificacion.Text = CultureManager.GetLabel(Grave); break; default: cellCalificacion.Text = CultureManager.GetLabel(SinDefinir); break; } grid.Columns[InfractionDetailVo.IndexCornerNearest].Visible = chkVerEsquinas.Checked; }
protected override List <ConsumosMotorVo> GetResults() { ToogleItems(lbMotores); var despachos = new List <ConsumosMotorVo>(); double totalDespachado = 0; var consumos = ReportFactory.ConsumosPorMotorDAO.FindConsumosForMotores(lbMotores.SelectedValues, dpDesde.SelectedDate.GetValueOrDefault(), dpHasta.SelectedDate.GetValueOrDefault()); if (consumos.Count <= 0) { return(despachos); } foreach (var desp in consumos) { despachos.Add(new ConsumosMotorVo(desp)); totalDespachado += desp.DifVolumen; } lblTotal.Text = string.Format(CultureManager.GetLabel("TOTAL_CONSUMIDO") + ": {0} lt", totalDespachado); lblTitle.Visible = tblTotal.Visible = despachos.Count > 0; return(despachos); }
protected override string GetGraphXml() { using (var helper = new FusionChartsHelper()) { helper.AddConfigEntry("caption", string.Format(CultureManager.GetLabel(DesdeHasta), dpDesde.SelectedDate.GetValueOrDefault().ToShortDateString(), dpHasta.SelectedDate.GetValueOrDefault().ToShortDateString())); helper.AddConfigEntry("xAxisName", XAxisLabel); helper.AddConfigEntry("yAxisName", YAxisLabel); helper.AddConfigEntry("decimalPrecision", "2"); helper.AddConfigEntry("numberSuffix", "km"); helper.AddConfigEntry("hoverCapSepChar", " - "); helper.AddConfigEntry("rotateNames", "1"); foreach (var kilometer in ReportObjectsList) { var item = new FusionChartsItem(); item.AddPropertyValue("link", Server.UrlEncode(string.Format( "n-{0}Reportes/Estadistica/MonthKilometers.aspx?Movil={1}&InitialDate={2}&FinalDate={3}&SoloEnRuta={4}", ApplicationPath, kilometer.Movil, dpDesde.SelectedDate.GetValueOrDefault().ToString(CultureInfo.InvariantCulture), dpHasta.SelectedDate.GetValueOrDefault().ToString(CultureInfo.InvariantCulture), chkEnCiclo.Checked))); item.AddPropertyValue("color", "AFD8F8"); item.AddPropertyValue("name", kilometer.Interno.Replace('&', 'y')); item.AddPropertyValue("value", kilometer.Kilometers.ToString(CultureInfo.InvariantCulture)); item.AddPropertyValue("hoverText", kilometer.Interno.Replace('&', 'y')); helper.AddItem(item); } return(helper.BuildXml()); } }
/// <summary> /// Initial data binding. /// </summary> /// <param name="e"></param> protected override void OnLoad(EventArgs e) { base.OnLoad(e); var stadistics = ReportData; if (stadistics == null) { return; } var employeeType = String.IsNullOrEmpty(stadistics.TipoEmpleado) ? CultureManager.GetControl("DDL_NO_TIPOEMPLEADO") : stadistics.TipoEmpleado; lblOperador.Text = string.Format(CultureManager.GetLabel(OperadorYLegajo), stadistics.Nombre, employeeType, stadistics.Legajo); lblTotal.Text = string.Format("{0:0.00}km", stadistics.KilometrosTotales); lblDistanciaPromedio.Text = string.Format("{0:0.00}km", stadistics.KilometrosPromedio); lblDias.Text = stadistics.Dias.ToString(); lblActivo.Text = stadistics.DiasActivo.ToString(); lblInactivo.Text = (stadistics.Dias - stadistics.DiasActivo).ToString(); lblAlcanzada.Text = string.Format("{0:0.00}km/h", stadistics.VelocidadMaxima); lblVelocidadPromedio.Text = string.Format("{0:0.00}km/h", stadistics.VelocidadPromedio); lblMovimiento.Text = string.Format(CultureManager.GetLabel(MovimientoYEventos), stadistics.HorasMovimiento.Days, stadistics.HorasMovimiento.Hours, stadistics.HorasMovimiento.Minutes, stadistics.HorasMovimiento.Seconds, stadistics.MovementEvents); lblDetencion.Text = string.Format(CultureManager.GetLabel(MovimientoYEventos), stadistics.HorasDetenido.Days, stadistics.HorasDetenido.Hours, stadistics.HorasDetenido.Minutes, stadistics.HorasDetenido.Seconds, stadistics.StoppedEvents); lblSinReportar.Text = string.Format(CultureManager.GetLabel(MovimientoYEventos), stadistics.HorasSinReportar.Days, stadistics.HorasSinReportar.Hours, stadistics.HorasSinReportar.Minutes, stadistics.HorasSinReportar.Seconds, stadistics.NoReportEvents); lblInfraccion.Text = stadistics.HorasInfraccion.ToString(); lblInfracciones.Text = stadistics.Infracciones.ToString(); }
private void DisplayEventsTitle(string evento) { ifEvents.Visible = true; lblEventosPrint.Visible = lblEventos.Visible = lnkEventos.Visible = true; var mobile = ddlVehiculo.SelectedItem.Text; DateTime from; DateTime to; if (evento == string.Empty) { from = Convert.ToDateTime(GridUtils.GetCell(Grid.SelectedRow, MobileRoutesVo.IndexInitialTime).Text); to = Convert.ToDateTime(GridUtils.GetCell(Grid.SelectedRow, MobileRoutesVo.IndexFinalTime).Text); } else { from = Convert.ToDateTime((object)dpDesde.SelectedDate); to = Convert.ToDateTime((object)dpDesde.SelectedDate); } lblEventosPrint.Text = lblEventos.Text = string.Format(CultureManager.GetLabel("REP_EVENTOS_TITLE"), mobile, from, to); lnkEventos.Text = CultureManager.GetControl("BUTTON_MAP"); lnkEventos.Attributes.Add("fechaDesde", from.ToString()); lnkEventos.Attributes.Add("fechaHasta", to.ToString()); }
/// <summary> /// Generates the categories and Datasets for the /// </summary> protected override void GetGraphCategoriesAndDatasets() { var datasets = new List <FusionChartsDataset>(); var teoricDataset = new FusionChartsDataset { Name = CultureManager.GetLabel("TEORICO") }; var realDataset = new FusionChartsDataset { Name = CultureManager.GetLabel("REAL") }; var categories = new List <string>(); foreach (var consist in ReportObjectsList) { categories.Add(String.Format("{0} - {1}", consist.Fecha.ToShortDateString(), consist.Fecha.ToShortTimeString())); teoricDataset.addValue(consist.StockTeorico.ToString(CultureInfo.InvariantCulture)); realDataset.addValue(consist.StockReal.ToString(CultureInfo.InvariantCulture)); } if (chkTeorico.Checked) { datasets.Add(teoricDataset); } if (chkReal.Checked) { datasets.Add(realDataset); } GraphCategories = categories; GraphDataSet = datasets; }
private void InitializeGraph(FusionChartsHelper helper) { helper.AddConfigEntry("caption", string.Format(CultureManager.GetLabel(VariacionTemperaturaCaption), ddlSubentidad.SelectedItem.Text, dtpFecha.SelectedDate, dtpFecha.SelectedDate.GetValueOrDefault().Subtract(TimeSpan.FromMinutes(npMinutes.Value)), dtpFecha.SelectedDate.GetValueOrDefault().AddMinutes(npMinutes.Value))); helper.AddConfigEntry("xAxisName", XAxisLabel); helper.AddConfigEntry("yAxisName", YAxisLabel); helper.AddConfigEntry("decimalPrecision", "1"); helper.AddConfigEntry("showValues", "0"); var numberSuffix = string.Empty; if (Subentidad > 0) { var subentidad = DAOFactory.SubEntidadDAO.FindById(Subentidad); if (subentidad != null && subentidad.Sensor != null && subentidad.Sensor.TipoMedicion != null && subentidad.Sensor.TipoMedicion.UnidadMedida != null) { numberSuffix = subentidad.Sensor.TipoMedicion.UnidadMedida.Simbolo; } } helper.AddConfigEntry("numberSuffix", numberSuffix); helper.AddConfigEntry("rotateNames", "1"); helper.AddConfigEntry("limitsDecimalPrecision", "1"); helper.AddConfigEntry("hoverCapSepChar", "-"); var max = (((int)(_maxVal / 10)) + 1) * 10; var min = (((int)(_minVal / 10)) - 1) * 10; helper.AddConfigEntry("yAxisMaxValue", max > _maxVal ? max.ToString() : _maxVal.ToString()); helper.AddConfigEntry("yAxisMinValue", min < _minVal ? min.ToString() : _minVal.ToString()); }
protected override string GetGraphXml() { using (var helper = new FusionChartsHelper()) { helper.AddConfigEntry("caption", string.Format(CultureManager.GetLabel(DesdeHasta), dpDesde.SelectedDate.GetValueOrDefault().ToString("dd/MM/yyyy HH:mm"), dpHasta.SelectedDate.GetValueOrDefault().ToString("dd/MM/yyyy HH:mm"))); helper.AddConfigEntry("decimalPrecision", "1"); helper.AddConfigEntry("xAxisName", XAxisLabel); helper.AddConfigEntry("yAxisName", YAxisLabel); helper.AddConfigEntry("hoverCapSepChar", " - "); helper.AddConfigEntry("rotateNames", "1"); foreach (var checkout in ReportObjectsList) { var item = new FusionChartsItem(); item.AddPropertyValue("color", "AFD8F8"); item.AddPropertyValue("name", checkout.Fecha.ToDisplayDateTime().ToString("HH:mm")); item.AddPropertyValue("value", checkout.Cantidad.ToString(CultureInfo.InvariantCulture)); helper.AddItem(item); } return(helper.BuildXml()); } }
/// <summary> /// Generates the Headers of the grid grouping them by EstadoLogistico /// </summary> /// <param name="source"></param> private void GenerateColumnsHeaders(DataTable source) { var prog = FormatHeader(CultureManager.GetLabel("TIME_PROGRAMMED")); var man = FormatHeader(CultureManager.GetLabel("TIME_MANUAL")); var auto = FormatHeader(CultureManager.GetLabel("TIME_AUTOMATIC")); const string column = "<td class='column'>{0}</td>"; var data = @"<div style='text-align: center;'>{0}</div><table class='datatable header'><tr>"; if (chkProgramado.Checked) { data += string.Format(column, prog); } if (chkManual.Checked) { data += string.Format(column, man); } if (chkAuto.Checked) { data += string.Format(column, auto); } data += @"</tr></table>"; for (var i = _PRIMER_ESTADO; i < source.Columns.Count; i += 3) { source.Columns[i].ColumnName = string.Format(data, source.Columns[i].ColumnName); } }