Commit inicial Ventas Productivo
This commit is contained in:
117
Contratos/RepContratosSuministros.aspx.vb
Normal file
117
Contratos/RepContratosSuministros.aspx.vb
Normal file
@@ -0,0 +1,117 @@
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class Contratos_RepContratosSuministros
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "P R O P I E D A D E S"
|
||||
Private Property DtDatos As DataTable
|
||||
Get
|
||||
DtDatos = DirectCast(ViewState("DtDatos"), DataTable)
|
||||
End Get
|
||||
|
||||
Set(ByVal value As DataTable)
|
||||
ViewState("DtDatos") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property TCEspecifico As Double
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
txtFechaI.Text = Now.FirstDayOfMonth.ToShortDateString
|
||||
txtFechaF.Text = Now.LastDayOfMonth.ToShortDateString
|
||||
|
||||
CargaDatos()
|
||||
|
||||
CargaContratos()
|
||||
CargaEstatus()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjContratos As New ClsContratos
|
||||
If ObjContratos.GetContratosSuministros(DdlContratos.SelectedValue.ToEntero, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, DdlEstatus.SelectedValue.ToEntero, DdlTipo.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
DtDatos = ObjContratos.DtResultados
|
||||
GvDatos.DataSource = ObjContratos.DtResultados
|
||||
GvDatos.DataBind()
|
||||
End If
|
||||
UPDatos.Update()
|
||||
End Sub
|
||||
|
||||
#Region "C O M B O S"
|
||||
Public Sub CargaContratos()
|
||||
DdlContratos.DataSource = GlobalDTContratos().FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa}")
|
||||
DdlContratos.DataBind()
|
||||
End Sub
|
||||
|
||||
|
||||
Public Sub CargaEstatus()
|
||||
Dim ObjContratos As New ClsContratos
|
||||
If ObjContratos.GetContratosEstatus(UsuarioActual.CveEmpresa) Then
|
||||
DdlEstatus.DataSource = ObjContratos.DtResultados
|
||||
DdlEstatus.DataBind()
|
||||
End If
|
||||
ObjContratos.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "R E P O R T E S"
|
||||
Private Sub GenerarPDF(Optional Formato As String = "PDF")
|
||||
|
||||
Dim FechaI = $" <b>Fecha Inicio: </b> {txtFechaI.Text}"
|
||||
Dim FechaF = $" <b>Fecha Fin: </b> {txtFechaF.Text}"
|
||||
Dim Contrato = $" <b>Contrato: </b> {DdlContratos.SelectedItem.Text}"
|
||||
Dim Estatus = $" <b>Estatus: </b> {DdlEstatus.SelectedItem.Text}"
|
||||
Dim Tipo = $" <b>Tipo: </b> {DdlTipo.SelectedItem.Text}"
|
||||
|
||||
|
||||
If txtFechaI.Text = "" Then FechaI = "-1"
|
||||
If txtFechaF.Text = "" Then FechaF = "-1"
|
||||
|
||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
|
||||
Dim params As New List(Of ReportParameter)
|
||||
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
'params.Add(New ReportParameter("FechaInicio", FechaI))
|
||||
'params.Add(New ReportParameter("FechaFin", FechaF))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
'params.Add(New ReportParameter("Contrato", Contrato.Text))
|
||||
|
||||
params.Add(New ReportParameter("AgrupadoPor", $"{FechaI}{FechaF}{Contrato}{Estatus}{Tipo}"))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepContratosSuministros.rdlc", DtDatos, params, "ReporteContratosSuministros", Formato)
|
||||
|
||||
End Sub
|
||||
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs)
|
||||
GenerarPDF("Excel")
|
||||
End Sub
|
||||
Protected Sub ImgImprimir_Click(sender As Object, e As EventArgs)
|
||||
GenerarPDF()
|
||||
End Sub
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("SerieFolio").Contains("Total") Then
|
||||
e.Row.CssClass = "Totales"
|
||||
e.Row.Cells(0).Controls.RemoveAt(0)
|
||||
e.Row.Cells(0).Text = e.Row.DBCampo("SerieFolio")
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user