RepProgramasOperativosAvances
This commit is contained in:
154
AC/RepProgramasOperativosAvances.aspx
Normal file
154
AC/RepProgramasOperativosAvances.aspx
Normal file
@@ -0,0 +1,154 @@
|
||||
<%@ Page Title="Reporte Avance Programatico" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepProgramasOperativosAvances.aspx.vb" Inherits="AC_RepProgramasOperativosAvances" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
/* .ADScroller-header{
|
||||
|
||||
border:solid;
|
||||
border-color:#DDD;
|
||||
}*/
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
|
||||
|
||||
<li>
|
||||
<asp:HyperLink ID="HplAgregar" runat="server" NavigateUrl="/AC/ProgramaOperativo.aspx?CveProgramaOperativo=703&EsProyecto=1,&Bloqueado=1" Target="_blank" Visible="True"><i class="fa fa-plus-circle"></i> Agregar</asp:HyperLink>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LBPdf" OnClick="LBPdf_Click" runat="server"><i class="fa fa-file-pdf-o""></i> Exporta PDF</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LBExcel" OnClick="LBExcel_Click" runat="server"><i class="fa fa-file-excel-o"></i> Exporta Excel</asp:LinkButton>
|
||||
</li>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte de Avance Programatico
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="consultar" runat="server" Text="Consultar" OnClick="consultar_Click" CssClass="btn btn-Default" />
|
||||
</div>
|
||||
<div class="titlefiltros caption ">
|
||||
<div class="row">
|
||||
<label class="col-md-1" style="width: 130px;">Tipo de proyecto:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlProyecto" runat="server" CssClass="select2me" Style="width: 150px !important;">
|
||||
<asp:ListItem Text="Presupuesto" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="AnteProyecto" Value="0"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1">Ejercicio:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlEjercicio" runat="server" Width="100%" DataTextField="Ejercicio" DataValueField="Ejercicio" CssClass="select2me"></asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UPPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:GridView ID="GVD" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Registros de Avance Programatico" Width="100%"
|
||||
DataKeyNames="CveProgramaOperativo,EsProyecto,Bloqueado"
|
||||
CssClass="table table-advance table-hover Widthall ScrollAD mysmallbtn" data-freezerows="2" Style="text-align: center;" GridLines="None" OnDataBound="GVD_DataBound" >
|
||||
<Columns>
|
||||
|
||||
|
||||
<asp:BoundField HeaderText="Clave" DataField="Clave" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Programa Operativo Anual (POA)" DataField="ProgramaOperativo" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="U.M." DataField="UnidadMedida" ItemStyle-HorizontalAlign="Left" />
|
||||
|
||||
<asp:BoundField HeaderText="Meta" DataField="Meta" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<%--<asp:BoundField HeaderText="" DataField="Acciones" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />--%>
|
||||
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>
|
||||
Acciones <br /> Realizadas
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblAcciones" Text='<%#Eval("Acciones", "{0:N2}") %>' Target="_blank" runat="server" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>
|
||||
Dif. Meta <br> Acciones Realizadas
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblMetaDif" Text='<%#Eval("MetaDif", "{0:N2}") %>' Target="_blank" runat="server" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
<%--<asp:BoundField HeaderText="Dif. Meta Acciones Realizadas" DataField="MetaDif" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />--%>
|
||||
|
||||
|
||||
<asp:BoundField HeaderText="Comprometido" DataField="Comprometido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Devengado" DataField="Devengado" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Ejercido" DataField="Ejercido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Pagado" DataField="Pagado" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
|
||||
|
||||
|
||||
<%--<asp:HyperLinkField HeaderText="Clave" DataTextField="Clave" DataNavigateUrlFields="CveProgramaOperativo,EsProyecto,Bloqueado"
|
||||
DataNavigateUrlFormatString="/AC/ProgramaOperativo.aspx?CveProgramaOperativo={0}&EsProyecto={1},&Bloqueado={2}" ControlStyle-CssClass="btn btn-circle btn-sm blue" />--%>
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="80px" HeaderText="Acciones">
|
||||
<ItemTemplate>
|
||||
|
||||
<asp:HyperLink ID="GvHLAgregar" runat="server"
|
||||
CssClass="btn btn-circle btn-sm blue"
|
||||
Target="_blank" Visible="True"><i class='fa fa-plus'></i></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
</Columns>
|
||||
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
NavigateUrl="/AC/ProgramaOperativo.aspx?CveProgramaOperativo=703&EsProyecto=1,&Bloqueado=1"
|
||||
|
||||
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td align="right">
|
||||
<asp:Button ID="BtnProyecto" Visible="false" runat="server" Text="Aprobar Programa" class="btn green" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
204
AC/RepProgramasOperativosAvances.aspx.vb
Normal file
204
AC/RepProgramasOperativosAvances.aspx.vb
Normal file
@@ -0,0 +1,204 @@
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
Imports System.Data
|
||||
Imports System.Drawing
|
||||
|
||||
Partial Class AC_RepProgramasOperativosAvances
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
#Region "PROPIEDADES"
|
||||
|
||||
Private Property DtProgramaOperativo As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtProgramaOperativo"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtProgramaOperativo") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
SetValues()
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
#Region " VALORES INICIALES "
|
||||
Private Sub SetValues()
|
||||
CargaEjercicios()
|
||||
End Sub
|
||||
Private Sub CargaEjercicios()
|
||||
Dim ClsConta As New ClsContPAQi(UsuarioActual.Empresa)
|
||||
If ClsConta.GetEjercicios() Then
|
||||
DdlEjercicio.DataSource = ClsConta.DtResultados
|
||||
Else
|
||||
DdlEjercicio.DataSource = Nothing
|
||||
End If
|
||||
ClsConta.Dispose()
|
||||
DdlEjercicio.DataBind()
|
||||
|
||||
DdlEjercicio.SelectedValueExist(UsuarioActual.Empresa.EjercicioActual.ToString)
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
Protected Sub CargaDatos()
|
||||
Dim objAC As New ClsAC
|
||||
Dim Ejercicio As Integer = DdlEjercicio.SelectedValue.ToString.ToEntero
|
||||
Dim EsProyecto As Boolean = CBool(DdlProyecto.SelectedValue.ToString)
|
||||
|
||||
BtnProyecto.Visible = False
|
||||
|
||||
If objAC.GetProgramasOperativosAvances(-1, UsuarioActual.CveEmpresa, EsProyecto, Ejercicio) Then
|
||||
GVD.DataSource = objAC.DtResultados
|
||||
GlobalDTAC_ProgramaOperativo(-1) = objAC.DtResultados
|
||||
DtProgramaOperativo = objAC.DtResultados
|
||||
|
||||
'debe de haber datos para habilitar los botones
|
||||
If DtProgramaOperativo.Rows.Count > 0 Then
|
||||
If EsProyecto Then
|
||||
If DtProgramaOperativo.Rows(0)("Bloqueado").ToString = "0" Then
|
||||
BtnProyecto.Visible = True
|
||||
End If
|
||||
Else
|
||||
'si es anteproyecto
|
||||
If DtProgramaOperativo.Rows(0)("Bloqueado").ToString = "0" Then
|
||||
BtnProyecto.Visible = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
UPPDatos.Update()
|
||||
|
||||
objAC.Dispose()
|
||||
GVD.DataBind()
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub consultar_Click(sender As Object, e As EventArgs)
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
Protected Sub GVD_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GVD.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
'DataNavigateUrlFields = "CveProgramaOperativo,EsProyecto,Bloqueado"
|
||||
'DataNavigateUrlFormatString = "/AC/ProgramaOperativo.aspx?CveProgramaOperativo={0}&EsProyecto={1},&Bloqueado={2}"
|
||||
|
||||
e.Row.FCHyperLink("GvHLAgregar").NavigateUrl = $"/AC/ProgramaOperativo.aspx?CveProgramaOperativo={e.Row.DataKey("CveProgramaOperativo")}&EsProyecto={e.Row.DataKey("EsProyecto")}&Bloqueado={e.Row.DataKey("Bloqueado")}"
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub BtnProyecto_Click(sender As Object, e As EventArgs) Handles BtnProyecto.Click
|
||||
Dim objAC As New ClsAC()
|
||||
objAC.IniciaTransacSQL()
|
||||
|
||||
|
||||
|
||||
Dim ErrorAC = False
|
||||
For Each dr As DataRow In DtProgramaOperativo.Rows
|
||||
If Not objAC.BloquearProgramaOperativo(dr("CveProgramaOperativo").ToString.ToEntero) Then
|
||||
ErrorAC = True
|
||||
End If
|
||||
Next
|
||||
|
||||
If Not ErrorAC Then
|
||||
objAC.Commit()
|
||||
Alert("Los Programas Operativos se autorizaron correctamente", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert("Ocurrió un error al bloquear los Programas Operativos ", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
objAC.Dispose()
|
||||
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
|
||||
#Region "I M P R I M I R "
|
||||
Protected Sub LBPdf_Click(sender As Object, e As EventArgs)
|
||||
' ImprimirReporte()
|
||||
End Sub
|
||||
Protected Sub LBExcel_Click(sender As Object, e As EventArgs)
|
||||
' ImprimirReporte("Excel")
|
||||
End Sub
|
||||
Protected Sub ImprimirReporte(Optional Formato As String = "PDF")
|
||||
'nombre del archivo a generar
|
||||
Dim fileName As String = "ReporteProgramaOperativo"
|
||||
'ubicacion del rdlc
|
||||
Dim reportpath As String = "AC/Reportes/RepProgramaOperativo.rdlc"
|
||||
|
||||
'parametros a enviar al reporte
|
||||
Dim params As New List(Of ReportParameter)
|
||||
params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa))
|
||||
Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png")
|
||||
params.Add(New ReportParameter("pImg", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
|
||||
params.Add(New ReportParameter("pEjercicio", DdlEjercicio.SelectedValue.ToString))
|
||||
ImprimirPDF(reportpath, DtProgramaOperativo, params, fileName, Formato)
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
Protected Sub GVD_DataBound(sender As Object, e As EventArgs)
|
||||
|
||||
Dim row As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal)
|
||||
Dim cell As New TableHeaderCell()
|
||||
|
||||
cell = New TableHeaderCell()
|
||||
cell.ColumnSpan = 1
|
||||
cell.Text = ""
|
||||
row.Controls.Add(cell)
|
||||
|
||||
cell = New TableHeaderCell()
|
||||
cell.ColumnSpan = 1
|
||||
cell.Text = ""
|
||||
row.Controls.Add(cell)
|
||||
|
||||
cell = New TableHeaderCell()
|
||||
cell.ColumnSpan = 1
|
||||
cell.Text = ""
|
||||
|
||||
row.Controls.Add(cell)
|
||||
|
||||
cell = New TableHeaderCell()
|
||||
cell.Text = "POA"
|
||||
cell.ColumnSpan = 3
|
||||
row.Controls.Add(cell)
|
||||
|
||||
cell = New TableHeaderCell()
|
||||
cell.ColumnSpan = 4
|
||||
cell.Text = "Presupuesto"
|
||||
row.Controls.Add(cell)
|
||||
|
||||
|
||||
|
||||
cell = New TableHeaderCell()
|
||||
cell.ColumnSpan = 2
|
||||
cell.Text = ""
|
||||
row.Controls.Add(cell)
|
||||
|
||||
GVD.HeaderRow.Parent.Controls.AddAt(0, row)
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user