Commit inicial Ventas Productivo
This commit is contained in:
138
Bancos/RepComprobaciones.aspx.cs
Normal file
138
Bancos/RepComprobaciones.aspx.cs
Normal file
@@ -0,0 +1,138 @@
|
||||
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;
|
||||
using Microsoft.Reporting.WebForms;
|
||||
|
||||
public partial class Bancos_RepComprobaciones : ClsPaginas
|
||||
{
|
||||
#region "P R O P I E D A D E S"
|
||||
private DataTable DTDatos
|
||||
{
|
||||
get
|
||||
{
|
||||
return (DataTable)ViewState["DTDatos"];
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
ViewState["DTDatos"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
InicializaDatos();
|
||||
}
|
||||
}
|
||||
|
||||
#region "C A R G A D A T O S"
|
||||
protected void InicializaDatos()
|
||||
{
|
||||
TxtFechaInicio.Text = DateTime.Today.AddDays(-30).ToString();
|
||||
TxtFechaFin.Text = DateTime.Today.ToString();
|
||||
|
||||
CargaCuentas();
|
||||
CargaDatos();
|
||||
}
|
||||
protected void CargaDatos()
|
||||
{
|
||||
ClsBancos ObjBanco = new ClsBancos();
|
||||
|
||||
int CveCuenta = DdlCuentas.SelectedValue.ToEntero();
|
||||
DateTime FechaI = Convert.ToDateTime(TxtFechaInicio.Text);
|
||||
DateTime FechaF = Convert.ToDateTime(TxtFechaFin.Text);
|
||||
|
||||
if (ObjBanco.GetComprobacionesRep(CveCuenta, FechaI, FechaF, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
DTDatos = ObjBanco.DtResultados;
|
||||
GvDatos.DataSource = DTDatos;
|
||||
}
|
||||
ObjBanco.Dispose();
|
||||
GvDatos.DataBind();
|
||||
UPDatos.Update();
|
||||
}
|
||||
protected void CargaCuentas()
|
||||
{
|
||||
DdlCuentas.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("Banco = 'Empresa'");
|
||||
DdlCuentas.DataBind();
|
||||
DdlCuentas.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
||||
DdlCuentas.SelectedValue = "-1";
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region "PDF"
|
||||
private void GenerarPDF(string Formato = "PDF")
|
||||
{
|
||||
List<ReportParameter> @params = new List<ReportParameter>();
|
||||
|
||||
System.IO.FileInfo Imagen = new System.IO.FileInfo(string.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta));
|
||||
var logouri = string.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa);
|
||||
|
||||
@params.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa));
|
||||
@params.Add(new ReportParameter("FechaInicio", TxtFechaInicio.Text));
|
||||
@params.Add(new ReportParameter("FechaFin", TxtFechaFin.Text));
|
||||
@params.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
|
||||
@params.Add(new ReportParameter("FechaImpresion", DateTime.Now.ToString()));
|
||||
@params.Add(new ReportParameter("Cuenta", DdlCuentas.SelectedItem.Text));
|
||||
|
||||
if (Imagen.Exists)
|
||||
{
|
||||
@params.Add(new ReportParameter("LogoPath", logouri));
|
||||
}
|
||||
else
|
||||
{
|
||||
@params.Add(new ReportParameter("LogoPath", ""));
|
||||
}
|
||||
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepComprobaciones.rdlc", DTDatos, @params, "ReporteComprobaciones", Formato);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region"B O T O N E S"
|
||||
protected void BtnConsultar_Click(object sender, EventArgs e)
|
||||
{
|
||||
CargaDatos();
|
||||
}
|
||||
|
||||
protected void GvDatos_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
if (String.IsNullOrEmpty(e.Row.DBCampo("CveCompra")))
|
||||
{
|
||||
e.Row.CssClass = "Totales";
|
||||
e.Row.FCHyperLink("HypAgrupador").ForeColor = System.Drawing.Color.White;
|
||||
e.Row.FCHyperLink("HypAgrupador").NavigateUrl = string.Format("/Bancos/IE.aspx?CveIE={0}", e.Row.DBCampo("CveIEDevolucion"));
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Row.FCHyperLink("HypAgrupador").NavigateUrl = string.Format("/Compras/Proveedores.aspx?CveProveedor={0}", e.Row.DBCampo("CveProveedor"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void ImgImprimirPDF_Click(object sender, EventArgs e)
|
||||
{
|
||||
GenerarPDF();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region EXCEL
|
||||
protected void ImgExcel_Click(object sender, EventArgs e)
|
||||
{
|
||||
GenerarPDF("EXCEL");
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user