/// <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 ShowTotalCount(int count) { var text = string.Format(CultureManager.GetControl("GRID_CANT_RESULTADOS"), count); if (Grid.AllowCustomPaging && Grid.VirtualItemCount > 0) { text = text + " de un total de " + Grid.VirtualItemCount; } var litTop = new Label { Text = text }; litTop.Style.Add("float", "left"); var litBottom = new Label { Text = text }; litBottom.Style.Add("float", "left"); if (Grid.TopPagerRow != null) { Grid.TopPagerRow.Cells[0].Controls.AddAt(0, litTop); } if (Grid.BottomPagerRow != null) { Grid.BottomPagerRow.Cells[0].Controls.AddAt(0, litBottom); } }
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()); }
private static string BuildRouteCode(DateTime date, int vehicleId, int vechicleTypeId, int logisticCycleTypeId, int distritoId, int baseId) { var daoF = new DAOFactory(); var patente = vehicleId >= 0 ? daoF.CocheDAO.FindById(vehicleId).Patente : CultureManager.GetControl("DDL_NONE"); var tipoCoche = vechicleTypeId >= 0 ? daoF.TipoCocheDAO.FindById(vechicleTypeId).Codigo : CultureManager.GetControl("DDL_NONE"); var tipoCiclo = logisticCycleTypeId >= 0 ? daoF.TipoCicloLogisticoDAO.FindById(logisticCycleTypeId).Codigo : CultureManager.GetControl("DDL_NONE"); //YYYYMMDD_DOMINIO_TIPO_CICLO_{N} var routeCode = string.Format("{0}_{1}_{2}", date.ToString("yyyyMMdd"), patente, tipoCiclo); var cantViajes = daoF.ViajeDistribucionDAO.FindByCodeLike(distritoId, baseId, routeCode).Count(); if (cantViajes > 0) { routeCode += "_" + cantViajes; } return(routeCode); }
/// <summary> /// Adds the delete action button to the toolbar. /// </summary> public void AddDeleteToolbarButton() { AddControls(new ToolBarButton { ID = ToolBarButtonDeleteId, SkinID = "Delete", CommandName = ButtonCommandNameDelete, Text = CultureManager.GetControl("BUTTON_DELETE"), OnClientClick = "return confirm('" + CultureManager.GetSystemMessage("CONFIRM_OPERATION") + "');" }); }
public GridUtils(C1GridView grid, IGridded <T> page) { Grid = grid; Page = page; Grid.Sorting += Grid_Sorting; Grid.ColumnMoving += Grid_ColumnMoving; Grid.ColumnMoved += Grid_ColumnMoved; Grid.PageIndexChanging += Grid_PageIndexChanging; Grid.GroupColumnMoving += Grid_GroupColumnMoving; Grid.GroupColumnMoved += Grid_GroupColumnMoved; Grid.GroupAggregate += Grid_GroupAggregate; Grid.RowDataBound += Grid_RowDataBound; Grid.SelectedIndexChanging += Grid_SelectedIndexChanging; Grid.RowCommand += Grid_RowCommand; GenerateDataKeyNames(); Grid.PageSize = Page.PageSize; Grid.EmptyDataText = CultureManager.GetError("NO_MATCHES_FOUND"); Grid.GroupByCaption = CultureManager.GetControl("GRID_GROUPBY_CAPTION"); }
/// <summary> /// Adds the Cancel action button to the toolbar. /// </summary> public void AddCancelToolbarButton() { AddControls(new ToolBarButton { ID = ToolBarButtonCancelId, SkinID = "Cancel", CommandName = ButtonCommandNameCancel, Text = CultureManager.GetControl("BUTTON_ANULAR") }); }
/// <summary> /// Adds the Regenerate action button to the toolbar. /// </summary> public void AddRegenerateToolbarButton() { AddControls(new ToolBarButton { ID = ToolbarButtonRegenerateId, SkinID = "Regenerate", CommandName = ButtonCommandNameRegenerate, Text = CultureManager.GetControl("BUTTON_REGENERATE"), OnClientClick = "return confirm('" + CultureManager.GetSystemMessage("TICKET_REGENERATE_CONFIRM") + "');" }); }
/// <summary> /// Adds the SendReport action button to the toolbar. /// </summary> public void AddSendReportButton() { AddControls(new ToolBarButton { ID = ToolBarButtonSendReportId, SkinID = "SendReport", CommandName = ButtonCommandNameSendReport, Text = CultureManager.GetControl("BUTTON_SENDREPORT") }); }
/// <summary> /// Adds the Schedule action button to the toolbar. /// </summary> public void AddScheduleButton() { AddControls(new ToolBarButton { ID = ToolBarButtonScheduleId, SkinID = "Schedule", CommandName = ButtonCommandNameSchedule, Text = CultureManager.GetControl("BUTTON_SCHEDULE") }); }
/// <summary> /// Adds the csv action button to the toolbar. /// </summary> public void AddExcelToolbarButton() { AddControls(new ToolBarButton { ID = ToolbarButtonExcelId, SkinID = "Excel", CommandName = ButtonCommandNameExcel, Text = CultureManager.GetControl("BUTTON_EXCEL") }); }
/// <summary> /// Adds the csv action button to the toolbar. /// </summary> public void AddCsvToolbarButton() { AddControls(new ToolBarButton { ID = ToolbarButtonCsvId, SkinID = "CSV", CommandName = ButtonCommandNameCsv, Text = CultureManager.GetControl("BUTTON_CSV") }); }
/// <summary> /// Adds the new action button to the toolbar. /// </summary> public void AddNewToolbarButton() { AddControls(new ToolBarButton { ID = ToolBarButtonNewId, SkinID = "New", CommandName = ButtonCommandNameNew, Text = CultureManager.GetControl("BUTTON_NEW") }); }
/// <summary> /// Adds the show map action button to the toolbar. /// </summary> public void AddMapToolbarButton() { AddControls(new ToolBarButton { ID = ToolBarButtonMapId, SkinID = "Map", CommandName = ButtonCommandNameView, Text = CultureManager.GetControl("BUTTON_MAP") }); }
/// <summary> /// Adds the open action button to the toolbar. /// </summary> public void AddListToolbarButton() { AddControls(new ToolBarButton { ID = ToolBarButtonListId, SkinID = "List", CommandName = ButtonCommandNameOpen, Text = CultureManager.GetControl("BUTTON_LIST") }); }
protected void ShowMensaje(LogMensaje mensaje) { var iconDir = IconDir; var color = mensaje.Accion != null ? Color.FromArgb(100, mensaje.Accion.Red, mensaje.Accion.Green, mensaje.Accion.Blue) : Color.Gray; panelTitle.BackColor = color; panelTitle.ForeColor = color.GetBrightness() < 40 ? Color.White: Color.Black; if (mensaje.Accion != null && mensaje.Accion.PopIcon > 0) { imgAccion.ImageUrl = string.Format("{0}/{1}", iconDir, mensaje.Accion.PopUpIcon.PathIcono); } else { imgAccion.Visible = false; } lbMensaje.Text = mensaje.Texto; lblHora.Text = mensaje.Fecha.ToDisplayDateTime().ToString("dd/MM/yyyy HH:mm"); lblRecepcion.Text = mensaje.FechaAlta.HasValue ? "(" + mensaje.FechaAlta.Value.ToDisplayDateTime().ToString("dd/MM/yyyy HH:mm") + ")" : string.Empty; var pos = mensaje.Fecha; var link = string.Format( "../Monitor/MonitorHistorico/monitorHistorico.aspx?Planta={0}&TypeMobile={1}&Movil={2}&InitialDate={3}&FinalDate={4}&ShowMessages=0&ShowPOIS=0&Empresa={5}", mensaje.Coche.Linea != null ? mensaje.Coche.Linea.Id : -1, mensaje.Coche.TipoCoche.Id, mensaje.Coche.Id, pos.Subtract(TimeSpan.FromMinutes(15)).ToString(CultureInfo.InvariantCulture), pos.Add(TimeSpan.FromMinutes(1)).ToString(CultureInfo.InvariantCulture), mensaje.Coche.Empresa != null ? mensaje.Coche.Empresa.Id : mensaje.Coche.Linea != null ? mensaje.Coche.Linea.Empresa.Id : -1); lbMensaje.OnClientClick = string.Format("window.open('{0}', '" + CultureManager.GetMenu("OPE_MON_HISTORICO") + "')", link); lblMovil.Text = mensaje.Coche.Interno; var imgMovl = string.Format("{0}/{1}", iconDir, mensaje.Coche.TipoCoche.IconoNormal.PathIcono); imgMovil.ImageUrl = imgMovl; var chofer = mensaje.Chofer ?? mensaje.Coche.Chofer; lblChofer.Text = chofer != null ? string.Format("{0} - {1}", chofer.Legajo, chofer.Entidad.Descripcion) : CultureManager.GetString("Labels", "SIN_CHOFER"); lblDireccion.Text = GeocoderHelper.GetDescripcionEsquinaMasCercana(mensaje.Latitud, mensaje.Longitud); lblLatitud.Text = mensaje.Latitud.ToString(CultureInfo.InvariantCulture); lblLongitud.Text = mensaje.Longitud.ToString(CultureInfo.InvariantCulture); Monitor1.ImgPath = Config.Monitor.GetMonitorImagesFolder(this); Monitor1.GoogleMapsScript = GoogleMapsKey; Monitor1.EnableTimer = false; Monitor1.AddLayers(LayerFactory.GetGoogleStreet(CultureManager.GetLabel("LAYER_GSTREET"), 8), //LayerFactory.GetCompumap(CultureManager.GetLabel("LAYER_COMPUMAP"), Config.Map.CompumapTiles, 8), LayerFactory.GetOpenStreetMap(CultureManager.GetLabel("LAYER_OSM")), LayerFactory.GetGoogleSatellite(CultureManager.GetLabel("LAYER_GSAT"), 8), LayerFactory.GetGoogleHybrid(CultureManager.GetLabel("LAYER_GHIBRIDO"), 8), LayerFactory.GetGooglePhysical(CultureManager.GetLabel("LAYER_GFISICO"), 8), LayerFactory.GetMarkers(LayerVehiculos, true)); Monitor1.AddControls(ControlFactory.GetLayerSwitcher(), ControlFactory.GetNavigation()); Monitor1.SetCenter(mensaje.Latitud, mensaje.Longitud, 7); Monitor1.AddMarkers(LayerVehiculos, MarkerFactory.CreateMarker(mensaje.Coche.Id.ToString("#0"), imgMovl, mensaje.Latitud, mensaje.Longitud)); var empresa = mensaje.Coche.Empresa; var linea = mensaje.Coche.Linea; var user = WebSecurity.AuthenticatedUser != null?DAOFactory.UsuarioDAO.FindById(WebSecurity.AuthenticatedUser.Id) : null; var mensajes = DAOFactory.MensajeDAO.FindByTipo(null, empresa, linea, user); var messages = mensajes.Where(m => m.TipoMensaje.DeAtencion).OrderBy(m => m.Descripcion); cbMensaje.ClearItems(); cbMensaje.AddItem(CultureManager.GetControl("DDL_NO_MESSAGE"), cbMensaje.NoneValue); foreach (var msg in messages) { cbMensaje.AddItem(msg.Descripcion, msg.Id); } if (mensaje.Estado > 0) { btAceptar.Visible = false; btIgnorar.ImageUrl = "~/Operacion/btAtras.gif"; var atencion = DAOFactory.AtencionEventoDAO.GetByEvento(mensaje.Id); if (atencion != null) { panelUsuario.Visible = true; lblUsuario.Text = atencion.Usuario.NombreUsuario; panelFecha.Visible = true; lblFecha.Text = atencion.Fecha.ToDisplayDateTime().ToString("dd/MM/yyyy HH:mm"); cbMensaje.SetSelectedValue(atencion.Mensaje.Id); cbMensaje.Enabled = false; txtObservacion.Text = atencion.Observacion; txtObservacion.Enabled = false; } } if (!WebSecurity.IsSecuredAllowed(Securables.EventAttention)) { btAceptar.Visible = false; btIgnorar.ImageUrl = "~/Operacion/btAtras.gif"; } }
/// <summary> /// Adds the save action button to the toolbar. /// </summary> public void AddSaveToolbarButton() { AddControls(new ToolBarButton { ID = ToolBarButtonSaveId, SkinID = "Save", CommandName = ButtonCommandNameSave, Text = CultureManager.GetControl("BUTTON_SAVE") }); }
/// <summary> /// Adds the duplicate action button to the toolbar. /// </summary> public void AddDuplicateToolbarButton() { AddControls(new ToolBarButton { ID = ToolBarButtonDuplicateId, SkinID = "Duplicate", CommandName = ButtonCommandNameDuplicate, Text = CultureManager.GetControl("BUTTON_DUPLICATE") }); }
/// <summary> /// Adds the print action button to the toolbar. /// </summary> public void AddPrintToolbarButton() { AddControls(new ToolBarButton { ID = ToolBarButtonPrintId, SkinID = "Print", CommandName = ButtonCommandNamePrint, Text = CultureManager.GetControl("BUTTON_PRINT") }); }
/// <summary> /// Adds the import action button to the toolbar. /// </summary> public void AddImportToolbarButton() { AddControls(new ToolBarButton { ID = ToolBarButtonImportId, SkinID = "Import", CommandName = ButtonCommandNameImport, Text = CultureManager.GetControl("BUTTON_IMPORT") }); }
/// <summary> /// Adds the Start action button to the toolbar. /// </summary> public void AddStartToolbarButton() { AddControls(new ToolBarButton { ID = ToolBarButtonStartId, SkinID = "Start", CommandName = ButtonCommandNameStart, Text = CultureManager.GetControl("BUTTON_START_TICKETS"), OnClientClick = "return confirm('" + CultureManager.GetSystemMessage("TICKET_START_CONFIRM") + "');" }); }
/// <summary> /// Adds a edit button to the toolbar. /// </summary> public void AddEditToolbarButton() { AddControls(new ToolBarButton { ID = ToolBarButtonEditId, SkinID = "Edit", CommandName = ButtonCommandNameEdit, Text = CultureManager.GetControl("BUTTON_EDIT") }); }
public void AddEventToolBarButton() { AddControls(new ToolBarButton { ID = ToolBarButtonEventId, SkinID = "Event", CommandName = ButtonCommandNameEvent, Text = CultureManager.GetControl("BUTTON_EVENT") }); }