protected override void ExportToCsv() { var builder = new GridToCSVBuilder(Usuario.CsvSeparator); var g = gridResumen; var allowPaging = gridResumen.AllowPaging; var distribuciones = GetDistribuciones(new[] { -1 }); var controladas = distribuciones.Where(d => d.Controlado).Select(d => new ViajeDistribucionVo(d)).ToList(); g.AllowPaging = false; g.DataSource = controladas; g.DataBind(); builder.GenerateHeader(CultureManager.GetMenu(VariableName), GetFilterValues()); builder.GenerateColumns(g); builder.GenerateFields(g); Session["CSV_EXPORT"] = builder.Build(); Session["CSV_FILE_NAME"] = CultureManager.GetMenu(Module.Name); OpenWin(String.Concat(ApplicationPath, "Common/exportCSV.aspx"), CultureManager.GetSystemMessage("EXPORT_CSV_DATA")); g.AllowPaging = allowPaging; }
protected override void ExportToCsv() { var csv = new GridToCSVBuilder(Usuario.CsvSeparator); csv.GenerateHeader(CultureManager.GetMenu(VariableName), GetFilterValues()); var g = Grid; var allowPaging = Grid.AllowPaging; g.AllowPaging = false; Bind(); GenerateCSVColumns(csv); GenerateCSVSubColumns(csv); GenerateCSVFields(csv); SetCsvSessionVars(csv.Build()); OpenWin(string.Concat(ApplicationPath, "Common/exportCSV.aspx"), CultureManager.GetSystemMessage("EXPORT_CSV_DATA")); g.AllowPaging = allowPaging; }
protected override void ExportToCsv() { var builder = new GridToCSVBuilder(Usuario.CsvSeparator); var g = Grid; g.AllowPaging = false; g.DataSource = GetResults(); g.DataBind(); builder.GenerateHeader(CultureManager.GetMenu("COMB_CONSISTENCIA_STOCK"), GetFilterValues()); builder.GenerateColumns(/*new List<string>(),*/ g); builder.GenerateFields(g); builder.GenerateColumns(/*null, */ gridSubTotales); builder.GenerateFields(gridSubTotales); SetCsvSessionVars(builder.Build()); OpenWin(string.Concat(ApplicationPath, "Common/exportCSV.aspx"), CultureManager.GetSystemMessage("EXPORT_CSV_DATA")); g.AllowPaging = true; }
protected override void ExportToExcel() { var path = HttpContext.Current.Request.Url.AbsolutePath; path = Path.GetFileNameWithoutExtension(path) + ".xlsx"; var builder = new GridToExcelBuilder(path, Usuario.ExcelFolder); var list = GetExcelItemList(); if (list.Count > 5000) { ShowInfo(CultureManager.GetLabel("EXCEL_DEMASIADOS_MENSAJES")); return; } builder.GenerateHeader(CultureManager.GetMenu(VariableName), GetFilterValues()); builder.AddExcelItemList(list); var results = GetMixedReportResults(); builder.GenerateColumns(results); builder.GenerateFields(results); SetExcelSessionVars(builder.CloseAndSave()); OpenWin(String.Concat(ApplicationPath, "Common/exportExcel.aspx"), CultureManager.GetSystemMessage("EXPORT_CSV_DATA")); }
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"); } } } }
protected override void SelectedIndexChanged() { AddSessionParametersForDetail(Convert.ToInt32(Grid.DataKeys[Grid.SelectedIndex][OperatorRankingVo.KeyIndexIdOperador])); OpenWin("infractionsDetails.aspx", CultureManager.GetMenu("DETALLE_DE_INFRACCIONES")); foreach (C1GridViewRow row in Grid.Rows) { GridUtils.GetCell(row, OperatorRankingVo.IndexPuntaje).BackColor = GetColor(Convert.ToDouble(GridUtils.GetCell(row, OperatorRankingVo.IndexPuntaje).Text)); } }
/// <summary> /// Exports the Grid to CSV. /// Cuidado con esto porque rebindea la grilla sacandole el paging. /// </summary> protected override void ExportToCsv() { var builder = new GridToCSVBuilder(Usuario.CsvSeparator); builder.GenerateHeader(CultureManager.GetMenu("COMB_REMITOS"), GetFilterValues()); GenerateCSVBody(builder); SetCsvSessionVars(builder.Build()); OpenWin(string.Concat(ApplicationPath, "Common/exportCSV.aspx"), CultureManager.GetSystemMessage("EXPORT_CSV_DATA")); }
private void GenerateCsvHeader(BaseCsvBuilder builder) { var param = new Dictionary <string, string> { { CultureManager.GetEntity("PARENTI01"), ddlDistrito.SelectedItem.Text }, { CultureManager.GetEntity("PARENTI02"), GetSelectedBases() } }; builder.GenerateHeader(CultureManager.GetMenu("ACC_RANKING_TRANSPORTISTAS"), param, dpDesde.SelectedDate.GetValueOrDefault(), dpHasta.SelectedDate.GetValueOrDefault()); }
/// <summary> /// Initial report binding. /// </summary> /// <param name="e"></param> protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (!IsPostBack) { Bind(); } Title = CultureManager.GetMenu("DOP_VERI_DETAILS"); }
/// <summary> /// Exports the Grid to CSV. /// Cuidado con esto porque rebindea la grilla sacandole el paging. /// </summary> protected override void ExportToCsv() { var builder = new GridToCSVBuilder(Usuario.CsvSeparator); builder.GenerateHeader(CultureManager.GetMenu("COMB_INGRESOS_POZO"), GetFilterValues()); GenerateCSVBody(builder); Session["CSV_EXPORT"] = builder.Build(); Session["CSV_FILE_NAME"] = "report"; OpenWin(string.Concat(ApplicationPath, "Common/exportCSV.aspx"), CultureManager.GetSystemMessage("EXPORT_CSV_DATA")); }
protected override Dictionary <string, string> GetFilterValues() { return(new Dictionary <string, string> { { CultureManager.GetEntity("PARENTI01"), ddlDistrito.Selected > 0 ? DAOFactory.EmpresaDAO.FindById(ddlDistrito.Selected).RazonSocial : null }, { CultureManager.GetEntity("PARENTI02"), ddlBase.Selected > 0? DAOFactory.LineaDAO.FindById(ddlBase.Selected).DescripcionCorta: null }, { CultureManager.GetMenu("PAR_POI"), ddlGeoRef.Selected > 0 ? DAOFactory.ReferenciaGeograficaDAO.FindById(ddlGeoRef.Selected).Descripcion : null }, { CultureManager.GetLabel("DISTANCIA"), npDistancia.Number.ToString("#0") }, { CultureManager.GetLabel("DESDE"), dpDesde.SelectedDate.Value.ToShortDateString() + " " + dpDesde.SelectedDate.Value.ToShortTimeString() }, { CultureManager.GetLabel("HASTA"), dpHasta.SelectedDate.Value.ToShortDateString() + " " + dpHasta.SelectedDate.Value.ToShortTimeString() } }); }
private void GenerateColumns(BaseCsvBuilder builder) { builder.GenerateRow(String.Concat(CultureManager.GetEntity("PARENTI07"), Separator, CultureManager.GetMenu("PAR_VEHICULOS"), Separator, CultureManager.GetLabel("KILOMETROS"), Separator, CultureManager.GetLabel("MOVIMIENTO"), Separator, CultureManager.GetLabel("PUNTAJE"), Separator, CultureManager.GetLabel("LEVES"), Separator, CultureManager.GetLabel("MEDIAS"), Separator, CultureManager.GetLabel("GRAVES"), Separator, CultureManager.GetLabel("TOTALES"), Separator)); }
protected override void ExportToCsv() { var separator = Usuario.CsvSeparator; var sb = new StringBuilder(); sb.Append(GetLine(CultureManager.GetMenu(ToolBar.VariableName))); sb.Append(GetLine(DateTime.UtcNow.ToDisplayDateTime().ToString("dd/MM/yyyy HH:mm"))); sb.Append(GetLine()); sb.Append(GetLine(CultureManager.GetEntity("PARENTI01"), cbEmpresa.SelectedItem.Text)); sb.Append(GetLine(CultureManager.GetEntity("PARENTI02"), cbLinea.SelectedItem.Text)); sb.Append(GetLine(CultureManager.GetEntity("BOCADECARGA"), cbBocaDeCarga.SelectedItem.Text)); sb.Append(GetLine(CultureManager.GetEntity("PARENTI63"), cbProducto.SelectedItem.Text)); sb.Append(GetLine(CultureManager.GetLabel("DIA"), dtDia.SelectedDate.Value.ToString("dd/MM/yyyy"))); sb.Append(GetLine(CultureManager.GetLabel("PROGRAMACION_CARGA_MAXIMA"), txtCargaMaxima.Text)); sb.Append(GetLine(CultureManager.GetLabel("PROGRAMACION_CANTIDAD_MIXERS"), txtCantidadMixers.Text)); sb.Append(GetLine()); var bocas = cbBocaDeCarga.Selected > 0 ? new List <BocaDeCarga> { DAOFactory.BocaDeCargaDAO.FindById(cbBocaDeCarga.Selected) } : DAOFactory.BocaDeCargaDAO.GetList(new[] { cbEmpresa.Selected }, new[] { cbLinea.Selected }); var inicio = bocas.Min(boca => GetInicioActividad(boca)); var fin = bocas.Max(boca => GetFinActividad(boca)); sb.Append(string.Join(separator.ToString(), CsvHeader)); for (var i = inicio; i <= fin; i = i.Add(TimeSpan.FromHours(1))) { sb.Append(string.Concat(separator, FormatTimeSpan(i))); } sb.Append(GetLine()); foreach (RepeaterItem r in repPedidos.Items) { var item = new RepeaterItemPedido(r); if (r.ItemType != ListItemType.Item && r.ItemType != ListItemType.AlternatingItem) { continue; } sb.Append(GetLine(string.Join(separator.ToString(), item.GetCsvLine()))); } sb.Append((string)hidCsvFooter.Value); sb.Append(GetLine()); Session["CSV_EXPORT"] = sb.ToString(); Session["CSV_FILE_NAME"] = "programacion"; OpenWin(string.Concat(ApplicationPath, "Common/exportCSV.aspx"), CultureManager.GetSystemMessage("EXPORT_CSV_DATA")); }
/// <summary> /// Generates the Header With Report Filters. /// </summary> /// <param name="builder"></param> private void GenerateCsvHeader(BaseCsvBuilder builder) { var param = 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.ToString() }, { CultureManager.GetLabel("HASTA"), dpHasta.SelectedDate.ToString() } }; builder.GenerateHeader(CultureManager.GetMenu("STAT_RESUMEN_VEHICULAR"), param); }
protected override void ExportToCsv() { var builder = new GridToCSVBuilder(Usuario.CsvSeparator); BtnSearchClick(null, null); builder.GenerateHeader(CultureManager.GetMenu(VariableName), GetFilterValues()); builder.GenerateColumns(gridViajes); builder.GenerateFields(gridViajes); SetCsvSessionVars(builder.Build()); OpenWin(String.Concat(ApplicationPath, "Common/exportCSV.aspx"), CultureManager.GetSystemMessage("EXPORT_CSV_DATA")); }
protected override void SelectedIndexChanged() { var patente = Grid.Rows[Grid.SelectedIndex].Cells[KilometrosDiariosVo.IndexPatente].Text; var coche = DAOFactory.CocheDAO.FindByPatente(ddlLocation.Selected, patente); if (coche != null) { Session.Add("RouteLocation", coche.Empresa.Id); Session.Add("RouteCompany", coche.Linea != null ? coche.Linea.Id : 0); Session.Add("RouteMobile", coche.Id); OpenWin("MobileRoutes.aspx", CultureManager.GetMenu("STAT_RESUMEN_RUTA")); } }
/// <summary> /// Exports the Grid to CSV. /// Cuidado con esto porque rebindea la grilla sacandole el paging. /// </summary> protected override void ExportToCsv() { var builder = new GraphToCsvBuilder(Usuario.CsvSeparator); builder.GenerateHeader(CultureManager.GetMenu(VariableName), GetFilterValues()); GetGraphCategoriesAndDatasets(); builder.ExportGraph(XAxisLabel, YAxisLabel, GraphCategories, GraphDataSet); Session["CSV_EXPORT"] = builder.Build(); Session["CSV_FILE_NAME"] = "report"; OpenWin(String.Concat(ApplicationPath, "Common/exportCSV.aspx"), CultureManager.GetSystemMessage("EXPORT_CSV_DATA")); }
protected override void OnLoad(System.EventArgs e) { base.OnLoad(e); var module = Session["module_name"]; Session.Remove("module_name"); if (module != null) { var funcion = DAOFactory.FuncionDAO.FindAll().FirstOrDefault(f => f.Descripcion == module.ToString()); if (funcion != null) { lblModulo.Text = CultureManager.GetMenu(funcion.Descripcion); } } }
protected virtual void SendReportToMail() { var path = HttpContext.Current.Request.Url.AbsolutePath; path = Path.GetFileNameWithoutExtension(path) + ".xlsx"; var builder = new GridToExcelBuilder(path, Usuario.ExcelFolder); var list = GridUtils.Search(Data, SearchString); builder.GenerateHeader(CultureManager.GetMenu(VariableName), new Dictionary <string, string>()); builder.GenerateColumns(list); builder.GenerateFields(list); SetExcelSessionVars(builder.CloseAndSave()); OpenWin(String.Concat(ApplicationPath, "Common/exportExcel.aspx"), CultureManager.GetSystemMessage("EXPORT_CSV_DATA")); }
protected void DivRoute_OnClick(object sender, EventArgs e) { LoadPieChart(); LoadTable(); lnkHistorico.Visible = true; var coche = DAOFactory.CocheDAO.FindById(Convert.ToInt32((string)hidden.Value)); 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, hidDesde.Value, hidHasta.Value, 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); }
protected override void ExportToExcel() { var path = HttpContext.Current.Request.Url.AbsolutePath; path = Path.GetFileNameWithoutExtension(path) + ".xlsx"; var builder = new GridToExcelBuilder(path, Usuario.ExcelFolder); var distribuciones = GetDistribuciones(new[] { -1 }); var controladas = distribuciones.Where(d => d.Controlado).Select(d => new ViajeDistribucionVo(d)).ToList(); var list = controladas.Select(c => new ControlDistribucionVo(c)).ToList(); builder.GenerateHeader(CultureManager.GetMenu(VariableName), GetFilterValues()); builder.GenerateColumns(list); builder.GenerateFields(list); Session["TMP_FILE_NAME"] = builder.CloseAndSave(); Session["CSV_FILE_NAME"] = CultureManager.GetMenu(Module.Name); OpenWin(String.Concat(ApplicationPath, "Common/exportExcel.aspx"), CultureManager.GetSystemMessage("EXPORT_CSV_DATA")); }
protected override void ExportToExcel() { Logger.Debug("ExportToExcel start"); var path = HttpContext.Current.Request.Url.AbsolutePath; path = Path.GetFileNameWithoutExtension(path) + ".xlsx"; var builder = new GridToExcelBuilder(path, Usuario.ExcelFolder); var list = GridUtils.Search(Data, SearchString); Logger.Debug("ExportToExcel builder.GenerateHeader"); if (list.Count > 5000) { ShowInfo(CultureManager.GetLabel("EXCEL_DEMASIADOS_MENSAJES")); return; } if (list.Count == 50) { ShowInfo(CultureManager.GetLabel("EXCEL_DEMASIADOS_MENSAJES")); return; } builder.GenerateHeader(CultureManager.GetMenu(VariableName), GetFilterValues()); Logger.Debug("ExportToExcel builder.GenerateColumns"); builder.GenerateColumns(list); Logger.Debug("ExportToExcel builder.GenerateFields"); // Hay que mejorar este GenerateFields builder.GenerateFields(list, CustomExportFormat); Logger.Debug("ExportToExcel SetExcelSessionVars"); SetExcelSessionVars(builder.CloseAndSave()); OpenWin(String.Concat(ApplicationPath, "Common/exportExcel.aspx"), CultureManager.GetSystemMessage("EXPORT_CSV_DATA")); Logger.Debug("ExportToExcel end"); }
/// <summary> /// Exports the Grid to CSV. /// Cuidado con esto porque rebindea la grilla sacandole el paging. /// </summary> protected override void ExportToCsv() { var builder = new GridToCSVBuilder(Usuario.CsvSeparator); var g = Grid; var allowPaging = Grid.AllowPaging; var list = GridUtils.Search(Data, SearchString); g.AllowPaging = false; g.DataSource = list; g.DataBind(); builder.GenerateHeader(CultureManager.GetMenu(VariableName), GetFilterValues()); builder.GenerateColumns(g); builder.GenerateFields(g); SetCsvSessionVars(builder.Build()); OpenWin(String.Concat(ApplicationPath, "Common/exportCSV.aspx"), CultureManager.GetSystemMessage("EXPORT_CSV_DATA")); g.AllowPaging = allowPaging; }
protected override void ExportToCsv() { var builder = new GridToCSVBuilder(Usuario.CsvSeparator); var g = Grid; g.AllowPaging = false; g.DataSource = GetResults(); g.DataBind(); builder.GenerateHeader(CultureManager.GetMenu("COMB_CONSISTENCIA_STOCK"), GetFilterValues()); builder.GenerateColumns(/*null,*/ g); builder.GenerateFields(g); builder.GenerateColumns(/*null,*/ gridSubTotales); builder.GenerateFields(gridSubTotales); Session["CSV_EXPORT"] = builder.Build(); Session["CSV_FILE_NAME"] = "report"; g.AllowPaging = true; }
protected void SetExcelSessionVars(string filename) { Session["TMP_FILE_NAME"] = filename; Session["CSV_FILE_NAME"] = CultureManager.GetMenu(Module.Name); }
protected void SetCsvSessionVars(string csv) { Session["CSV_EXPORT"] = csv; Session["CSV_FILE_NAME"] = CultureManager.GetMenu(Module.Name); }
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; } } }
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> /// Binds all the user profile asigned groups and functions. /// </summary> private void BindItems() { var modules = from m in Usuario.Modules.Values orderby m.GroupOrder, m.Group, m.ModuleSubGroup, m.ModuleOrder select m; var lastGroupId = -1; var lastSubGroup = "$NONE$"; var groupIdx = 0; Panel panelGroup = null; Panel panelSubGroupContent = null; foreach (var module in modules) { var groupId = module.GroupId; var groupName = CultureManager.GetMenu(module.Group); if (lastGroupId != groupId) { var panel = new AccordionPane { SkinID = "Menu", Header = acpPanel.Header, Content = acpPanel.Content }; var headtext = string.Format( @"<table style='width: 100%; font-size: inherit; border-spacing: 0px; padding: 0px;'> <tr> <td style='width: 20px;'> <img src='{0}' align='absmiddle' /> </td> <td> {1} </td> </tr> </table>", ResolveUrl(string.Concat("~/", module.Group, ".image")), groupName); ((Label)panel.HeaderContainer.FindControl("lblHeader")).Text = headtext; accordion.Panes.Add(panel); panelGroup = (panel.ContentContainer.FindControl("panelContent") as Panel); if (Module != null && Module.GroupId == groupId) { accordion.SelectedIndex = groupIdx; } groupIdx++; } var subGroupName = module.ModuleSubGroup; if (lastSubGroup != subGroupName || lastGroupId != groupId) { var panelSubGroup = new Panel { CssClass = "menu_subgroup" }; panelSubGroupContent = new Panel { ID = groupId + "_" + subGroupName.Replace(' ', '_') }; if (panelGroup != null) { panelGroup.Controls.Add(panelSubGroup); } Panel subGroupTitle = null; if (!string.IsNullOrEmpty(subGroupName)) { subGroupTitle = new Panel { CssClass = "menu_subgroup_header" }; subGroupTitle.Controls.Add(new Literal { Text = CultureManager.GetMenu(subGroupName) }); subGroupTitle.Style.Add(HtmlTextWriterStyle.Cursor, "pointer"); if (Usuario.MenuStartCollapsed && !(Module != null && Module.GroupId == groupId && subGroupName == Module.ModuleSubGroup)) { panelSubGroupContent.Style.Add("display", "none"); subGroupTitle.CssClass = "menu_subgroup_header_collapsed"; } panelSubGroup.Controls.Add(subGroupTitle); } panelSubGroup.Controls.Add(panelSubGroupContent); if (!string.IsNullOrEmpty(subGroupName) && subGroupTitle != null) { var scriptClick = string.Format( @"if($get('{0}').style.display == 'none') {{ $get('{0}').style.display = ''; this.className = 'menu_subgroup_header';}} else {{$get('{0}').style.display = 'none'; this.className = 'menu_subgroup_header_collapsed';}}", panelSubGroupContent.ClientID); subGroupTitle.Attributes.Add("onclick", scriptClick); } } var outsideLink = module.Url.StartsWith("http://") || module.Url.StartsWith("https://"); var blank = outsideLink || (module.Parameters.IndexOf("_blank", StringComparison.CurrentCultureIgnoreCase) > -1); var moduleId = module.Id; var moduleName = CultureManager.GetMenu(module.Name); var modulePath = outsideLink ? module.Url : GetPath(ApplicationPath, module); var moduleImageUrl = ResolveUrl(string.Concat("~/", module.Name, ".image")); var moduleTarget = blank ? "_blank" : string.Empty; var itemClass = Module != null && Module.Id == moduleId ? "menu_item_selected" : "menu_item"; var moduleLink = new Panel { CssClass = itemClass }; moduleLink.Controls.Add(new Literal { Text = "<table style='width: 100%; font-size: inherit; border-spacing: 0px; padding: 0px;'><tr><td style='width: 20px;'>" }); moduleLink.Controls.Add(new Image { ImageUrl = moduleImageUrl, ImageAlign = ImageAlign.AbsMiddle }); moduleLink.Controls.Add(new Literal { Text = "</td><td>" }); var link = new HyperLink { Text = moduleName, NavigateUrl = modulePath, Target = moduleTarget }; link.Style.Add(HtmlTextWriterStyle.Color, "inherit"); link.Style.Add(HtmlTextWriterStyle.TextDecoration, "inherit"); //link.Style.Add(HtmlTextWriterStyle.MarginLeft, "3px"); moduleLink.Controls.Add(link); moduleLink.Controls.Add(new Literal { Text = "</td></tr></table>" }); var linkString = string.IsNullOrEmpty(moduleTarget) ? "location.href = '" + modulePath + "'; return false;" : "window.open('" + modulePath + "', '" + moduleTarget + "'); return false;"; moduleLink.Attributes.Add("onclick", linkString); if (Module != null && module.Id != Module.Id) { moduleLink.Attributes.Add("onmouseover", "this.className = 'menu_item_over'"); moduleLink.Attributes.Add("onmouseout", "this.className = '" + itemClass + "'"); } if (panelSubGroupContent != null) { panelSubGroupContent.Controls.Add(moduleLink); } lastGroupId = groupId; lastSubGroup = subGroupName; RegisterModuleForSearch(itemClass, moduleImageUrl, moduleName, modulePath, moduleTarget); } }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.cbVehiculo = new System.Windows.Forms.ComboBox(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.cbEmpresa = new System.Windows.Forms.ComboBox(); this.cbLinea = new System.Windows.Forms.ComboBox(); this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabPosicion = new System.Windows.Forms.TabPage(); this.tabMensajeria = new System.Windows.Forms.TabPage(); this.tabCicloLogistico = new System.Windows.Forms.TabPage(); this.tabGenerador = new System.Windows.Forms.TabPage(); this.tabConfig = new System.Windows.Forms.TabPage(); this.tabScheduler = new System.Windows.Forms.TabPage(); this.ucPositions1 = new HandlerTest.Controls.ucPositions(); this.ucMensajeria1 = new HandlerTest.Controls.ucMensajeria(); this.ucCiclo1 = new HandlerTest.Controls.ucCiclo(); this.ucGenerador1 = new HandlerTest.Controls.ucGenerador(); this.ucConfig1 = new HandlerTest.Controls.ucConfig(); this.ucScheduler1 = new HandlerTest.Controls.ucScheduler(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.groupBox1.SuspendLayout(); this.tabControl1.SuspendLayout(); this.tabPosicion.SuspendLayout(); this.tabMensajeria.SuspendLayout(); this.tabCicloLogistico.SuspendLayout(); this.tabGenerador.SuspendLayout(); this.tabConfig.SuspendLayout(); this.tabScheduler.SuspendLayout(); this.SuspendLayout(); // // splitContainer1 // this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; this.splitContainer1.IsSplitterFixed = true; this.splitContainer1.Location = new System.Drawing.Point(0, 0); this.splitContainer1.Name = "splitContainer1"; this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; // // splitContainer1.Panel1 // this.splitContainer1.Panel1.Controls.Add(this.groupBox2); this.splitContainer1.Panel1.Controls.Add(this.groupBox1); // // splitContainer1.Panel2 // this.splitContainer1.Panel2.Controls.Add(this.tabControl1); this.splitContainer1.Size = new System.Drawing.Size(863, 466); this.splitContainer1.SplitterDistance = 70; this.splitContainer1.TabIndex = 0; // // groupBox2 // this.groupBox2.Controls.Add(this.cbVehiculo); this.groupBox2.Location = new System.Drawing.Point(251, 0); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(246, 68); this.groupBox2.TabIndex = 15; this.groupBox2.TabStop = false; // // cbVehiculo // this.cbVehiculo.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.cbVehiculo.DisplayMember = "Interno"; this.cbVehiculo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cbVehiculo.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.cbVehiculo.FormattingEnabled = true; this.cbVehiculo.Location = new System.Drawing.Point(6, 25); this.cbVehiculo.Name = "cbVehiculo"; this.cbVehiculo.Size = new System.Drawing.Size(234, 28); this.cbVehiculo.TabIndex = 10; this.cbVehiculo.SelectedIndexChanged += new System.EventHandler(this.cbVehiculo_SelectedIndexChanged); // // groupBox1 // this.groupBox1.Controls.Add(this.cbEmpresa); this.groupBox1.Controls.Add(this.cbLinea); this.groupBox1.Location = new System.Drawing.Point(4, -1); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(239, 69); this.groupBox1.TabIndex = 14; this.groupBox1.TabStop = false; // // cbEmpresa // this.cbEmpresa.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.cbEmpresa.DisplayMember = "RazonSocial"; this.cbEmpresa.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cbEmpresa.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.cbEmpresa.FormattingEnabled = true; this.cbEmpresa.Location = new System.Drawing.Point(6, 10); this.cbEmpresa.Name = "cbEmpresa"; this.cbEmpresa.Size = new System.Drawing.Size(227, 24); this.cbEmpresa.TabIndex = 8; this.cbEmpresa.SelectedIndexChanged += new System.EventHandler(this.cbEmpresa_SelectedIndexChanged); // // cbLinea // this.cbLinea.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.cbLinea.DisplayMember = "Descripcion"; this.cbLinea.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cbLinea.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.cbLinea.FormattingEnabled = true; this.cbLinea.Location = new System.Drawing.Point(6, 39); this.cbLinea.Name = "cbLinea"; this.cbLinea.Size = new System.Drawing.Size(227, 24); this.cbLinea.TabIndex = 9; this.cbLinea.SelectedIndexChanged += new System.EventHandler(this.cbLinea_SelectedIndexChanged); // // tabControl1 // this.tabControl1.Controls.Add(this.tabPosicion); this.tabControl1.Controls.Add(this.tabMensajeria); this.tabControl1.Controls.Add(this.tabCicloLogistico); this.tabControl1.Controls.Add(this.tabScheduler); this.tabControl1.Controls.Add(this.tabGenerador); this.tabControl1.Controls.Add(this.tabConfig); this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; this.tabControl1.Location = new System.Drawing.Point(0, 0); this.tabControl1.Name = "tabControl1"; this.tabControl1.SelectedIndex = 0; this.tabControl1.Size = new System.Drawing.Size(863, 392); this.tabControl1.TabIndex = 0; // // tabPosicion // this.tabPosicion.Controls.Add(this.ucPositions1); this.tabPosicion.Location = new System.Drawing.Point(4, 22); this.tabPosicion.Name = "tabPosicion"; this.tabPosicion.Padding = new System.Windows.Forms.Padding(3); this.tabPosicion.Size = new System.Drawing.Size(855, 366); this.tabPosicion.TabIndex = 0; this.tabPosicion.Text = "Posicion"; this.tabPosicion.UseVisualStyleBackColor = true; // // tabMensajeria // this.tabMensajeria.Controls.Add(this.ucMensajeria1); this.tabMensajeria.Location = new System.Drawing.Point(4, 22); this.tabMensajeria.Name = "tabMensajeria"; this.tabMensajeria.Padding = new System.Windows.Forms.Padding(3); this.tabMensajeria.Size = new System.Drawing.Size(855, 366); this.tabMensajeria.TabIndex = 3; this.tabMensajeria.Text = "Mensajería"; this.tabMensajeria.UseVisualStyleBackColor = true; // // tabCicloLogistico // this.tabCicloLogistico.Controls.Add(this.ucCiclo1); this.tabCicloLogistico.Location = new System.Drawing.Point(4, 22); this.tabCicloLogistico.Name = "tabCicloLogistico"; this.tabCicloLogistico.Padding = new System.Windows.Forms.Padding(3); this.tabCicloLogistico.Size = new System.Drawing.Size(855, 366); this.tabCicloLogistico.TabIndex = 2; this.tabCicloLogistico.Text = CultureManager.GetMenu("SYS_CICLO_LOGISTICO"); this.tabCicloLogistico.UseVisualStyleBackColor = true; // // tabGenerador // this.tabGenerador.Controls.Add(this.ucGenerador1); this.tabGenerador.Location = new System.Drawing.Point(4, 22); this.tabGenerador.Name = "tabGenerador"; this.tabGenerador.Padding = new System.Windows.Forms.Padding(3); this.tabGenerador.Size = new System.Drawing.Size(855, 366); this.tabGenerador.TabIndex = 4; this.tabGenerador.Text = "Generador"; this.tabGenerador.UseVisualStyleBackColor = true; // // tabConfig // this.tabConfig.Controls.Add(this.ucConfig1); this.tabConfig.Location = new System.Drawing.Point(4, 22); this.tabConfig.Name = "tabConfig"; this.tabConfig.Padding = new System.Windows.Forms.Padding(3); this.tabConfig.Size = new System.Drawing.Size(855, 366); this.tabConfig.TabIndex = 1; this.tabConfig.Text = "Configuración"; this.tabConfig.UseVisualStyleBackColor = true; // // tabScheduler // this.tabScheduler.Controls.Add(this.ucScheduler1); this.tabScheduler.Location = new System.Drawing.Point(4, 22); this.tabScheduler.Name = "tabScheduler"; this.tabScheduler.Padding = new System.Windows.Forms.Padding(3); this.tabScheduler.Size = new System.Drawing.Size(855, 366); this.tabScheduler.TabIndex = 5; this.tabScheduler.Text = "Scheduler"; this.tabScheduler.UseVisualStyleBackColor = true; // // ucPositions1 // this.ucPositions1.Dock = System.Windows.Forms.DockStyle.Fill; this.ucPositions1.Location = new System.Drawing.Point(3, 3); this.ucPositions1.Name = "ucPositions1"; this.ucPositions1.Size = new System.Drawing.Size(849, 360); this.ucPositions1.TabIndex = 0; // // ucMensajeria1 // this.ucMensajeria1.Dock = System.Windows.Forms.DockStyle.Fill; this.ucMensajeria1.Location = new System.Drawing.Point(3, 3); this.ucMensajeria1.Name = "ucMensajeria1"; this.ucMensajeria1.Size = new System.Drawing.Size(849, 360); this.ucMensajeria1.TabIndex = 0; // // ucCiclo1 // this.ucCiclo1.Distribucion = null; this.ucCiclo1.Dock = System.Windows.Forms.DockStyle.Fill; this.ucCiclo1.Location = new System.Drawing.Point(3, 3); this.ucCiclo1.Name = "ucCiclo1"; this.ucCiclo1.Size = new System.Drawing.Size(849, 360); this.ucCiclo1.TabIndex = 0; // // ucGenerador1 // this.ucGenerador1.Dock = System.Windows.Forms.DockStyle.Fill; this.ucGenerador1.Location = new System.Drawing.Point(3, 3); this.ucGenerador1.Name = "ucGenerador1"; this.ucGenerador1.Size = new System.Drawing.Size(849, 360); this.ucGenerador1.TabIndex = 0; // // ucConfig1 // this.ucConfig1.Dock = System.Windows.Forms.DockStyle.Fill; this.ucConfig1.Location = new System.Drawing.Point(3, 3); this.ucConfig1.Name = "ucConfig1"; this.ucConfig1.Queue = ".\\private$\\eventos_trax"; this.ucConfig1.Size = new System.Drawing.Size(849, 360); this.ucConfig1.TabIndex = 0; // // ucScheduler1 // this.ucScheduler1.Dock = System.Windows.Forms.DockStyle.Fill; this.ucScheduler1.Location = new System.Drawing.Point(3, 3); this.ucScheduler1.Name = "ucScheduler1"; this.ucScheduler1.Size = new System.Drawing.Size(849, 360); this.ucScheduler1.TabIndex = 0; // // MainFomr // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(863, 466); this.Controls.Add(this.splitContainer1); this.Name = "MainFomr"; this.Text = "LogicTester"; this.Load += new System.EventHandler(this.MainFomr_Load); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainFomr_FormClosing); this.splitContainer1.Panel1.ResumeLayout(false); this.splitContainer1.Panel2.ResumeLayout(false); this.splitContainer1.ResumeLayout(false); this.groupBox2.ResumeLayout(false); this.groupBox1.ResumeLayout(false); this.tabControl1.ResumeLayout(false); this.tabPosicion.ResumeLayout(false); this.tabMensajeria.ResumeLayout(false); this.tabCicloLogistico.ResumeLayout(false); this.tabGenerador.ResumeLayout(false); this.tabConfig.ResumeLayout(false); this.tabScheduler.ResumeLayout(false); this.ResumeLayout(false); }