Commit inicial Ventas Productivo
This commit is contained in:
145
ZDG/RepMunicipios.aspx.vb
Normal file
145
ZDG/RepMunicipios.aspx.vb
Normal file
@@ -0,0 +1,145 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Partial Class ZDG_RepMunicipios
|
||||
Inherits ClsPaginas
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
SetValues()
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
#Region " SET VALUES "
|
||||
Private Sub SetValues()
|
||||
|
||||
'CargaMunicipios
|
||||
Dim ObjDG As New ClsDG
|
||||
If ObjDG.GetMunicipios() Then
|
||||
DdlMunicipio.DataSource = ObjDG.DtResultados
|
||||
Else
|
||||
DdlMunicipio.DataSource = Nothing
|
||||
End If
|
||||
ObjDG.Dispose()
|
||||
DdlMunicipio.DataBind()
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " CARGA DATOS "
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click
|
||||
CargaDatos()
|
||||
UPDatos.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjDG As New ClsDG
|
||||
|
||||
If ObjDG.GetRepMunicipios(DdlMunicipio.SelectedValue.ToEntero) Then
|
||||
GvDatos.DataSource = ObjDG.DtResultados
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjDG.Dispose()
|
||||
GvDatos.DataBind()
|
||||
|
||||
If (GvDatos.Rows.Count > 0) Then
|
||||
GvDatos.UseAccessibleHeader = True
|
||||
GvDatos.HeaderRow.TableSection = TableRowSection.TableHeader
|
||||
RegistraScript("OrdenarGV();")
|
||||
End If
|
||||
|
||||
'GvDatos.Columns(9).Visible = False
|
||||
GvDatos.Columns(11).Visible = False
|
||||
|
||||
UPDatos.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " GV DATOS "
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
'CType(e.Row.FindControl("DivVentajaPorcentaje"), HtmlContainerControl).Attributes.Add("style", String.Format("height: 15px;background-color:cornflowerblue;float:left;width:{0}%;", e.Row.DBCampo("VentajaVotosPorcentaje")))
|
||||
CType(e.Row.FindControl("DivAvancePorcentaje"), HtmlContainerControl).Attributes.Add("style", String.Format("height:25px;background-color:cornflowerblue;float:left;width:{0}%;", e.Row.DBCampo("Avance")))
|
||||
|
||||
'CType(e.Row.FindControl("DivVentaja"), HtmlContainerControl).Attributes.Add("style", String.Format("height:25px;background-color:{0};width:100%;", If(e.Row.DBCampo("VentajaVotosPorcentaje").ToDecimal > 0, "cornflowerblue", If(e.Row.DBCampo("VentajaVotosPorcentaje").ToDecimal = 0, "", "crimson"))))
|
||||
|
||||
If e.Row.DBCampo("VentajaVotosPorcentaje").ToDecimal < 0 Then
|
||||
e.Row.Cells(8).BackColor = Drawing.Color.Crimson
|
||||
e.Row.Cells(9).BackColor = Drawing.Color.Crimson
|
||||
|
||||
e.Row.Cells(8).ForeColor = Drawing.Color.White
|
||||
e.Row.Cells(8).CssClass = "white"
|
||||
e.Row.Cells(9).ForeColor = Drawing.Color.White
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("Municipio") = " Total" Then
|
||||
e.Row.CssClass = "SubTotales2 sinlink"
|
||||
e.Row.Font.Italic = True
|
||||
e.Row.Attributes.Add("style", "background:#CCCCCC !important")
|
||||
Else
|
||||
Dim Liga = String.Format("/ZDG/RepMunicipiosCoordinadores.aspx?CM={0}", e.Row.DBCampo("CveMunicipio"))
|
||||
|
||||
e.Row.FCHyperLink("HLMunicipio").NavigateUrl = Liga
|
||||
e.Row.FCHyperLink("HLPadron").NavigateUrl = Liga
|
||||
e.Row.FCHyperLink("HLVotos").NavigateUrl = Liga
|
||||
e.Row.FCHyperLink("HLVotosPorcentaje").NavigateUrl = Liga
|
||||
e.Row.FCHyperLink("HLVotos1").NavigateUrl = Liga
|
||||
e.Row.FCHyperLink("HLVotos2").NavigateUrl = Liga
|
||||
e.Row.FCHyperLink("HLVotos3").NavigateUrl = Liga
|
||||
e.Row.FCHyperLink("HLVotos4").NavigateUrl = Liga
|
||||
e.Row.FCHyperLink("HLVentajaVotos").NavigateUrl = Liga
|
||||
e.Row.FCHyperLink("HLFaltanVotar").NavigateUrl = Liga
|
||||
e.Row.FCHyperLink("HLAsignados").NavigateUrl = Liga
|
||||
|
||||
End If
|
||||
|
||||
|
||||
'e.Row.FCHyperLink("HLPadron").NavigateUrl = String.Format("/ZDG/RepMunicipiosSeguimiento.aspx?CM={0}&CV={1}&CT={2}", e.Row.DBCampo("CveMunicipio"), -1, -1)
|
||||
'e.Row.FCHyperLink("HLVotos").NavigateUrl = String.Format("/ZDG/RepMunicipiosSeguimiento.aspx?CM={0}&CV={1}&CT={2}", e.Row.DBCampo("CveMunicipio"), 1, -1)
|
||||
'e.Row.FCHyperLink("HLVotos1").NavigateUrl = String.Format("/ZDG/RepMunicipiosSeguimiento.aspx?CM={0}&CV={1}&CT={2}", e.Row.DBCampo("CveMunicipio"), 1, 1)
|
||||
'e.Row.FCHyperLink("HLVotos2").NavigateUrl = String.Format("/ZDG/RepMunicipiosSeguimiento.aspx?CM={0}&CV={1}&CT={2}", e.Row.DBCampo("CveMunicipio"), 1, 2)
|
||||
'e.Row.FCHyperLink("HLVotos3").NavigateUrl = String.Format("/ZDG/RepMunicipiosSeguimiento.aspx?CM={0}&CV={1}&CT={2}", e.Row.DBCampo("CveMunicipio"), 1, 3)
|
||||
'e.Row.FCHyperLink("HLVotos4").NavigateUrl = String.Format("/ZDG/RepMunicipiosSeguimiento.aspx?CM={0}&CV={1}&CT={2}", e.Row.DBCampo("CveMunicipio"), 1, 4)
|
||||
'e.Row.FCHyperLink("HLFaltanVotar").NavigateUrl = String.Format("/ZDG/RepMunicipiosSeguimiento.aspx?CM={0}&CV={1}&CT={2}", e.Row.DBCampo("CveMunicipio"), 0, 1)
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " SELECTED INDEX CHANGED "
|
||||
Protected Sub DdlMunicipio_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
CargaDatos()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
Protected Sub ImgExcel_Click(sender As Object, e As System.EventArgs) Handles ImgExcel.Click
|
||||
GvDatos.Columns(9).Visible = True
|
||||
GvDatos.Columns(10).Visible = False
|
||||
GvDatos.Columns(11).Visible = True
|
||||
GvDatos.Columns(12).Visible = False
|
||||
|
||||
GvDatos.ExportToExcel("ReporteMunicipios")
|
||||
|
||||
GvDatos.Columns(9).Visible = False
|
||||
'GvDatos.Columns(10).Visible = True
|
||||
GvDatos.Columns(11).Visible = False
|
||||
GvDatos.Columns(12).Visible = True
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user