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 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; } }
private void AddNoDetailsScript() { var interno = GridUtils.GetCell(Grid.SelectedRow, MobilePositionVehicleVo.IndexVehiculoId).Text; var noDetailsScript = string.Format(string.Concat("alert('", CultureManager.GetSystemMessage("NO_POSITIONS_MOBILE"), "');"), interno); ScriptManager.RegisterStartupScript(this, typeof(string), "NoDetails", noDetailsScript, true); }
/// <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 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 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 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")); }
//private bool StartDistribucion(int id) //{ // var distribucion = DAOFactory.ViajeDistribucionDAO.FindById(id); // if (distribucion.Estado != ViajeDistribucion.Estados.Pendiente) return false; // var ciclo = new CicloLogisticoDistribucion(distribucion, DAOFactory, new MessageSaver(DAOFactory)); // IEvent evento = new InitEvent(DateTime.UtcNow); // ciclo.ProcessEvent(evento); // return true; //} protected void BtIniciarClick(object sender, EventArgs e) { mpePanel.Hide(); if (TicketToInitId.Get() <= 0) { return; } var ticket = DAOFactory.ViajeDistribucionDAO.FindById(TicketToInitId.Get()); TicketToInitId.Set(-1); var ciclo = new CicloLogisticoDistribucion(ticket, DAOFactory, new MessageSaver(DAOFactory)); var evento = new InitEvent(DateTime.UtcNow); try { ciclo.ProcessEvent(evento); ShowInfo(CultureManager.GetSystemMessage("CLOG_START_SENT") + ticket.Vehiculo.Interno); Bind(); } catch (NoVehicleException) { ShowError(new ApplicationException(CultureManager.GetError("TICKET_NO_VEHICLE_ASSIGNED"))); } catch //AlreadyOpenException, QueueException, Exception { ShowError(new ApplicationException(CultureManager.GetError("CLOG_MESSAGE_NOT_SENT") + ticket.Vehiculo.Interno)); } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (EditMode && EditObject.Estado == Ticket.Estados.Anulado) { var text = CultureManager.GetSystemMessage("TICKET_ANULADO_USER_DAY_REASON"); var user = EditObject.UsuarioAnulacion != null ? EditObject.UsuarioAnulacion.NombreUsuario : " "; var fecha = EditObject.FechaAnulacion.HasValue ? EditObject.FechaAnulacion.Value.ToDisplayDateTime().ToString("dd/MM/yyyy HH:mm") : " "; var motivo = EditObject.MotivoAnulacion; ShowInfo(string.Format(text, string.Concat("<b>", user, "</b>"), string.Concat("<b>", fecha, "</b>"), string.Concat("<b>", motivo, "</b>"))); } if (IsPostBack) { return; } if (!EditMode) { dtFecha.SetDate(); } BindEstados(); lblOrdenDiarioText.Visible = lblOrdenDiario.Visible = EditMode; }
private void SendMessage(string cmd, string par) { if (cbSubEntidadMensaje.SelectedIndex < 0) { JsAlert(string.Format(CultureManager.GetError("NO_SELECTED"), CultureManager.GetEntity("PARENTI81"))); return; } var ok = 0; var error = 0; var sent = string.Empty; var failed = string.Empty; foreach (ListItem li in cbSubEntidadMensaje.Items) { if (!li.Selected) { continue; } var c = DAOFactory.SubEntidadDAO.FindById(Convert.ToInt32(li.Value)); if (c.Sensor == null || c.Sensor.Dispositivo == null) { JsAlert(string.Format(CultureManager.GetSystemMessage("UNASIGNED_VEHICLE"), c.Descripcion)); continue; } var dispositivo = c.Sensor.Dispositivo; var message = M2mMessageSender.Create(dispositivo, new M2mMessageSaver(DAOFactory)).AddCommand(cmd); var cfgValue = par.Equals("On") ? "true" : "false"; message.AddConfigParameter("DigitalOutput1", cfgValue, 0); var sendState = message.Send(); if (sendState) { ok++; sent += "\\n" + li.Text; } else { error++; failed += "\\n" + li.Text; } } if (ok > 0) { JsAlert(string.Format(CultureManager.GetSystemMessage("MESSAGE_SENT"), sent)); } if (error > 0) { JsAlert(string.Format(CultureManager.GetError("MESSAGE_NOT_SENT"), failed)); } }
/// <summary> /// Gets report data and generates the chart. /// </summary> protected void DoSearch() { ReportObjectsList = GetResults(); Graph.Visible = ReportObjectsList.Count > 0; if (NotFound != null) { NotFound.Text = !Graph.Visible ? CultureManager.GetSystemMessage("NO_RESULT_FOR_CURRENT_FILTERS") : null; } }
/// <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") + "');" }); }
/// <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")); }
/// <summary> /// Duplicates the current object being edited. /// </summary> protected void Duplicate() { Id = 0; if (_editobj != null) { _editobj.Id = 0; } UpdateToolbar(); ShowInfo(CultureManager.GetSystemMessage("DUPLICATED_ELEMENT")); OnDuplicate(); }
/// <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 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> /// Exports the report into a csv file. /// </summary> protected override void ExportToCsv() { var builder = new BaseCsvBuilder(Usuario.CsvSeparator); GenerateCsvHeader(builder); GenerateStadisticsColumns(builder); GenerateMaximumSpeedColumns(builder); GenerateOperatorsColumns(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 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")); }
/// <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")); }
/// <summary> /// Displays the givenn fragment in the historic monitor or alerts if the time span is too big. /// </summary> /// <param name="salida"></param> /// <param name="entrada"></param> private void ShowRouteDetails(string salida, string entrada) { var from = Convert.ToDateTime(salida); var to = Convert.ToDateTime(entrada); if (to.Subtract(from).TotalHours > 24) { ShowErrorPopup(CultureManager.GetSystemMessage("ROUTE_TOO_LONG")); return; } AddSessionParameters(to, from); ifResumenViaje.Visible = true; }
protected void btIniciar_Click(object sender, EventArgs e) { mpePanel.Hide(); if (TicketToInitId.Get() <= 0) { return; } var date = dtHora.SelectedDate; if (!date.HasValue) { ThrowMustEnter("FECHA"); } var ticket = DAOFactory.TicketDAO.FindById(TicketToInitId.Get()); TicketToInitId.Set(-1); SetStartDate(ticket, SecurityExtensions.ToDataBaseDateTime(date.Value)); var messageSaver = new MessageSaver(DAOFactory); var ciclo = new CicloLogisticoHormigon(ticket, DAOFactory, messageSaver); var evento = new InitEvent(DateTime.UtcNow); try { ciclo.ProcessEvent(evento); ShowInfo(CultureManager.GetSystemMessage("CLOG_START_SENT") + ticket.Vehiculo.Interno); Bind(); if (TieneDocumentosVencidos.Get()) { messageSaver.Save(MessageCode.CicloLogisticoIniciadoDocumentosInvalidos.GetMessageCode(), ticket.Vehiculo, evento.Date.AddSeconds(1), null, string.Empty); } } catch (NoVehicleException) { ShowError(new ApplicationException(CultureManager.GetError("TICKET_NO_VEHICLE_ASSIGNED"))); } catch //AlreadyOpenException, QueueException, Exception { ShowError(new ApplicationException(CultureManager.GetError("CLOG_MESSAGE_NOT_SENT") + ticket.Vehiculo.Interno)); } }
protected override void Regenerate() { if (EditObject.Vehiculo == null) { ThrowMustEnter("Entities", "PARENTI03"); } var ticket = DAOFactory.TicketDAO.FindById(EditObject.Id); var ciclo = new CicloLogisticoHormigon(ticket, DAOFactory, null /*new MessageSaver(DAOFactory)*/); ciclo.Regenerate(); ShowInfo(CultureManager.GetSystemMessage("TCIKET_REGENERATE_DONE")); Bind(); updRefreshTabGeneral.Update(); updRefreshTabDetalles.Update(); }
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 override void ExportToCsv() { var builder = new BaseCsvBuilder(Usuario.CsvSeparator); GenerateCsvHeader(builder); GenerateColumns(builder); GenerateFields(builder); builder.GenerateRow(string.Empty); builder.GenerateRow(CultureManager.GetLabel("TOTALES")); builder.GenerateRow(string.Format(CultureManager.GetLabel("PONDERACION_GRAVES_RANKING"), TransportistasGraves)); builder.GenerateRow(string.Format(CultureManager.GetLabel("PONDERACION_MEDIAS_RANKING"), TransportistasMedios)); builder.GenerateRow(string.Format(CultureManager.GetLabel("PONDERACION_LEVES_RANKING"), TransportistasLeves)); SetCsvSessionVars(builder.Build()); OpenWin(string.Concat(ApplicationPath, "Common/exportCSV.aspx"), CultureManager.GetSystemMessage("EXPORT_CSV_DATA")); }
/// <summary> /// Shows the selected route fragment in the historic monitor or aletrs of any error situation. /// </summary> private void ShowSelectedRouteDetails() { var salida = GridUtils.GetCell(Grid.SelectedRow, MobileTourVo.IndexSalida).Text + ' ' + GridUtils.GetCell(Grid.SelectedRow, MobileTourVo.IndexSalidaHora).Text; var entrada = GridUtils.GetCell(Grid.SelectedRow, MobileTourVo.IndexEntrada).Text + ' ' + GridUtils.GetCell(Grid.SelectedRow, MobileTourVo.IndexEntradaHora).Text; try { Convert.ToDateTime(salida); Convert.ToDateTime(entrada); } catch { ShowErrorPopup(CultureManager.GetSystemMessage("NO_GEOCERCA_INFO")); return; } ShowRouteDetails(salida, entrada); }
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")); }
/// <summary> /// Override for generating the grid using a DataSet (not the GetResult method) as DataSource. /// </summary> protected override void Bind() { if (lbMobiles.SelectedValues.Count.Equals(0)) { LblInfo.Text = CultureManager.GetError("MUST_SELECT_MOBILE"); return; } Grid.AllowColMoving = false; Grid.AllowGrouping = false; InitializeDictionaries(); var src = ReportFactory.TicketReportDAO.GetTicketsTimeDifferencesByDateAndMobiles(lbMobiles.SelectedValues, dpDesde.SelectedDate.GetValueOrDefault().ToDataBaseDateTime(), dpHasta.SelectedDate.GetValueOrDefault().ToDataBaseDateTime(), ddlPlanta.Selected); if (src.Tables.Count.Equals(0)) { LblInfo.Text = CultureManager.GetSystemMessage(NoResultForCurrentFilters); LblInfo.Visible = true; return; } var source = src.Tables[0]; GenerateGridWidth(source); GenerateColumnsHeaders(source); Bind(source); HideIdColumns(); FormatGridColumns(); GenerateSubtotalsGrid(); }
/// <summary> /// Exports the Grid to CSV. /// Cuidado con esto porque rebindea la grilla sacandole el paging. /// </summary> protected virtual void ExportToCsv() { var builder = new GridToCSVBuilder(Usuario.CsvSeparator); var g = Grid; var allowPaging = Grid.AllowPaging; g.AllowPaging = false; g.DataSource = Data; g.DataBind(); GenerateCsvHeader(builder); builder.GenerateColumns(/*null, */ 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 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"); }
private void Edit(int idEntrada, int idSalida) { popupEdit.Show(); ResetFilters(); ResetEditFilters(); txtEditEmpleados.Enabled = true; if (idEntrada > 0) { var entrada = DAOFactory.EventoAccesoDAO.FindById(idEntrada); txtEditEmpleados.Selected = entrada.Empleado.Id; txtEditEmpleados.Text = entrada.Empleado.Entidad.Descripcion; cbEditPuertaEntrada.SetSelectedValue(entrada.Puerta.Id); dtEditHoraEntrada.SelectedDate = entrada.Fecha.ToDisplayDateTime(); txtEditEmpleados.Enabled = false; } else { cbEditPuertaEntrada.SetSelectedValue(cbEditPuertaEntrada.NoneValue); dtEditHoraEntrada.SelectedDate = null; } if (idSalida > 0) { var salida = DAOFactory.EventoAccesoDAO.FindById(idSalida); txtEditEmpleados.Selected = salida.Empleado.Id; txtEditEmpleados.Text = salida.Empleado.Entidad.Descripcion; cbEditPuertaSalida.SetSelectedValue(salida.Puerta.Id); dtEditHoraSalida.SelectedDate = salida.Fecha.ToDisplayDateTime(); txtEditEmpleados.Enabled = false; } else { cbEditPuertaSalida.SetSelectedValue(cbEditPuertaEntrada.NoneValue); dtEditHoraSalida.SelectedDate = null; } btAceptar.CommandArgument = idEntrada + ":" + idSalida; btAceptar.OnClientClick = string.Format("return confirm(\"{0}\");", CultureManager.GetSystemMessage("CONFIRM_OPERATION")); }