-fluctuacion
This commit is contained in:
@@ -4653,7 +4653,11 @@ Public Class ClsContabilidad
|
||||
Retorno = SqlAdapter.SelectCommand.Parameters("@CveCuenta").Value.ToString.ToEntero
|
||||
'Retorno = If(Data IsNot Nothing AndAlso Data.Rows.Count > 0, Data.Rows(0)("CveCuenta").ToString.ToEntero, 0)
|
||||
Catch Ex1 As SqlException
|
||||
Me.OnError("Ocurrió un error al Guardar la cuenta.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
If Ex1.Message.Contains("IND_Conta_Cuentas_Codigo_CveEmpresa") Then
|
||||
Me.OnError("No se puede registrar una cuenta ya existente", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
Else
|
||||
Me.OnError("Ocurrió un error al Guardar la cuenta.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Me.OnError("Ocurrió un error al Guardar la cuenta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
@@ -121,7 +121,39 @@ Public Class ClsGPS
|
||||
Public Sub Commit()
|
||||
SqlTransacc.Commit()
|
||||
End Sub
|
||||
#Region "Arrastre"
|
||||
|
||||
Public Function GPS_ArrastreGET(CveDispositivo As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_GPS_ArrastreGET")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
addParameters("@CveDispositivo", SqlDbType.Int, CveDispositivo)
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener los datos de Arrastre", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
Public Function GPS_ArrastreActivarDesactivar(CveDispositivo As Integer, ArrastreActivo As Boolean) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_GPS_ArrastreActivarDesactivar")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
addParameters("@CveDispositivo", SqlDbType.Int, CveDispositivo)
|
||||
addParameters("@ArrastreActivo", SqlDbType.Bit, ArrastreActivo)
|
||||
End With
|
||||
Try
|
||||
Dataset = New DataSet()
|
||||
SqlAdapter.Fill(Dataset)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al activar o desactivar la alerta de Arrastre", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
#End Region
|
||||
Public Function GetTemperatura(CveDispositivo As Integer, CveSensor As Integer, strFechaInicio As String, strFechaFin As String, CveUsuario As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_GPS_TramaData")
|
||||
|
||||
@@ -3482,6 +3482,8 @@ Public Class ClsPaginas
|
||||
PaginaDict = New System.Collections.Hashtable
|
||||
|
||||
PaginaDict.Add("/Inicio.aspx".ToUpper(), -1)
|
||||
PaginaDict.Add("/reporteador.aspx".ToUpper(), -1)
|
||||
PaginaDict.Add("/GPS/RepArrastre.aspx".ToUpper(), -1)
|
||||
PaginaDict.Add("/Ventas/RepConciliacionEmitidosSat.aspx".ToUpper(), -1)
|
||||
PaginaDict.Add("/Ventas/RepConciliacionSat.aspx".ToUpper(), 716)
|
||||
PaginaDict.Add("/Ventas/SolicitudesSAT.aspx".ToUpper(), 717)
|
||||
|
||||
217
GPS/RepArrastre.aspx
Normal file
217
GPS/RepArrastre.aspx
Normal file
@@ -0,0 +1,217 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepArrastre.aspx.cs" Inherits="GPS_RepArrastre" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
#map {
|
||||
height: 450px;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte de Arrastre
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkApagarvehiculo" runat="server">Apagar vehiculo</asp:LinkButton>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="">
|
||||
<div class="portlet-title portlet-filterT smalltitle" style="">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" Text="Consultar" class="btn btn-primary" />
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
<div class="row">
|
||||
<div class="col-md-1 truncate">
|
||||
Vehiculo:
|
||||
</div>
|
||||
<div class="col-md-3 ">
|
||||
<asp:DropDownList ID="DdlDispositivo" runat="server" DataTextField="NombreVehiculo" DataValueField="CveDispositivo" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none;">
|
||||
<asp:HiddenField ID="HdfVGrafica" ClientIDMode="Static" runat="server" />
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpInfo" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="portlet-title">
|
||||
</div>
|
||||
<div class="portlet light smmallpadding traspasorow bordered" style="">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-red">
|
||||
<i class="fa fa-clock-o font-red"></i>
|
||||
<span class="caption-subject bold uppercase">datos vehiculo</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
|
||||
</div>
|
||||
</div>
|
||||
<div id="C_bodyreportes" class="portlet-body rowpadding">
|
||||
<asp:TextBox ID="TxtFunciones" CssClass="hidden EvalRun" runat="server"></asp:TextBox>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<label style="font-weight: bold;">¿Activar funcion de arrastre?</label>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:CheckBox ID="chkActivarArrastre" CssClass="chksino " AutoPostBack="true" OnCheckedChanged="chkActivarArrastre_CheckedChanged" Text=" " runat="server" />
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<label style="font-weight: bold;">Velocidad</label>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:Label ID="LblVelocidad" runat="server" Text="Sin Información"></asp:Label>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<label style="font-weight: bold;">¿Encendido / Apagado?</label>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:Label ID="LblEncApa" runat="server" Text="Sin Información"></asp:Label>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<label style="font-weight: bold;">Fecha ultima Conexion</label>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:Label ID="LblFechaInfo" runat="server" Text="Sin Información"></asp:Label>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="map">
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAF7s8wwhzCVXDUYopc9mXxqaWB33cDro4&libraries=places"></script>
|
||||
<script>
|
||||
var image = '/Imagenes/rsz_11rsz_car.png';
|
||||
var geocoder;
|
||||
var map;
|
||||
var markerArrastre;
|
||||
var markerActual;
|
||||
var directionsService;
|
||||
var directionsDisplay;
|
||||
var polylinesRoute = [];
|
||||
var directionsDisplayArray = [];
|
||||
|
||||
var retorno;
|
||||
function setCenter(myLatLn) {
|
||||
map.setCenter(myLatLn);
|
||||
}
|
||||
function addmarkerarrastre(myLatLn) {//myLatLn = { lat: -25.363, lng: 131.044 }
|
||||
if (markerArrastre) {
|
||||
markerArrastre.setMap(null);
|
||||
}
|
||||
markerArrastre = new google.maps.Marker({
|
||||
position: myLatLn,
|
||||
map: map,
|
||||
title: 'Estacionado'
|
||||
});
|
||||
}
|
||||
|
||||
function addmarkerActual(myLatLn,Encencido) {//myLatLn = { lat: -25.363, lng: 131.044 } ,addmarkerActual({ lat: -25.363, lng: 131.044 })
|
||||
|
||||
var imagen = Encencido ==1? '/Imagenes/rsz_11rsz_cargreen.png' :'/Imagenes/rsz_11rsz_car.png';
|
||||
var markerIcon = { url: imagen, labelOrigin: new google.maps.Point(26, 43) };
|
||||
if (markerActual) {
|
||||
markerActual.setMap(null);
|
||||
}
|
||||
markerActual = new google.maps.Marker({
|
||||
position: myLatLn,
|
||||
map: map,
|
||||
title: 'Posición Actual',
|
||||
icon: markerIcon
|
||||
});
|
||||
}
|
||||
function initMap() {
|
||||
map = new google.maps.Map(document.getElementById('map'), {
|
||||
center: { lat: 29.0628417, lng: -110.9872448 },
|
||||
zoom: 13
|
||||
|
||||
});
|
||||
//var ShowDiv1 = document.createElement('div');
|
||||
//var ShowDivControl = new ShowDiv(ShowDiv1, map);
|
||||
|
||||
|
||||
//ShowDiv1.index = 1;
|
||||
//ShowDiv1.id = "showdiv1"
|
||||
|
||||
//map.controls[google.maps.ControlPosition.BOTTOM_CENTER].push(ShowDiv1);
|
||||
|
||||
|
||||
//var upControlDiv = document.createElement('div');
|
||||
//var upControl = new ControlLabels(upControlDiv, map);
|
||||
|
||||
//upControlDiv.index = 1;
|
||||
//map.controls[google.maps.ControlPosition.TOP_LEFT].push(upControlDiv);
|
||||
|
||||
//var upGeoDiv = document.createElement('div');
|
||||
//var upGeo = new ControlGeocercas(upGeoDiv, map);
|
||||
|
||||
//map.controls[google.maps.ControlPosition.TOP_LEFT].push(upGeoDiv);
|
||||
|
||||
geocoder = new google.maps.Geocoder();
|
||||
|
||||
//google.maps.event.addListener(map, "click", function (event) {
|
||||
// closeLastOpenedInfoWindow();
|
||||
//});
|
||||
|
||||
directionsService = new google.maps.DirectionsService;
|
||||
directionsDisplay = new google.maps.DirectionsRenderer;
|
||||
directionsDisplay.setOptions({ suppressMarkers: true });
|
||||
directionsDisplay.setMap(map);
|
||||
}
|
||||
|
||||
|
||||
function ADSBegin() {
|
||||
eval($('.EvalRun').val());
|
||||
}
|
||||
initMap();
|
||||
//$(document).ready(function () {
|
||||
|
||||
// initMap();
|
||||
//});
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
98
GPS/RepArrastre.aspx.cs
Normal file
98
GPS/RepArrastre.aspx.cs
Normal file
@@ -0,0 +1,98 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using Extensiones;
|
||||
|
||||
public partial class GPS_RepArrastre : ClsPaginas
|
||||
{
|
||||
|
||||
public int CveDispositivo
|
||||
{
|
||||
get
|
||||
{
|
||||
if (ViewState["CveDispositivo"] != null)
|
||||
{
|
||||
return ViewState["CveDispositivo"].ToString().ToEntero();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
set { ViewState["CveDispositivo"] = value; }
|
||||
}
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
// fijo borrar
|
||||
DdlDispositivo.DataSource = get_GlobalDTDispositivosUsuarios(263965, 1928) ;
|
||||
//DdlDispositivo.DataSource = get_GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario) ;
|
||||
DdlDispositivo.DataBind();
|
||||
getArrastre();
|
||||
}
|
||||
|
||||
}
|
||||
private void getArrastre()
|
||||
{
|
||||
CveDispositivo = DdlDispositivo.SelectedValue.ToEntero();
|
||||
using (ClsGPS objgps = new ClsGPS())
|
||||
{
|
||||
if (objgps.GPS_ArrastreGET(CveDispositivo) && objgps.DtResultados.Rows.Count > 0)
|
||||
{
|
||||
DataRow dtrow = objgps.DtResultados.Rows[0];
|
||||
upInfo(dtrow);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public void upInfo(DataRow dtrow)
|
||||
{
|
||||
if ( dtrow != null)
|
||||
{
|
||||
LblVelocidad.Text = $"{dtrow["Speed"]:N0}";
|
||||
LblEncApa.Text = $"{dtrow["EncendidoText"]}";
|
||||
LblFechaInfo.Text = $"{dtrow["FechaTrama"]:dd/MM/yyyy}";
|
||||
//LblVelocidad.Text = $"{dtrow[""]}";
|
||||
//LblVelocidad.Text = $"{dtrow[""]}";addmarkerActual({ lat: -25.363, lng: 131.044 })
|
||||
string pVehiculo = string.Format("{{ lat: {0}, lng: {1}}}", dtrow["Lat"], dtrow["Lng"]);
|
||||
string parrastre = string.Format("{{ lat: {0}, lng: {1}}}", dtrow["LatArrastre"], dtrow["LngArrastre"]);
|
||||
TxtFunciones.Text = string.Format("addmarkerActual({0},{3}){1};setCenter({2})", pVehiculo, (dtrow["ArrastreActivo"].ToString() == "1" ? $" ;addmarkerarrastre({parrastre})" : ";addmarkerarrastre()"), (dtrow["ArrastreActivo"].ToString() == "1" ? parrastre : pVehiculo), dtrow["Encendido"].ToString().ToEntero());
|
||||
UpInfo.Update();
|
||||
}
|
||||
}
|
||||
|
||||
protected void BtnConsultar_Click(object sender, EventArgs e)
|
||||
{
|
||||
getArrastre();
|
||||
}
|
||||
|
||||
protected void chkActivarArrastre_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
using (ClsGPS objgps = new ClsGPS())
|
||||
{
|
||||
if (objgps.GPS_ArrastreActivarDesactivar(CveDispositivo, chkActivarArrastre.Checked)){
|
||||
|
||||
if (objgps.GPS_ArrastreGET(CveDispositivo) && objgps.DtResultados.Rows.Count > 0)
|
||||
{
|
||||
DataRow dtrow = objgps.DtResultados.Rows[0];
|
||||
upInfo(dtrow);
|
||||
}
|
||||
if (chkActivarArrastre.Checked)
|
||||
{
|
||||
Alert("se ha activado la funcion de arrastre");
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert("se ha desactivado la funcion de arrastre");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 12 KiB |
@@ -55,7 +55,8 @@ Partial Class Inicio
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
If UsuarioActual.CveUsuario = 100 Then
|
||||
'Reporte de ventas sin registrar sig
|
||||
If UsuarioActual.TienePermisoProceso(287) Then
|
||||
|
||||
Using objgral As New ClsGenerales
|
||||
objgral.RepConciliacionSatDetalleGET(UsuarioActual.CveEmpresa, "I", "", "", 10)
|
||||
@@ -67,7 +68,8 @@ Partial Class Inicio
|
||||
End Using
|
||||
GvFoliosSAT.DataBind()
|
||||
End If
|
||||
If UsuarioActual.CveUsuario = 100 Then
|
||||
'Reporte de ventas pendientes de cancelar
|
||||
If UsuarioActual.TienePermisoProceso(288) Then
|
||||
Using objventas As New ClsVentas
|
||||
If (GetFacturasCanceladasPendientesWS(objventas, UsuarioActual.Empresa.RFC, UsuarioActual.CveEmpresa, False)) AndAlso objventas.DtResultados.Rows.Count > 0 Then
|
||||
RegistraScript("$('#ModalMitotereCancelaPendiente').modal();", "mitoterosatCanceladasPendientesWS")
|
||||
|
||||
@@ -30,28 +30,6 @@ public partial class Ventas_RepConciliacionSat : ClsPaginas
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
|
||||
//CrystalDecisions.CrystalReports.Engine.ReportDocument cryRpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
|
||||
//cryRpt.Load(String.Format("C:\\Proyectos\\wwwSIG\\Empresas\\Grales\\Formatos\\CatPS.rpt", UsuarioActual.Empresa.Ruta));
|
||||
//System.Data.DataTable DtDatos = new System.Data.DataTable();
|
||||
//using (ClsProductosServicios ObjPS = new ClsProductosServicios())
|
||||
//{
|
||||
// if (ObjPS.GetPSLite(-1, 119, "-1", "-1", "02541", -1, -1, -1, -1))
|
||||
// {
|
||||
// DtDatos = ObjPS.DtResultados;
|
||||
|
||||
// }
|
||||
//}
|
||||
//cryRpt.SetDataSource(DtDatos);
|
||||
//CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo coninfo = new CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo();
|
||||
//cryRpt.
|
||||
////cryRpt.SetDatabaseLogon("JCaudillo", "JCau127*953");// 293357
|
||||
//reports.ReportSource = cryRpt;
|
||||
//reports.RefreshReport();
|
||||
//// reports.Refresh();
|
||||
|
||||
|
||||
|
||||
DateTime fecha;
|
||||
DateTime fechaInicio = DateTime.Now;
|
||||
DateTime fechaFin = DateTime.Now;
|
||||
|
||||
51
reporteador.aspx
Normal file
51
reporteador.aspx
Normal file
@@ -0,0 +1,51 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="reporteador.aspx.cs" Inherits="reporteador" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<div class="row">
|
||||
<div class="col-sm-6"></div>
|
||||
<div class="col-sm-6 text-right">
|
||||
<asp:LinkButton ID="LnkImprime" CssClass="btn btn-primary " OnClick="LnkImprime_Click" runat="server" >Imprime reporte</asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
<asp:UpdatePanel ID="upDatosRepC" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GVParametros" runat="server" GridLines="None" CssClass=" Widthall GVParametros" AutoGenerateColumns="False"
|
||||
DataKeyNames="Name,EnableNullValue" OnRowDataBound="GVParametros_RowDataBound">
|
||||
<Columns>
|
||||
|
||||
<asp:TemplateField HeaderText="Campo">
|
||||
<ItemTemplate>
|
||||
<asp:Label runat="server" Text='<%# Eval("Name")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Valor">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtValor" CssClass="form-control" runat="server" ></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="No Enviar">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="ChkIsNull" runat="server" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<%--<CR:CrystalReportViewer ID="reports" runat="server" AutoDataBind="true"></CR:CrystalReportViewer>--%>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
70
reporteador.aspx.cs
Normal file
70
reporteador.aspx.cs
Normal file
@@ -0,0 +1,70 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using Extensiones;
|
||||
|
||||
|
||||
public partial class reporteador : ClsPaginas
|
||||
{
|
||||
public string rutaArchivo
|
||||
{
|
||||
get
|
||||
{
|
||||
return ViewState["rutaArchivo"].ToString();
|
||||
}
|
||||
set { ViewState["rutaArchivo"] = value; }
|
||||
}
|
||||
protected void Page_PreInit(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
rutaArchivo = Server.MapPath("~/Empresas/Grales/Formatos/CatPS.rpt");
|
||||
CrystalDecisions.CrystalReports.Engine.ReportDocument cryRpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
|
||||
cryRpt.Load(rutaArchivo);
|
||||
GVParametros.DataSource = cryRpt.DataDefinition.ParameterFields;
|
||||
GVParametros.DataBind();
|
||||
}
|
||||
}
|
||||
|
||||
protected void GVParametros_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
CrystalDecisions.Shared.ParameterValues defaultValues = ((CrystalDecisions.CrystalReports.Engine.ParameterFieldDefinition)e.Row.DataItem).DefaultValues;
|
||||
if (defaultValues.Count > 0)
|
||||
{
|
||||
e.Row.FCTextBox("TxtValor").Text = defaultValues[0].Description;
|
||||
}
|
||||
//CrystalDecisions.Shared.ParameterValues. DefaultValues
|
||||
}
|
||||
}
|
||||
|
||||
protected void LnkImprime_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
string Formato = "PDF";
|
||||
List<CrystalParametro> lista = new List<CrystalParametro>();
|
||||
CrystalDecisions.CrystalReports.Engine.ReportDocument cryRpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
|
||||
cryRpt.Load(rutaArchivo);
|
||||
foreach (GridViewRow gvRow in GVParametros.Rows)
|
||||
{
|
||||
if (gvRow.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
lista.Add(new CrystalParametro(gvRow.DataKey("Name"), gvRow.FCTextBox("TxtValor").Text));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
ImprimirbytesPDF(ImprimirPDFCrystal(rutaArchivo, (new System.Data.DataTable()), lista, "Productos y Servicios", Formato), "Productos y Servicios", Formato);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user