Commit inicial Ventas Productivo
This commit is contained in:
174
Contratos/CatContratosPlantillas.aspx
Normal file
174
Contratos/CatContratosPlantillas.aspx
Normal file
@@ -0,0 +1,174 @@
|
||||
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatContratosPlantillas.aspx.vb" Inherits="Contratos_CatContratosPlantillas" %>
|
||||
|
||||
<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">
|
||||
Catálogo de Plantillas de Contratos
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
|
||||
<li>
|
||||
<a href="javascript:$('#divAgregar').modal()"><i class="fa fa-plus"></i> Agregar</a>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton runat="server" ID="LbDescargar" text="<i class='fa fa-download'></i> Descargar Plantilla"></asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:$('#divEtiquetas').modal()"><i class="fa fa-tags"></i> Ver Etiquetas</a>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
|
||||
<div class="row" style="margin-left:0px;margin-top:5px;margin-bottom:5px" align="left">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" GridLines="None" DataKeyNames="CveContratoPlantilla,NombrePlantilla,URL,Tipo,Estatus" CssClass="table table-striped table-advance table-hover Widthall" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Plantillas de contratos">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="NombrePlantilla" ItemStyle-Width="20%" HeaderText="Conductor" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="TipoL" ItemStyle-Width="20%" HeaderText="Tipo" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="URL" ItemStyle-Width="20%" HeaderText="Archivo" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:BoundField DataField="FechaIng" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="20%" HeaderText="Fecha Ingreso" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:BoundField DataField="Usuario" ItemStyle-Width="10%" HeaderText="Usuario" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:TemplateField HeaderText="Estatus" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblEstatus" runat="server" Text=""></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" OnClick="imgE_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="5%" HeaderText="Eliminar" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" ItemStyle-Width="5%" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<div id="divAgregar" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAgregar" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Agregar Plantilla de Contrato</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpBodyEstatus" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtNombrePlantilla" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVPlataforma" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtNombrePlantilla" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Plantilla''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtNombrePlantilla.ClientID.ToString()%>">Nombre Plantilla:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlTipo" runat="server" CssClass="form-control select2me js-Impuesto-programmatic" Width="250px">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Recursos Humanos" value="RH"></asp:ListItem>
|
||||
<asp:ListItem Text="Proveedor" value="Prov"></asp:ListItem>
|
||||
<asp:ListItem Text="Cliente" value="Cli"></asp:ListItem>
|
||||
<asp:ListItem Text="Contrato" value="Con"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVDdlTipo" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlTipo" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlTipo.ClientID.ToString()%>">Tipo:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright" style="margin-bottom:5px">
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label style="margin-bottom: 0; font-size: 13px; color: #888888; opacity: 1; bottom: auto;">Archivo Plantilla:</label>
|
||||
<br />
|
||||
<asp:TextBox ID="TxtUpDoc" CssClass="ADSdropzone hidden" data-maxFile="1" runat="server"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="dvEstatus" runat="server" class="form-group form-md-line-input input-iconright">
|
||||
<label>Activo: </label>
|
||||
<br />
|
||||
<asp:Checkbox ID="chkEstatus" Text=" " runat="server" CssClass="chksino" Width="250px">
|
||||
</asp:Checkbox>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="BtnAgregarCatalogo" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"></asp:LinkButton>
|
||||
<asp:linkbutton runat="server" id="btnCancelar" text="Cancelar" cssclass="btn btn-default" ></asp:linkbutton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
<div id="divEtiquetas" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpdatePanel1" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel2">Etiquetas Disponibles:</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpdatePanel2" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<label style="font-weight:bold" class="col-md-4">{{NumeroContrato}}</label>
|
||||
<label style="font-weight:bold" class="col-md-4">{{Descripcion}}</label>
|
||||
<label style="font-weight:bold" class="col-md-4">{{Ubicacion}}</label>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label style="font-weight:bold" class="col-md-4">{{Responsable}}</label>
|
||||
<label style="font-weight:bold" class="col-md-4">{{FechaInicial}}</label>
|
||||
<label style="font-weight:bold" class="col-md-4">{{FechaFinal}}</label>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label style="font-weight:bold" class="col-md-4">{{Moneda}}</label>
|
||||
<label style="font-weight:bold" class="col-md-4">{{IVA}}</label>
|
||||
<label style="font-weight:bold" class="col-md-4">{{Anticipo}}</label>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label style="font-weight:bold" class="col-md-4">{{AmortizacionAnticipo}}</label>
|
||||
<label style="font-weight:bold" class="col-md-4">{{Garantia}}</label>
|
||||
<label style="font-weight:bold" class="col-md-4">{{Periodo}}</label>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label style="font-weight:bold" class="col-md-4">{{CuentaEquipo}}</label>
|
||||
<label style="font-weight:bold" class="col-md-4">{{NombreComercial}}</label>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal-footer">
|
||||
<button data-dismiss="modal" class="btn btn-default" >Cerrar</button>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
229
Contratos/CatContratosPlantillas.aspx.vb
Normal file
229
Contratos/CatContratosPlantillas.aspx.vb
Normal file
@@ -0,0 +1,229 @@
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Imports System.IO
|
||||
Partial Class Contratos_CatContratosPlantillas
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "Propiedades"
|
||||
Public Property CveContratoPlantilla As Integer
|
||||
Get
|
||||
Return ViewState("CveContratoPlantilla").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveContratoPlantilla") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property EsEditar As Integer
|
||||
Get
|
||||
Return ViewState("EsEditar").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("EsEditar") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property URL As String
|
||||
Get
|
||||
Return ViewState("URL").ToString
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("URL") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CveContratoPlantilla = -1
|
||||
EsEditar = 0
|
||||
dvEstatus.Visible = False
|
||||
CargaDatos(-1)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos(CveConductor As Integer)
|
||||
Dim ObjGeneral As New ClsGenerales
|
||||
If ObjGeneral.ContratosPlantillaGet(-1, UsuarioActual.CveEmpresa) Then
|
||||
GvDatos.DataSource = ObjGeneral.DtResultados
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
End If
|
||||
ObjGeneral.Dispose()
|
||||
GvDatos.DataBind()
|
||||
End Sub
|
||||
|
||||
Protected Sub imgE_Click(sender As Object, e As EventArgs)
|
||||
Dim Boton = CType(sender, LinkButton)
|
||||
CveContratoPlantilla = Boton.CommandArgument.ToEntero
|
||||
Dim GvRow As GridViewRow = DirectCast(Boton.NamingContainer, GridViewRow)
|
||||
TxtNombrePlantilla.Text = GvRow.DataKey("NombrePlantilla").ToString
|
||||
DdlTipo.SelectedValue = GvRow.DataKey("Tipo").ToString
|
||||
chkEstatus.Checked = CBool(GvRow.DataKey("Estatus"))
|
||||
URL = GvRow.DataKey("URL").ToString
|
||||
EsEditar = 1
|
||||
BtnAgregarCatalogo.Text = "Actualizar"
|
||||
dvEstatus.Visible = True
|
||||
UpBodyEstatus.Update()
|
||||
UpFooter.Update()
|
||||
RegistraScript("$('#divAgregar').modal()")
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregarCatalogo_Click(sender As Object, e As EventArgs) Handles BtnAgregarCatalogo.Click
|
||||
Dim ObjGeneral As New ClsGenerales
|
||||
URL = ""
|
||||
|
||||
Dim Filesgral As List(Of Archivo) = TxtUpDoc.getfiles().Archivos
|
||||
For Each fileItem As Archivo In Filesgral
|
||||
URL = FormatearNombreArchivo(fileItem.filenameO)
|
||||
If URL.Length > 199 Then
|
||||
Alert("El nombre del archivo excede los 200 Caracteres permitidos favor de modificarlo.", TipoMensaje.MsgAdvertencia)
|
||||
URL = ""
|
||||
Exit Sub
|
||||
ElseIf fileItem.Extencion <> "doc" AndAlso fileItem.Extencion <> "docx" Then
|
||||
Alert("Solo se permiten archivos de tipo .doc o .docx, favor de modificarlo", TipoMensaje.MsgAdvertencia)
|
||||
URL = ""
|
||||
Exit Sub
|
||||
End If
|
||||
Next
|
||||
|
||||
If EsEditar = 0 Then
|
||||
If URL <> "" Then
|
||||
Dim Path As String = UsuarioActual.Empresa.Ruta
|
||||
If Not Directory.Exists(Path) Then
|
||||
Directory.CreateDirectory(Path)
|
||||
End If
|
||||
Dim directorioNew As String = String.Format("{0}\Formatos\Plantillas\{1}", Path, URL)
|
||||
If File.Exists(directorioNew) Then
|
||||
My.Computer.FileSystem.DeleteFile(directorioNew)
|
||||
End If
|
||||
My.Computer.FileSystem.MoveFile(TxtUpDoc.getfiles().Archivos(0).FileUrl, directorioNew)
|
||||
If ObjGeneral.ContratoPlantillaAdd(UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, TxtNombrePlantilla.Text, URL, DdlTipo.SelectedValue) Then
|
||||
Alert("La plantilla se agregó correctamente", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
Else
|
||||
Alert("Es necesario que agregue el documento plantilla", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
ElseIf EsEditar = 1 Then
|
||||
If TxtUpDoc.getfiles().Archivos.Count > 0 Then
|
||||
Dim NuevaPlantilla As Archivo = TxtUpDoc.getfiles().Archivos(0)
|
||||
Dim Path As String = UsuarioActual.Empresa.Ruta
|
||||
If Not Directory.Exists(Path) Then
|
||||
Directory.CreateDirectory(Path)
|
||||
End If
|
||||
Dim directorioNew As String = String.Format("{0}\Formatos\Plantillas\{1}", Path, URL)
|
||||
If File.Exists(directorioNew) Then
|
||||
My.Computer.FileSystem.DeleteFile(directorioNew)
|
||||
End If
|
||||
My.Computer.FileSystem.MoveFile(NuevaPlantilla.FileUrl, directorioNew)
|
||||
End If
|
||||
|
||||
If ObjGeneral.ContratosPlantillaUpdate(UsuarioActual.CveEmpresa, TxtNombrePlantilla.Text, URL, DdlTipo.SelectedValue, CveContratoPlantilla, chkEstatus.Checked) Then
|
||||
Alert("La plantilla se editó correctamente", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert("Ocurrió un error al editar la plantilla", TipoMensaje.MsgError)
|
||||
End If
|
||||
EsEditar = 0
|
||||
dvEstatus.Visible = False
|
||||
BtnAgregarCatalogo.Text = "Agregar"
|
||||
End If
|
||||
RegistraScript("$('#divAgregar').modal('hide')")
|
||||
ObjGeneral.Dispose()
|
||||
TxtNombrePlantilla.Text = ""
|
||||
DdlTipo.SelectedValue = "-1"
|
||||
TxtUpDoc.Text = "[]"
|
||||
|
||||
CargaDatos(-1)
|
||||
UpDatos.Update()
|
||||
UpBodyEstatus.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim ObjGeneral As New ClsGenerales
|
||||
Dim CveContratoPlantilla As Integer = GvDatos.Rows(e.RowIndex).DataKey("CveContratoPlantilla").ToEntero
|
||||
If ObjGeneral.ContratoPlantillaDelete(CveContratoPlantilla, UsuarioActual.CveEmpresa) Then
|
||||
Alert("La plantilla se eliminó correctamente", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
ObjGeneral.Dispose()
|
||||
CargaDatos(-1)
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
e.Row.VerticalAlign = VerticalAlign.Middle
|
||||
e.Row.FCLinkButton("ImgE").CommandArgument = e.Row.DataKey("CveContratoPlantilla").ToString
|
||||
|
||||
If CBool(e.Row.DBCampo("Estatus")) = True Then
|
||||
e.Row.FCLabel("LblEstatus").Text = "Activo"
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Green
|
||||
|
||||
Else
|
||||
e.Row.FCLabel("LblEstatus").Text = "Inactivo"
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Red
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub btnCancelar_Click(sender As Object, e As EventArgs) Handles btnCancelar.Click
|
||||
EsEditar = 0
|
||||
RegistraScript("$('#divAgregar').modal('hide')")
|
||||
BtnAgregarCatalogo.Text = "Agregar"
|
||||
TxtNombrePlantilla.Text = ""
|
||||
DdlTipo.SelectedValue = "-1"
|
||||
TxtUpDoc.Text = "[]"
|
||||
dvEstatus.Visible = False
|
||||
UpBodyEstatus.Update()
|
||||
UpFooter.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Public Function FormatearNombreArchivo(nombreArchivoOriginal As String) As String
|
||||
Dim nombreArchivoFormateado As String
|
||||
nombreArchivoFormateado = nombreArchivoOriginal.Replace(" ", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("'", "")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace(Chr(34), "")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("$", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("#", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("%", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("!", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("&", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("?", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("¿", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("¡", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("*", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("~", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("^", "_")
|
||||
Return nombreArchivoFormateado
|
||||
End Function
|
||||
Protected Sub BtnDescargar_Click(sender As Object, e As EventArgs) Handles LbDescargar.Click
|
||||
Dim Path As String = $"{AppDomain.CurrentDomain.BaseDirectory}Empresas\Grales\Formatos\Plantilla.docx"
|
||||
Dim Archivo As New System.IO.FileInfo(Path)
|
||||
|
||||
If Archivo.Exists Then
|
||||
HttpContext.Current.Response.Clear()
|
||||
HttpContext.Current.Response.ClearContent()
|
||||
HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name) = "doc", "application/doc", "application/docx")
|
||||
HttpContext.Current.Response.AppendHeader("Content-disposition", String.Format("attachment; filename={0}", Archivo.Name))
|
||||
HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
|
||||
HttpContext.Current.Response.TransmitFile(Path)
|
||||
'HttpContext.Current.Response.Flush()
|
||||
HttpContext.Current.Response.End()
|
||||
End If
|
||||
Archivo = Nothing
|
||||
End Sub
|
||||
End Class
|
||||
126
Contratos/CatContratosTipos.aspx
Normal file
126
Contratos/CatContratosTipos.aspx
Normal file
@@ -0,0 +1,126 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatContratosTipos.aspx.vb" Inherits="Contratos_CatContratosTipos" %>
|
||||
|
||||
<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">
|
||||
Catálogo de Tipos de Contratos
|
||||
</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="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table border="0" class="">
|
||||
<tr>
|
||||
<td>
|
||||
<table class="table table-striped table-advance table-hover Widthall">
|
||||
<thead>
|
||||
<tr class="Titulos">
|
||||
<th width="40px">
|
||||
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="false" Text="" CommandArgument="LimiteMaximo;0">
|
||||
Clave
|
||||
<asp:Literal ID="Literal1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="200px">
|
||||
<asp:LinkButton ID="LbLimite" runat="server" CausesValidation="false" Text="" CommandArgument="LimiteMaximo;0">
|
||||
Tipo Contrato
|
||||
<asp:Literal ID="ImgLimiteMaximo" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="200px">
|
||||
<asp:LinkButton ID="LbComision" runat="server" CausesValidation="false" Text="" CommandArgument="Comision;0">
|
||||
Descripción
|
||||
<asp:Literal ID="ImgComision" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th></th>
|
||||
<th width="165px">Comandos</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<td style="width:40px;"></td>
|
||||
<td style="text-align: center">
|
||||
<asp:TextBox ID="TxtTipoContrato" runat="server" width="180px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVLimite" runat="server" ControlToValidate="TxtTipoContrato" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Contrato''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardarCaracteristicas"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOLimite" runat="server" HighlightCssClass="vco" TargetControlID="RFVLimite" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td style="text-align: center">
|
||||
<asp:TextBox ID="TxtDescripcion" runat="server" width="180px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVDescripcion" runat="server" ControlToValidate="TxtDescripcion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Descripción''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardarCaracteristicas"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEDescripcion" runat="server" HighlightCssClass="vco" TargetControlID="RFVDescripcion" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td></td>
|
||||
<td style="text-align: center">
|
||||
<asp:LinkButton ID="LbAgregarC" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardarCaracteristicas"></asp:LinkButton></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<asp:UpdatePanel ID="UpGVContratos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvContratos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveContratoTipo" EmptyDataText="No se encontraron Tipos de Contratos." ToolTip="Listado de tipos de Contratos." CssClass="table table-striped table-advance table-hover Widthall" Style="margin-top: -10px; text-align: center;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="CveContratoTipo" ReadOnly="true" />
|
||||
|
||||
<asp:TemplateField ItemStyle-Width="180px" ItemStyle-HorizontalAlign="left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlContrato" runat="server" Text='<%# Eval("ContratoTipo", " {0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtTipoContrato" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("ContratoTipo")%>' Width="180px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVCaracteristica" runat="server" ControlToValidate="TxtTipoContrato" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Contrato''</b> es necesario, por favor ingréselo."></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOCaracteristica" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaracteristica" Width="100px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
<asp:TemplateField ItemStyle-Width="200px">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlDescripcion" runat="server" Text='<%# Eval("Descripcion", " {0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtDescripcion" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Descripcion")%>' Width="180px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVDescripcion" runat="server" ControlToValidate="TxtDescripcion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Descripción''</b> es necesario, por favor ingréselo."></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCODescripcion" runat="server" HighlightCssClass="vco" TargetControlID="RFVDescripcion" Width="100px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="89px">
|
||||
<EditItemTemplate>
|
||||
<center>
|
||||
<asp:LinkButton ID="ImageButton1" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>"/>
|
||||
<asp:LinkButton ID="ImageButton2" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||
</center>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="ImageButton3" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Eliminar" ItemStyle-Width="83px">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="ImageButton4" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script language="javascript" type="text/javascript">
|
||||
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
100
Contratos/CatContratosTipos.aspx.vb
Normal file
100
Contratos/CatContratosTipos.aspx.vb
Normal file
@@ -0,0 +1,100 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class Contratos_CatContratosTipos
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Sub Contratos_CatTiposContratos_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
#Region " CARGAS "
|
||||
Private Sub CargaDatos()
|
||||
Dim Objeto As New ClsContratos
|
||||
If Objeto.GetContratosTipos() Then
|
||||
GvContratos.DataSource = Objeto.DtResultados
|
||||
GlobalDTContratosTipos = Objeto.DtResultados
|
||||
End If
|
||||
GvContratos.DataBind()
|
||||
Objeto.Dispose()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
#Region " GV CONTRATOS Y AGREGAR "
|
||||
Private Sub LbAgregarC_Click(sender As Object, e As EventArgs) Handles LbAgregarC.Click
|
||||
Dim Objeto As New ClsContratos
|
||||
Dim TipoContrato = TxtTipoContrato.Text
|
||||
Dim Descripcion = TxtDescripcion.Text
|
||||
Dim Estatus = True
|
||||
|
||||
If Objeto.AddContratosTipos(TipoContrato, Descripcion, Estatus, UsuarioActual.CveUsuario.ToEntero) Then
|
||||
TxtTipoContrato.Text = ""
|
||||
TxtDescripcion.Text = ""
|
||||
CargaDatos()
|
||||
UpDatos.Update()
|
||||
End If
|
||||
|
||||
|
||||
Objeto.Dispose()
|
||||
Alert("El Contrato se agregó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub GvIndicadores_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvContratos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
'ESTATUS NORMAL
|
||||
If Not (e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5) Then
|
||||
e.Row.Cells(0).Width = 70
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub GVCarac_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvContratos.RowEditing
|
||||
GvContratos.EditIndex = e.NewEditIndex
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvContratos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvContratos.RowUpdating
|
||||
Dim Update As New ClsContratos
|
||||
Dim TipoContrato = GvContratos.Rows(e.RowIndex).FCTextBox("TxtTipoContrato").Text.Trim
|
||||
Dim Descripcion = GvContratos.Rows(e.RowIndex).FCTextBox("TxtDescripcion").Text.Trim
|
||||
Dim Clave = GvContratos.Rows(e.RowIndex).DataKey("CveContratoTipo").ToEntero
|
||||
If Update.UpdateContratosTipos(Clave, TipoContrato, Descripcion, True, UsuarioActual.CveEmpresa) Then
|
||||
Alert("El Tipo de Contrato se actualizó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
GvContratos.EditIndex = -1
|
||||
CargaDatos()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvContratoss_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvContratos.RowCancelingEdit
|
||||
GvContratos.EditIndex = -1
|
||||
CargaDatos()
|
||||
Alert("Se canceló la edición de los campos.")
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub GvContratos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvContratos.RowDeleting
|
||||
Dim Objeto As New ClsContratos
|
||||
Dim Clave = GvContratos.Rows(e.RowIndex).DataKey("CveContratoTipo").ToEntero
|
||||
|
||||
If Objeto.RemoveContratosTipos(Clave) Then
|
||||
Alert("Se eliminó correctamente el Tipo de Contrato.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
Objeto.Dispose()
|
||||
GvContratos.EditIndex = -1
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
End Class
|
||||
107
Contratos/CatPresupuestos.aspx
Normal file
107
Contratos/CatPresupuestos.aspx
Normal file
@@ -0,0 +1,107 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatPresupuestos.aspx.vb" Inherits="Contratos_CatPresupuestos" %>
|
||||
|
||||
<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">
|
||||
Catálgo de Presupuestos
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:HyperLink Target="_blank" NavigateUrl="/Contratos/Presupuestos.aspx?CvePresupuesto=-1" runat="server"><i class="fa fa-plus"></i> Agregar Presupuesto</asp:HyperLink>
|
||||
</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" id="DivFiltros">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
<div class="row">
|
||||
<label class="col-md-1" style="max-width: 70px">Estatus: </label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList CssClass="table-group-action-input form-control input-inline input-small input-sm select2me" ID="DdlEstatus" runat="server">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Proyecto" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Autorizado" Value="2"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1 truncate" style="max-width: 120px">Fecha Inicio</label>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
|
||||
<asp:TextBox ID="TxtFechaI" CssClass="form-control input-sm ADSMaskDate" Style="width: 118px" runat="server"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="LnkCortfechaI" class="btn default " Text=" <i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="TxtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CEFechaI" TargetControlID="TxtFechaI" PopupButtonID="LnkCortfechaI" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVFechaI" runat="server" ControlToValidate="TxtFechaI" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpFiltros"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEFechaI" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaI"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<label class="col-md-1 truncate" style="max-width: 120px">Fecha Fin</label>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
|
||||
<asp:TextBox ID="TxtFechaF" CssClass="form-control input-sm ADSMaskDate" Style="width: 118px" runat="server"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="LnkCortfechaF" class="btn default " Text=" <i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="TxtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CEFechaF" TargetControlID="TxtFechaF" PopupButtonID="LnkCortfechaF" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVFechaF" runat="server" ControlToValidate="TxtFechaF" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpFiltros"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEFechaF" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaF"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none">
|
||||
<div class="row">
|
||||
<label class="col-md-1 truncate" style="max-width: 70px">Proyecto:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlProyecto" runat="server" AppendDataBoundItems="true" Width="150px" AutoPostBack="true" DataTextField="Proyecto" DataValueField="CveProyecto" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1 truncate" style="max-width: 120px">SubProyecto:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" Width="150px" DataTextField="SubProyecto2" DataValueField="CveSubProyecto" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron presupuestos registrados"
|
||||
CssClass="table table-striped table-hover Widthall ScrollAD" GridLines="None" data-sort="true">
|
||||
<Columns>
|
||||
<asp:HyperLinkField HeaderText="Nombre" DataTextField="Nombre" Target="_blank" DataNavigateUrlFields="CvePresupuesto" DataNavigateUrlFormatString="/Contratos/Presupuestos.aspx?CvePresupuesto={0}" />
|
||||
<asp:BoundField HeaderText="Observación" DataField="Nombre" />
|
||||
<asp:BoundField HeaderText="Proyecto" DataField="Proyecto" />
|
||||
<asp:BoundField HeaderText="SubProyecto" DataField="SubProyecto" />
|
||||
<asp:BoundField HeaderText="Estatus" DataField="EstatusTexto" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="FechaInicio" DataField="FechaInicio" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="FechaFin" DataField="FechaFin" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="Importe" DataField="Importe" DataFormatString="{0:C}" ItemStyle-HorizontalAlign="Right" />
|
||||
</Columns>
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
84
Contratos/CatPresupuestos.aspx.vb
Normal file
84
Contratos/CatPresupuestos.aspx.vb
Normal file
@@ -0,0 +1,84 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class Contratos_CatPresupuestos
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
InicializaValores()
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
#Region "I N I C I A L I Z A - V A L O R E S"
|
||||
Private Sub InicializaValores()
|
||||
CargaProyecto()
|
||||
Dim CveProyecto = DdlSubProyecto.SelectedValue.ToEntero
|
||||
CargaSubProyecto(CveProyecto)
|
||||
txtFechaI.Text = $"01/01/{Now.Year}"
|
||||
txtFechaF.Text = Now.ToString("dd/MM/yyyy")
|
||||
|
||||
UPFiltros.Update()
|
||||
End Sub
|
||||
Private Sub CargaProyecto()
|
||||
DdlProyecto.Items.Clear()
|
||||
DdlProyecto.DataSource = GlobalDTProyectos(UsuarioActual.Empresa.CveEmpresa).FiltraParametros("", "", {"CveProyecto", "Proyecto"})
|
||||
DdlProyecto.DataBind()
|
||||
DdlProyecto.Items.Insert(0, New ListItem("Seleccione un Proyecto", "-1"))
|
||||
End Sub
|
||||
Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyecto.SelectedIndexChanged
|
||||
CargaSubProyecto(DdlProyecto.SelectedValue.ToEntero)
|
||||
UPFiltros.Update()
|
||||
End Sub
|
||||
Protected Sub CargaSubProyecto(CveProyecto As Integer)
|
||||
DdlSubProyecto.Items.Clear()
|
||||
If CveProyecto > 0 Then
|
||||
DdlSubProyecto.DataSource = GlobalDTSubProyectos(CveProyecto, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("", "", {"CveSubproyecto", "SubProyecto2"})
|
||||
DdlSubProyecto.DataBind()
|
||||
DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione un SubProyecto", "-1"))
|
||||
Else
|
||||
DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione un SubProyecto", "-1"))
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjPres As New ClsContratos
|
||||
Dim FechaI = TxtFechaI.Text.ToDate
|
||||
Dim FechaF = TxtFechaF.Text.ToDate
|
||||
Dim CveSubProyecto = DdlProyecto.SelectedValue.ToEntero
|
||||
Dim Estatus = DdlEstatus.SelectedValue.ToEntero
|
||||
Dim CvePresupuesto = -1
|
||||
Dim Nombre = "-1"
|
||||
Dim CveUsuario = -1
|
||||
If ObjPres.GetPresupuestosCat(CvePresupuesto, Nombre, CveSubProyecto, Estatus, CveUsuario, FechaI, FechaF, UsuarioActual.CveEmpresa) Then
|
||||
GvDatos.DataSource = ObjPres.DtResultados
|
||||
End If
|
||||
ObjPres.Dispose()
|
||||
GvDatos.DataBind()
|
||||
End Sub
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||
Dim Estatus = DdlEstatus.SelectedValue.ToEntero
|
||||
Dim CveSubProyecto = DdlSubProyecto.SelectedValue.ToEntero
|
||||
Dim FechaI = txtFechaI.Text.ToDate
|
||||
Dim FechaF = TxtFechaF.Text.ToDate
|
||||
Dim CvePresupuesto = -1
|
||||
Dim Nombre = "-1"
|
||||
Dim CveUsuario = -1
|
||||
Dim ObjPres As New ClsContratos
|
||||
If ObjPres.GetPresupuestosCat(CvePresupuesto, Nombre, CveSubProyecto, Estatus, CveUsuario, FechaI, FechaF, UsuarioActual.CveEmpresa) Then
|
||||
GvDatos.DataSource = ObjPres.DtResultados
|
||||
End If
|
||||
ObjPres.Dispose()
|
||||
GvDatos.DataBind()
|
||||
|
||||
UPFiltros.Update()
|
||||
UpTitulos.Update()
|
||||
End Sub
|
||||
End Class
|
||||
354
Contratos/CatRefrendos.aspx
Normal file
354
Contratos/CatRefrendos.aspx
Normal file
@@ -0,0 +1,354 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CatRefrendos.aspx.cs" Inherits="Contratos_CatRefrendos" validateRequest="false" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
.posicionvalidation {
|
||||
left: 230px;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de Refrendo
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
|
||||
<asp:UpdatePanel ID="UpLnkAgregar" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="linkAgregar" runat="server" OnClick="linkAgregar_Click" Visible="true"><i class="fa fa-plus"></i>Agregar</asp:LinkButton>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<asp:LinkButton ID="ImgImprimir" runat="server" OnClick="ImgImprimir_Click"> <i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<asp:LinkButton ID="ImgExcel" runat="server" OnClick="ImgExcel_Click"> <i class="fa fa-ad-excel"></i> Generar Excel</asp:LinkButton>
|
||||
</li>
|
||||
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="ImgExcel" />
|
||||
<asp:PostBackTrigger ControlID="ImgImprimir" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</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 id="PFiltro" class="portlet solid grey-cascade portlet-filter">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" Text="Consultar" class="btn btn-primary" ValidationGroup="Valida" />
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
<div class="row" style="margin-left: 10px;">
|
||||
|
||||
<label class="col-md-1 " id="LblDdlCliente" runat="server" style="margin-top: 5px;">Cliente:</label>
|
||||
<div class="col-md-2" id="DivDdlCliente" runat="server">
|
||||
<asp:DropDownList ID="DdlCliente" runat="server" AppendDataBoundItems="true" DataTextField="NombreComercial" DataValueField="CveCliente" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1 " style="margin-top: 5px;">Fecha V.I.:</label>
|
||||
<div class="col-md-1" style="width: 150px !important;">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
|
||||
<asp:TextBox ID="txtFechaVencI" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioVI" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaVI" runat="server" TargetControlID="txtFechaVencI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario3" TargetControlID="txtFechaVencI" PopupButtonID="ImgCalendarioVI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="cvFechaVI" runat="server" ControlToValidate="txtFechaVencI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFVI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaVI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<%-- <asp:RequiredFieldValidator ID="rfvFechaVI" runat="server" ControlToValidate="txtFechaVencI" Display="None" ErrorMessage="El campo <b>''Fecha Vencimiento Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoFfvFVI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaVI" Width="350px"></ajax:ValidatorCalloutExtender>--%>
|
||||
</div>
|
||||
<label class="col-md-1 " style="margin-top: 5px;">Fecha V.F.:</label>
|
||||
<div class="col-md-1" style="width: 150px !important;">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
|
||||
<asp:TextBox ID="txtFechaVencF" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioVF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaVF" runat="server" TargetControlID="txtFechaVencF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario4" TargetControlID="txtFechaVencF" PopupButtonID="imgCalendarioVF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="cvFechaVF" runat="server" ControlToValidate="txtFechaVencF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFVF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaVF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<%-- <asp:RequiredFieldValidator ID="rfvFechaVF" runat="server" ControlToValidate="txtFechaVencF" Display="None" ErrorMessage="El campo <b>''Fecha Vencimiento Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoFfvFVF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaVF" Width="350px"></ajax:ValidatorCalloutExtender>--%>
|
||||
</div>
|
||||
|
||||
<asp:CompareValidator ID="CVFechasVenc" runat="server" ForeColor="#a94442" ControlToCompare="txtFechaVencI" ControlToValidate="txtFechaVencF" Type="Date" Operator="GreaterThan" Display="None" ErrorMessage="<b><span style='text-decoration: underline;'>ERROR:</span></b><br /><b>''Fecha V.F.''</b> debe ser mayor a Fecha V.I." ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCE1" runat="server" HighlightCssClass="vco" TargetControlID="CVFechasVenc" Width="270px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
<label class="col-md-1" style="margin-top: 5px;">Estatus:</label>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlEstatus" runat="server" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%"></asp:DropDownList>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none;">
|
||||
<div class="row" style="margin-left: 10px;">
|
||||
|
||||
<label class="col-md-1 " id="LblUsuario" runat="server" style="margin-top: 5px;">Usuario:</label>
|
||||
<div class="col-md-2" id="DivDdlUsuario" runat="server">
|
||||
<asp:DropDownList ID="DdlUsuario" runat="server" AppendDataBoundItems="true" DataTextField="Usuario" DataValueField="CveUsuario" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1 " style="margin-top: 5px;">Fecha R.I.:</label>
|
||||
<div class="col-md-1" style="width: 150px !important;">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 138px !important; padding-left: 0px; padding-right: 0px; margin-bottom: -10px;">
|
||||
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<%-- <asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>>--%>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1 " style="margin-top: 5px;">Fecha R.F.:</label>
|
||||
<div class="col-md-1" style="width: 150px !important;">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 138px !important; padding-left: 0px; padding-right: 0px; margin-bottom: -10px;">
|
||||
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" Text="31/08/2018" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<%--<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>>--%>
|
||||
</div>
|
||||
|
||||
<asp:CompareValidator ID="CVFechasRef" runat="server" ForeColor="#a94442" ControlToCompare="txtFechaI" ControlToValidate="txtFechaF" Type="Date" Operator="GreaterThan" Display="None" ErrorMessage="<b><span style='text-decoration: underline;'>ERROR:</span></b><br /><b>''Fecha R.F.''</b> debe ser mayor a Fecha R.I." ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCE2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechasRef" Width="270px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%-- GRIEDVIEW --%>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
|
||||
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right" align="left">
|
||||
<div style="margin-right: 15px">
|
||||
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvRefrendos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvRefrendos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<asp:GridView ID="GvRefrendos" runat="server" GridLines="None" DataKeyNames="CveRefrendo, CveCliente, Cliente, Descripcion, Fecha, FechaVencimiento, FechaIng, CveUsuarioCreo, Usuario, CveEmpresa, CodigoProveedor, CveEstatus, CveTipoDocto, LigaDocto"
|
||||
CssClass="table table-striped table-advance table-hover Widthall mysmallbtn ScrollAD" data-sort="true" data-footer="0" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False"
|
||||
EmptyDataText="No se encontraron registros" OnRowDeleting="GvRefrendos_RowDeleting">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Cliente" HeaderText="Cliente" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="CodigoProveedor" HeaderText="Código Prov." ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Descripcion" HeaderText="Descripción" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="TipoDocumento" HeaderText="Tipo Documento" ItemStyle-Width="7%" ItemStyle-HorizontalAlign="Left" />
|
||||
|
||||
<asp:BoundField DataField="Estatus" HeaderText="Estatus" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left" />
|
||||
|
||||
<asp:BoundField DataField="Fecha" DataFormatString="{0:d}" ItemStyle-Width="7%" HeaderText="Fecha Refrendo" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="FechaVencimiento" DataFormatString="{0:d}" ItemStyle-Width="7%" HeaderText="Fecha Venc." ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="FechaIng" DataFormatString="{0:d}" ItemStyle-Width="7%" HeaderText="Fecha Ingreso" ItemStyle-HorizontalAlign="Center" />
|
||||
|
||||
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-Width="14%" ItemStyle-HorizontalAlign="Left" />
|
||||
|
||||
<asp:TemplateField ItemStyle-Width="5%" HeaderText="Acciones" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" Visible="true" OnClick="imgE_Click" AlternateText="Editar" CommandArgument='<%# Eval("CveRefrendo")%>' CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
<asp:LinkButton ID="imgD" runat="server" Visible="true" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Desea eliminar este refrendo?" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%-- END GRIEDVIEW --%>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<%-- MODAL AGREGAR-EDITAR --%>
|
||||
<div id="DvModalRefrendo" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UPModalRefrendo" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="txth4Refrendo" runat="server">Refrendo</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel runat="server" ID="UpModalBody" UpdateMode="conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<div class=" form-group form-horizontal form-md-line-input input-iconright">
|
||||
|
||||
<div class="form-group row">
|
||||
|
||||
<div class="col-md-6 ">
|
||||
<asp:Label runat="server" ID="LabelClientesRef" Style="margin-top: -16px;" for="<%=DdlClientesRef.ClientID.ToString()%>">Cliente:</asp:Label>
|
||||
<asp:DropDownList ID="DdlClientesRef" Width="230px" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssClass="form-control input-sm select2me" AutoPostBack="true" OnSelectedIndexChanged="DdlClientesRef_SelectedIndexChanged"></asp:DropDownList>
|
||||
|
||||
<asp:RequiredFieldValidator ID="RFVClientes" runat="server" ControlToValidate="DdlClientesRef" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clientes''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEClientes" runat="server" HighlightCssClass="vco posicionvalidation" TargetControlID="RFVClientes" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<asp:Label ID="LblClienteEspecifico" runat="server" Style="margin-top: -16px;" for="<%= TxtClienteEspecifico.ClientID.ToString()%>"></asp:Label>
|
||||
<%-- Cliente Específico:--%>
|
||||
<asp:TextBox ID="TxtClienteEspecifico" runat="server" CssClass="form-control" MaxLength="50" CausesValidation="true" Visible="false"></asp:TextBox>
|
||||
|
||||
<asp:RequiredFieldValidator ID="RFVClienteEspecifico" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtClienteEspecifico" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cliente Específico''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class=" form-group form-horizontal form-md-line-input input-iconright">
|
||||
|
||||
<div class="form-group row">
|
||||
|
||||
<div class="col-md-6 ">
|
||||
<asp:Label runat="server" ID="LblEstatus" Style="margin-top: -16px;" for="<%=DdlEstatusRefrendo.ClientID.ToString()%>">Estatus:</asp:Label>
|
||||
<asp:DropDownList ID="DdlEstatusRefrendo" Width="230px" runat="server" CssClass="form-control input-sm select2me"></asp:DropDownList>
|
||||
|
||||
<asp:RequiredFieldValidator ID="RFVEstatus" runat="server" ControlToValidate="DdlEstatusRefrendo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Estatus''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEEstatus" runat="server" HighlightCssClass="vco posicionvalidation" TargetControlID="RFVEstatus" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<div class="col-md-6 ">
|
||||
<asp:Label runat="server" ID="lblProveedor" Style="margin-top: -16px;" for="<%=TxtCodigoProveedor.ClientID.ToString()%>">Código Proveedor:</asp:Label>
|
||||
<asp:TextBox ID="TxtCodigoProveedor" runat="server" CssClass="form-control" MaxLength="15" CausesValidation="true"></asp:TextBox>
|
||||
|
||||
<asp:RequiredFieldValidator ID="RFCProveedor" runat="server" ControlToValidate="TxtCodigoProveedor" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Proveedor''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEProveedor" runat="server" HighlightCssClass="vco posicionvalidation" TargetControlID="RFCProveedor" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class=" form-group ">
|
||||
|
||||
<div class="form-group row">
|
||||
|
||||
<div class="col-md-6 ">
|
||||
<asp:Label runat="server" ID="LblTipoDocto" Style="margin-top: -16px;" for="<%=DdlTipoDocto.ClientID.ToString()%>">Tipo de Documento:</asp:Label>
|
||||
<asp:DropDownList ID="DdlTipoDocto" Width="230px" runat="server" DataTextField="TipoDocumento" DataValueField="CveTipoDocto" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" AutoPostBack="true" OnSelectedIndexChanged="DdlTipoDocto_SelectedIndexChanged"></asp:DropDownList>
|
||||
|
||||
<asp:RequiredFieldValidator ID="RFVTipoDocto" runat="server" ControlToValidate="DdlTipoDocto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Documento''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCETipoDocto" runat="server" HighlightCssClass="vco posicionvalidation" TargetControlID="RFVTipoDocto" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6" runat="server" id="DivLigaDocto" visible="false">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label style="margin-top: -16px;" for="<%= TxtLigaDocumento.ClientID.ToString()%>">Liga Documento:</label>
|
||||
<asp:TextBox ID="TxtLigaDocumento" runat="server" CssClass="form-control" MaxLength="50" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVLigaDocumento" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtLigaDocumento" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Liga Documento''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
|
||||
<div class="row">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtDescripcion" runat="server" CssClass="form-control" MaxLength="500" CausesValidation="true"></asp:TextBox>
|
||||
<label style="margin-top: -6px" for="<%= TxtDescripcion.ClientID.ToString()%>">Descripción:</label>
|
||||
<asp:RequiredFieldValidator ID="RFVDescripcion" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtDescripcion" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Descripción''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="<%= txtFecha.ClientID.ToString() %>" style="font-size: 13px; color: #888888;">Fecha de Refrendo:</label>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px;">
|
||||
<asp:TextBox ID="txtFecha" runat="server" Style="width: 90px;" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioM" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEEFecha" runat="server" TargetControlID="txtFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CalendarioM" TargetControlID="txtFecha" PopupButtonID="ImgCalendarioM" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFecha" runat="server" CssClass="help-block errorimput" ControlToValidate="txtFecha" Display="None" ErrorMessage="El campo <b>''Fecha''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEFecha" runat="server" HighlightCssClass="vco" TargetControlID="rfvFecha" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="<%= txtFechaVenc.ClientID.ToString() %>" style="font-size: 13px; color: #888888;">Fecha de Vencimiento:</label>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px;">
|
||||
<asp:TextBox ID="txtFechaVenc" runat="server" Style="width: 90px;" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioMV" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaV" runat="server" TargetControlID="txtFechaVenc" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CalendarioMV" TargetControlID="txtFechaVenc" PopupButtonID="ImgCalendarioMV" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaV" runat="server" ControlToValidate="txtFechaVenc" Display="None" ErrorMessage="El campo <b>''Fecha de Vencimiento''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<asp:CompareValidator ID="CVFechas" runat="server" ForeColor="#a94442" ControlToCompare="txtFecha" ControlToValidate="txtFechaVenc" Type="Date" Operator="GreaterThan" ErrorMessage="<b><span style='text-decoration: underline;'>ERROR:</span></b><br />El campo <b>''Fecha de Vencimiento''</b> debe ser mayor que la Fecha de Refrendo." ValidationGroup="GrpObligatorio"></asp:CompareValidator>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:LinkButton ID="BtnGuardarRefrendo" runat="server" Text="Guardar" CssClass="btn btn-primary" OnClick="BtnGuardarRefrendo_Click" ValidationGroup="GrpObligatorio"></asp:LinkButton>
|
||||
<button data-dismiss="modal" class="btn btn-default">Cancelar</button>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
560
Contratos/CatRefrendos.aspx.cs
Normal file
560
Contratos/CatRefrendos.aspx.cs
Normal file
@@ -0,0 +1,560 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using ClosedXML.Excel;
|
||||
using Extensiones;
|
||||
using Microsoft.Reporting.WebForms;
|
||||
|
||||
public partial class Contratos_CatRefrendos : ClsPaginas
|
||||
{
|
||||
|
||||
#region "Propiedades"
|
||||
private String FechaInicio
|
||||
{
|
||||
get
|
||||
{
|
||||
return ViewState["FechaInicio"].ToString();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
ViewState["FechaInicio"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
private String FechaFin
|
||||
{
|
||||
get
|
||||
{
|
||||
return ViewState["FechaFin"].ToString();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
ViewState["FechaFin"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
private String FechaVencimientoInicio
|
||||
{
|
||||
get
|
||||
{
|
||||
return ViewState["FechaVencimientoInicio"].ToString();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
ViewState["FechaVencimientoInicio"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
private String FechaVencimientoFin
|
||||
{
|
||||
get
|
||||
{
|
||||
return ViewState["FechaVencimientoFin"].ToString();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
ViewState["FechaVencimientoFin"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
private int CveUsuario
|
||||
{
|
||||
get
|
||||
{
|
||||
return ViewState["CveUsuario"].ToString().ToEntero();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
ViewState["CveUsuario"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
private int CveCliente
|
||||
{
|
||||
get
|
||||
{
|
||||
return ViewState["CveCliente"].ToString().ToEntero();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
ViewState["CveCliente"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
private int CveEmpresa
|
||||
{
|
||||
get
|
||||
{
|
||||
return ViewState["CveEmpresa"].ToString().ToEntero();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
ViewState["CveEmpresa"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
private int EsEditar
|
||||
{
|
||||
get
|
||||
{
|
||||
return ViewState["EsEditar"].ToString().ToEntero();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
ViewState["EsEditar"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
private int CveRefrendo
|
||||
{
|
||||
get
|
||||
{
|
||||
return ViewState["CveRefrendo"].ToString().ToEntero();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
ViewState["CveRefrendo"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
private DataTable TmpDT
|
||||
{
|
||||
get
|
||||
{
|
||||
return (DataTable)ViewState["TmpDT"];
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
ViewState["TmpDT"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
private int CveEstatus
|
||||
{
|
||||
get
|
||||
{
|
||||
return ViewState["CveEstatus"].ToString().ToEntero();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
ViewState["CveEstatus"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
InicializaDatos();
|
||||
}
|
||||
}
|
||||
|
||||
#region "CARGA DATOS"
|
||||
|
||||
protected void InicializaDatos()
|
||||
{
|
||||
FechaInicio = "-1";
|
||||
FechaFin = "-1";
|
||||
|
||||
FechaVencimientoInicio = "-1";//DateTime.Today.AddYears(-1).ToShortDateString();
|
||||
FechaVencimientoFin = "-1";//DateTime.Today.AddYears(2).ToShortDateString();
|
||||
|
||||
CveEmpresa = UsuarioActual.CveEmpresa;
|
||||
CveCliente = -1;
|
||||
CveUsuario = -1;
|
||||
|
||||
CveEstatus = -1;
|
||||
|
||||
CargaClientes();
|
||||
CargaUsuarios();
|
||||
CargaFechas();
|
||||
CargaEstatus();
|
||||
|
||||
CargaDatos();
|
||||
CargaModal();
|
||||
}
|
||||
|
||||
protected void CargaDatos()
|
||||
{
|
||||
ClsContratos ObjContrato = new ClsContratos();
|
||||
|
||||
if (ObjContrato.GetRefrendos(FechaVencimientoInicio, FechaVencimientoFin, FechaInicio, FechaFin, CveCliente, CveUsuario, CveEmpresa, CveEstatus))
|
||||
{
|
||||
TmpDT = ObjContrato.DtResultados;
|
||||
GvRefrendos.DataSource = TmpDT;
|
||||
}
|
||||
ObjContrato.Dispose();
|
||||
GvRefrendos.DataBind();
|
||||
UPFiltros.Update();
|
||||
}
|
||||
|
||||
protected void limpiarCamposModal()
|
||||
{
|
||||
DdlClientesRef.SelectedValue = "-1";
|
||||
TxtClienteEspecifico.Text = "";
|
||||
|
||||
TxtCodigoProveedor.Text = "";
|
||||
DdlEstatusRefrendo.SelectedValue = "-1";
|
||||
|
||||
DdlTipoDocto.SelectedValue = "-1";
|
||||
TxtLigaDocumento.Text = "";
|
||||
|
||||
TxtDescripcion.Text = "";
|
||||
|
||||
TxtClienteEspecifico.Visible = false;
|
||||
LblClienteEspecifico.Text = "";
|
||||
LblClienteEspecifico.Visible = false;
|
||||
|
||||
DivLigaDocto.Visible = false;
|
||||
|
||||
txtFecha.Text = DateTime.Today.ToString();
|
||||
txtFechaVenc.Text = DateTime.Today.AddDays(1).ToString();
|
||||
}
|
||||
|
||||
protected void CargaModal()
|
||||
{
|
||||
DdlClientesRef.DataSource = get_GlobalDTCliente(CveEmpresa);
|
||||
DdlClientesRef.DataBind();
|
||||
DdlClientesRef.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
||||
DdlClientesRef.Items.Insert(1, new ListItem("Cliente Específico", "0"));
|
||||
DdlClientesRef.SelectedValue = "-1";
|
||||
|
||||
|
||||
|
||||
DdlEstatusRefrendo.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
||||
DdlEstatusRefrendo.Items.Insert(1, new ListItem("Vigente", "1"));
|
||||
DdlEstatusRefrendo.Items.Insert(2, new ListItem("No Vigente", "2"));
|
||||
DdlEstatusRefrendo.SelectedValue = "-1";
|
||||
|
||||
|
||||
ClsContratos ObjContrato = new ClsContratos();
|
||||
|
||||
if (ObjContrato.GetRefrendosTipoDocumento(CveEmpresa))
|
||||
{
|
||||
DdlTipoDocto.DataSource = ObjContrato.DtResultados;
|
||||
DdlTipoDocto.DataBind();
|
||||
DdlTipoDocto.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
||||
ObjContrato.Dispose();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void CargaClientes()
|
||||
{
|
||||
DdlCliente.DataSource = get_GlobalDTCliente(CveEmpresa);
|
||||
DdlCliente.DataBind();
|
||||
DdlCliente.Items.Insert(0, new ListItem("Todos", "-1"));
|
||||
DdlCliente.SelectedValue = "-1";
|
||||
}
|
||||
|
||||
protected void CargaUsuarios()
|
||||
{
|
||||
DdlUsuario.DataSource = get_GlobalDTUsuarios(-1, CveEmpresa);
|
||||
DdlUsuario.DataBind();
|
||||
DdlUsuario.Items.Insert(0, new ListItem("Todos", "-1"));
|
||||
DdlUsuario.SelectedValue = "-1";
|
||||
}
|
||||
|
||||
protected void CargaFechas()
|
||||
{
|
||||
txtFechaVencI.Text = FechaVencimientoInicio == "-1" ? "" : FechaVencimientoInicio;
|
||||
txtFechaVencF.Text = FechaVencimientoFin == "-1" ? "" : FechaVencimientoFin;
|
||||
|
||||
txtFechaI.Text = FechaInicio == "-1" ? "" : FechaInicio;
|
||||
txtFechaF.Text = FechaFin == "-1" ? "" : FechaFin;
|
||||
}
|
||||
|
||||
protected void CargaEstatus()
|
||||
{
|
||||
|
||||
DdlEstatus.Items.Insert(0, new ListItem("Todos", "-1"));
|
||||
DdlEstatus.Items.Insert(1, new ListItem("Vigente", "1"));
|
||||
DdlEstatus.Items.Insert(2, new ListItem("No Vigente", "2"));
|
||||
DdlEstatus.SelectedValue = "-1";
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region "BOTONES"
|
||||
|
||||
protected void BtnConsultar_Click(object sender, EventArgs e)
|
||||
{
|
||||
FechaInicio = txtFechaI.Text == "" ? "-1" : txtFechaI.Text;
|
||||
FechaFin = txtFechaF.Text == "" ? "-1" : txtFechaF.Text;
|
||||
|
||||
FechaVencimientoInicio = txtFechaVencI.Text == "" ? "-1" : txtFechaVencI.Text;
|
||||
FechaVencimientoFin = txtFechaVencF.Text == "" ? "-1" : txtFechaVencF.Text;
|
||||
|
||||
CveCliente = Convert.ToInt32(DdlCliente.SelectedValue);
|
||||
CveUsuario = Convert.ToInt32(DdlUsuario.SelectedValue);
|
||||
CveEstatus = Convert.ToInt32(DdlEstatus.SelectedValue);
|
||||
|
||||
CargaDatos();
|
||||
}
|
||||
|
||||
protected void linkAgregar_Click(object sender, EventArgs e)
|
||||
{
|
||||
limpiarCamposModal();
|
||||
EsEditar = 0;
|
||||
|
||||
txth4Refrendo.InnerText = "Agregar Refrendo";
|
||||
BtnGuardarRefrendo.Text = "Guardar";
|
||||
|
||||
UPModalRefrendo.Update();
|
||||
|
||||
this.RegistraScript("$('#DvModalRefrendo').modal();");
|
||||
}
|
||||
|
||||
protected void imgE_Click(object sender, EventArgs e)
|
||||
{
|
||||
limpiarCamposModal();
|
||||
|
||||
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
CveRefrendo = GvRow.DataKey("CveRefrendo").ToEntero();
|
||||
|
||||
EsEditar = 1;
|
||||
|
||||
String cliente = GvRow.DataKey("CveCliente").ToString();
|
||||
if (cliente == String.Empty)
|
||||
{
|
||||
DdlClientesRef.SelectedValue = "0";
|
||||
TxtClienteEspecifico.Text = GvRow.DataKey("Cliente").ToString();
|
||||
TxtClienteEspecifico.Visible = true;
|
||||
LblClienteEspecifico.Text = "Cliente Específico:";
|
||||
LblClienteEspecifico.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
DdlClientesRef.SelectedValue = GvRow.DataKey("CveCliente").ToString();
|
||||
}
|
||||
|
||||
String estatus = GvRow.DataKey("CveEstatus").ToString();
|
||||
if (estatus == String.Empty)
|
||||
{
|
||||
DdlEstatusRefrendo.SelectedValue = "-1";
|
||||
}
|
||||
else
|
||||
{
|
||||
DdlEstatusRefrendo.SelectedValue = GvRow.DataKey("CveEstatus").ToString();
|
||||
}
|
||||
|
||||
String tipoDocto = GvRow.DataKey("CveTipoDocto").ToString();
|
||||
if (tipoDocto == String.Empty)
|
||||
{
|
||||
DdlTipoDocto.SelectedValue = "-1";
|
||||
}
|
||||
else
|
||||
{
|
||||
DdlTipoDocto.SelectedValue = GvRow.DataKey("CveTipoDocto").ToString();
|
||||
if (tipoDocto.ToEntero() == 4)
|
||||
{
|
||||
DivLigaDocto.Visible = true;
|
||||
TxtLigaDocumento.Text = GvRow.DataKey("LigaDocto").ToString();
|
||||
}
|
||||
}
|
||||
|
||||
TxtCodigoProveedor.Text = GvRow.DataKey("CodigoProveedor").ToString();
|
||||
TxtDescripcion.Text = GvRow.DataKey("Descripcion").ToString();
|
||||
txtFecha.Text = GvRow.DataKey("Fecha").ToString();
|
||||
txtFechaVenc.Text = GvRow.DataKey("FechaVencimiento").ToString();
|
||||
|
||||
txth4Refrendo.InnerText = "Editar Refrendo";
|
||||
BtnGuardarRefrendo.Text = "Actualizar";
|
||||
|
||||
UPModalRefrendo.Update();
|
||||
|
||||
this.RegistraScript("$('#DvModalRefrendo').modal();");
|
||||
}
|
||||
|
||||
protected void BtnGuardarRefrendo_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClsContratos ObjContrato = new ClsContratos();
|
||||
|
||||
String Descripcion = TxtDescripcion.Text;
|
||||
int CveClienteA = DdlClientesRef.SelectedValue.ToEntero();
|
||||
|
||||
DateTime Fecha = Convert.ToDateTime(txtFecha.Text);
|
||||
DateTime FechaVen = Convert.ToDateTime(txtFechaVenc.Text);
|
||||
|
||||
int UsuarioCreo = UsuarioActual.CveUsuario;
|
||||
|
||||
String ClienteEsp = null;
|
||||
|
||||
if (TxtClienteEspecifico.Text != "" || TxtClienteEspecifico.Text != String.Empty)
|
||||
{
|
||||
ClienteEsp = TxtClienteEspecifico.Text;
|
||||
}
|
||||
|
||||
String CodigoProveedor = TxtCodigoProveedor.Text;
|
||||
int CveEstatus = DdlEstatusRefrendo.SelectedValue.ToEntero();
|
||||
int CveTipoDocto = DdlTipoDocto.SelectedValue.ToEntero();
|
||||
String LigaDocto = TxtLigaDocumento.Text == "" ? "-1" : TxtLigaDocumento.Text;
|
||||
|
||||
ObjContrato.IniciaTransacSQL();
|
||||
|
||||
bool TieneError = false;
|
||||
|
||||
if (EsEditar == 0)
|
||||
{
|
||||
TieneError = !ObjContrato.AddRefrendo(CveClienteA, Descripcion, Fecha, FechaVen, UsuarioCreo, CveEmpresa, ClienteEsp, CodigoProveedor, CveTipoDocto,CveEstatus, LigaDocto);
|
||||
|
||||
if (TieneError)
|
||||
{
|
||||
ObjContrato.RollBack();
|
||||
}
|
||||
else
|
||||
{
|
||||
ObjContrato.Commit();
|
||||
Alert("El Refrendo fue creado correctamente.", ModExtensiones.TipoMensaje.MsgInformacion);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
TieneError = !ObjContrato.UpdateRefrendo(CveRefrendo, CveClienteA, Descripcion, Fecha, FechaVen, ClienteEsp, CodigoProveedor, CveTipoDocto, CveEstatus, LigaDocto);
|
||||
|
||||
if (TieneError)
|
||||
{
|
||||
ObjContrato.RollBack();
|
||||
}
|
||||
else
|
||||
{
|
||||
ObjContrato.Commit();
|
||||
Alert("El Refrendo fue actualizado correctamente.", ModExtensiones.TipoMensaje.MsgInformacion);
|
||||
}
|
||||
}
|
||||
|
||||
ObjContrato.Dispose();
|
||||
limpiarCamposModal();
|
||||
this.RegistraScript("$('#DvModalRefrendo').modal('hide');");
|
||||
CargaDatos();
|
||||
|
||||
}
|
||||
|
||||
protected void GvRefrendos_RowDeleting(object sender, GridViewDeleteEventArgs e)
|
||||
{
|
||||
ClsContratos ObjContrato = new ClsContratos();
|
||||
ObjContrato.IniciaTransacSQL();
|
||||
|
||||
int CveRefrendo = GvRefrendos.Rows[e.RowIndex].DataKey("CveRefrendo").ToEntero();
|
||||
|
||||
bool TieneError = !ObjContrato.RemoveRefrendo(CveRefrendo);
|
||||
|
||||
if (TieneError)
|
||||
{
|
||||
ObjContrato.RollBack();
|
||||
Alert("Error al eliminar el Refrendo.", ModExtensiones.TipoMensaje.MsgError);
|
||||
}
|
||||
else
|
||||
{
|
||||
ObjContrato.Commit();
|
||||
Alert("El Refrendo ha sido eliminado.", ModExtensiones.TipoMensaje.MsgInformacion);
|
||||
}
|
||||
ObjContrato.Dispose();
|
||||
CargaDatos();
|
||||
}
|
||||
|
||||
protected void ImgImprimir_Click(object sender, EventArgs e)
|
||||
{
|
||||
GenerarPDF();
|
||||
}
|
||||
|
||||
protected void ImgExcel_Click(object sender, EventArgs e)
|
||||
{
|
||||
GenerarPDF("Excel");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region "PDF"
|
||||
|
||||
private void GenerarPDF(string Formato = "PDF")
|
||||
{
|
||||
List<ReportParameter> @params = new List<ReportParameter>();
|
||||
|
||||
@params.Add(new ReportParameter("FechaInicio", txtFechaI.Text));
|
||||
@params.Add(new ReportParameter("FechaActual", DateTime.Now.ToShortDateString()));
|
||||
@params.Add(new ReportParameter("FechaFin", txtFechaF.Text));
|
||||
@params.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
|
||||
@params.Add(new ReportParameter("FechaImpresion", DateTime.Now.ToShortDateString()));
|
||||
@params.Add(new ReportParameter("Cliente", DdlCliente.SelectedItem.Text));
|
||||
@params.Add(new ReportParameter("Usuario", DdlUsuario.SelectedItem.Text));
|
||||
@params.Add(new ReportParameter("FechaVencInicio", txtFechaVencI.Text));
|
||||
@params.Add(new ReportParameter("FechaVencFin", txtFechaVencF.Text));
|
||||
@params.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa));
|
||||
@params.Add(new ReportParameter("Estatus", DdlEstatus.SelectedItem.Text));
|
||||
|
||||
var logouri = string.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa);
|
||||
System.IO.FileInfo Imagen = new System.IO.FileInfo(string.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta));
|
||||
|
||||
if (Imagen.Exists)
|
||||
{
|
||||
@params.Add(new ReportParameter("LogoPath", logouri));
|
||||
}
|
||||
else
|
||||
{
|
||||
@params.Add(new ReportParameter("LogoPath", ""));
|
||||
}
|
||||
|
||||
ImprimirPDF("Empresas/Grales/Formatos/FormatoRefrendo.rdlc", TmpDT, @params, "FormatoRefrendo", Formato);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region "MODAL"
|
||||
|
||||
protected void DdlClientesRef_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (DdlClientesRef.SelectedValue.ToString() == "0")
|
||||
{
|
||||
TxtClienteEspecifico.Visible = true;
|
||||
LblClienteEspecifico.Text = "Cliente Específico:";
|
||||
LblClienteEspecifico.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
TxtClienteEspecifico.Visible = false;
|
||||
TxtClienteEspecifico.Text = "";
|
||||
|
||||
LblClienteEspecifico.Text = "";
|
||||
LblClienteEspecifico.Visible = false;
|
||||
}
|
||||
UPModalRefrendo.Update();
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected void DdlTipoDocto_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (DdlTipoDocto.SelectedValue.ToString() == "4")
|
||||
{
|
||||
DivLigaDocto.Visible = true;
|
||||
TxtLigaDocumento.Text = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
DivLigaDocto.Visible = false;
|
||||
TxtLigaDocumento.Text = "";
|
||||
}
|
||||
UPModalRefrendo.Update();
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
146
Contratos/CatSecciones.aspx
Normal file
146
Contratos/CatSecciones.aspx
Normal file
@@ -0,0 +1,146 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatSecciones.aspx.vb" Inherits="Contratos_CatSecciones" %>
|
||||
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<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="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de Secciones
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table class="table table-striped table-advance table-hover">
|
||||
<thead>
|
||||
<tr class="Titulos">
|
||||
<th width="250px">
|
||||
<asp:LinkButton ID="LbSeccion" runat="server" CausesValidation="false" Text="" CommandArgument="Seccion" OnClick="LbOrden_Click">
|
||||
Sección
|
||||
<asp:Literal ID="ImgSeccion" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="80px">
|
||||
<asp:LinkButton ID="LbOrden" runat="server" CausesValidation="false" Text="" CommandArgument="Orden" OnClick="LbOrden_Click">
|
||||
Orden
|
||||
<asp:Literal ID="ImgOrden" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus" OnClick="LbOrden_Click">
|
||||
Estatus
|
||||
<asp:Literal ID="ImgEstatus" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng" OnClick="LbOrden_Click">
|
||||
Fecha Ing
|
||||
<asp:Literal ID="ImgFechaIng" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click">
|
||||
Usuario
|
||||
<asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="165px">Comandos</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtSeccion" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="240px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVSeccion" runat="server" ControlToValidate="TxtSeccion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Seccion''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCSeccion" runat="server" HighlightCssClass="vco" TargetControlID="RFVSeccion" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtOrden" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="70px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVOrden" runat="server" ControlToValidate="TxtOrden" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Orden''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOrden" runat="server" HighlightCssClass="vco" TargetControlID="RFVOrden" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtOrden" FilterType="Custom, Numbers" />
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td style="text-align: center">
|
||||
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
|
||||
</tr>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveSeccion" EmptyDataText="No se encontraron Secciones Registrados" ToolTip="Listado de Secciones" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlSeccion" runat="server" Text='<%# Eval("Seccion", "{0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtSeccion" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Seccion") %>' ValidationGroup="GrpGV" Width="240px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVSeccion" runat="server" ControlToValidate="TxtSeccion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Seccion''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCSeccion" runat="server" HighlightCssClass="vco" TargetControlID="RFVSeccion" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlOrden" runat="server" Text='<%# Eval("Orden", "{0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtOrden" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Orden") %>' ValidationGroup="GrpGV" Width="70px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVOrden" runat="server" ControlToValidate="TxtOrden" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Orden''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOrden" runat="server" HighlightCssClass="vco" TargetControlID="RFVOrden" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEstado" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:CheckBox ID="ChkEstado" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Editar">
|
||||
<EditItemTemplate>
|
||||
<center>
|
||||
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
|
||||
<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||
</center>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Eliminar">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="confirmar" data-btn-ok-label="si" OnClientClick="javascript:return C();" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script language="javascript" type="text/javascript">
|
||||
function C() {
|
||||
return confirm('¿Está seguro que desea eliminar el Sección?');
|
||||
}
|
||||
</script>
|
||||
</asp:Content>
|
||||
202
Contratos/CatSecciones.aspx.vb
Normal file
202
Contratos/CatSecciones.aspx.vb
Normal file
@@ -0,0 +1,202 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Linq
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class Contratos_CatSecciones
|
||||
Inherits ClsPaginas
|
||||
|
||||
Public Property PuedeEditar As Boolean
|
||||
Get
|
||||
Return CBool(ViewState("PuedeEditar"))
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("PuedeEditar") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property PuedeEliminar As Boolean
|
||||
Get
|
||||
Return CBool(ViewState("PuedeEditar"))
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("PuedeEditar") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
ViewState("Orden") = ""
|
||||
CargaDatos()
|
||||
|
||||
''Permiso Registro
|
||||
'If PermisoRegistro Then
|
||||
' LbAgregar.Enabled = True
|
||||
'Else
|
||||
' LbAgregar.Enabled = False
|
||||
'End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub CargaDatos()
|
||||
Dim ObjSecciones As New ClsContratos
|
||||
If ObjSecciones.GetSecciones() Then
|
||||
ViewState("DTSecciones") = ObjSecciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTContratosSecciones = ObjSecciones.DtResultados
|
||||
Else
|
||||
Me.GvDatos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjSecciones.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
|
||||
Dim ObjSecciones As New ClsContratos
|
||||
If ObjSecciones.AddSecciones(TxtSeccion.Text.Trim, TxtOrden.Text.Trim.ToDouble, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
TxtSeccion.Text = ""
|
||||
TxtOrden.Text = ""
|
||||
Alert("La nueva Sección se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
UpTitulos.Update()
|
||||
ViewState("DTSecciones") = ObjSecciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTContratosSecciones = ObjSecciones.DtResultados
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End If
|
||||
ObjSecciones.Dispose()
|
||||
End Sub
|
||||
|
||||
#Region "G V D A T O S"
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(256)
|
||||
e.Row.Cells(1).Width = Unit.Pixel(86)
|
||||
e.Row.Cells(2).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(3).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(4).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(5).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(6).Width = Unit.Pixel(65)
|
||||
End If
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
||||
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Center
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim ObjSecciones As New ClsContratos
|
||||
If ObjSecciones.RemoveSecciones(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
GvDatos.EditIndex = -1
|
||||
ViewState("DTSecciones") = ObjSecciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTContratosSecciones = ObjSecciones.DtResultados
|
||||
Alert("La Sección se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjSecciones.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
|
||||
GvDatos.EditIndex = -1
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
|
||||
|
||||
Dim ObjSecciones As New ClsContratos
|
||||
|
||||
Dim Seccion As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtSeccion"), TextBox).Text.Trim
|
||||
Dim Orden As Double = CDbl(DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtOrden"), TextBox).Text.Trim)
|
||||
Dim Estatus As Integer = CInt(GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstado").Checked)
|
||||
Dim CveSeccion As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
|
||||
|
||||
If ObjSecciones.UpdateSecciones(Seccion, Estatus, Orden, CveSeccion) Then
|
||||
GvDatos.EditIndex = -1
|
||||
ViewState("DTSecciones") = ObjSecciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTContratosSecciones = ObjSecciones.DtResultados
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjSecciones.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
|
||||
GvDatos.EditIndex = e.NewEditIndex
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "O R D E N A M I E N T O"
|
||||
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Dim Orden As String = ""
|
||||
Dim Campo As String = ""
|
||||
Dim Literal As Literal = Nothing
|
||||
Const OrdenInicial As String = ""
|
||||
Dim Arg(2) As String
|
||||
|
||||
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
|
||||
Campo = Arg(0)
|
||||
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
|
||||
|
||||
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
|
||||
Else
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
|
||||
End If
|
||||
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
|
||||
ViewState("Orden") = Orden
|
||||
CargaGrid(Orden)
|
||||
End Sub
|
||||
|
||||
Private Sub CargaGrid(Orden As String)
|
||||
If Orden <> String.Empty Then
|
||||
Dim DV As New DataView(CType(ViewState("DTSecciones"), DataTable), "", Orden, DataViewRowState.CurrentRows)
|
||||
GvDatos.DataSource = DV.ToTable()
|
||||
DV.Dispose()
|
||||
Else
|
||||
GvDatos.DataSource = CType(ViewState("DTSecciones"), DataTable)
|
||||
End If
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
End Class
|
||||
2614
Contratos/Contrato.aspx
Normal file
2614
Contratos/Contrato.aspx
Normal file
File diff suppressed because it is too large
Load Diff
4287
Contratos/Contrato.aspx.vb
Normal file
4287
Contratos/Contrato.aspx.vb
Normal file
File diff suppressed because it is too large
Load Diff
2650
Contratos/Contrato.vb
Normal file
2650
Contratos/Contrato.vb
Normal file
File diff suppressed because it is too large
Load Diff
252
Contratos/ContratoAvance.aspx
Normal file
252
Contratos/ContratoAvance.aspx
Normal file
@@ -0,0 +1,252 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="ContratoAvance.aspx.vb" Inherits="Contratos_ContratoAvance" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
|
||||
<style>
|
||||
table.GVEstimacion{
|
||||
width:100%;
|
||||
}
|
||||
.txtimporte{
|
||||
background: transparent;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.txtcant,.txtimporte,
|
||||
table.GVEstimacion > tbody > tr > td,
|
||||
table.GVEstimacion > tbody > tr > th{
|
||||
text-align:right;
|
||||
}
|
||||
table.GVEstimacion > tbody > tr > th,
|
||||
table.GVEstimacion > tbody > tr > td{
|
||||
width:100px;
|
||||
}
|
||||
table.GVEstimacion > tbody > tr > th:nth-child(1),
|
||||
table.GVEstimacion > tbody > tr > td:nth-child(1){
|
||||
width:300px;
|
||||
text-align:left;
|
||||
}
|
||||
.ddls {
|
||||
max-width:220px;
|
||||
}
|
||||
.linkfile input{
|
||||
display:none
|
||||
}
|
||||
</style>
|
||||
|
||||
<link href="/Metronic/assets/global/plugins/dropzone/css/dropzone.css" rel="stylesheet"/>
|
||||
</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="C" runat="Server">
|
||||
|
||||
<asp:UpdatePanel ID="UPPDatos" 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="BtnConsultar" runat="server" ValidationGroup="GrpConsultar" Text="Consultar" class="btn btn-default" />
|
||||
</div>
|
||||
<div class="titlefiltros caption" style="position: relative;">
|
||||
<asp:UpdatePanel class="row" ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<label class="col-md-1 truncate">Contrato:</label>
|
||||
<div class="col-md-6 col-lg-4">
|
||||
<div class="ddls">
|
||||
<asp:DropDownList ID="DdlContratos" runat="server" AutoPostBack="true" DataTextField="ContratoCompleto" DataValueField="CveContrato" Class=" form-control input-inline select2me" Width="100%">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2 col-lg-2">
|
||||
<asp:DropDownList ID="DdlAvances" runat="server" DataTextField="Name" DataValueField="Fecha" Class=" form-control input-inline select2me" Width="100%">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
|
||||
<asp:TextBox ID="TxtFecha" runat="server" CssClass="form-control" CausesValidation="true" Style="width: 118px" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="ImgFecha" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEEFecha" runat="server" TargetControlID="TxtFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CEFecha" TargetControlID="TxtFecha" PopupButtonID="ImgFecha" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVFecha" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="CVFecha" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOFecha1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFecha" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOFecha2" runat="server" HighlightCssClass="vco" TargetControlID="CVFecha" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<a class="linkfile" id="btnanexogral" runat="server" >
|
||||
<span class="btn btn-circle btn-sm btn-success"><i class='fa fa-plus'></i></span>Agregar
|
||||
<asp:TextBox ID="AnexoGral" Text='' runat="server"></asp:TextBox>
|
||||
</a>
|
||||
</div>
|
||||
<table class="table table-striped Widthall">
|
||||
<tr>
|
||||
<th style="width: 300px;"></th>
|
||||
<th style="width: 100px;"></th>
|
||||
<th style="width: 100px;"></th>
|
||||
<th style="width: 100px;"></th>
|
||||
<th style="width: 100px;"></th>
|
||||
<th style="width: 100px;"></th>
|
||||
<th style="width: 100px;"></th>
|
||||
<th style="width: 100px;"></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Producto / Servicio</th>
|
||||
<th colspan="2">Avance</th>
|
||||
<th colspan="2">Ultimo Avance</th>
|
||||
<th colspan="2">Levantamiento</th>
|
||||
<th style="text-align: right;">Anexo</th>
|
||||
</tr>
|
||||
</table>
|
||||
<asp:GridView ID="Gv" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron partidas para levantar avance"
|
||||
DataKeyNames="CveFamilias,CveSubFamilias,CveContratoDetalle,PS,Cantidad,Importe,Cantidad_Ultima,Importe_Ultima,PU,CantidadMax,Avance"
|
||||
CssClass="table GVEstimacion table-advance table-hover" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="Producto" runat="server" CssClass="Texto" Text='<%# Eval("PS")%>' ></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Cantidad">
|
||||
<ItemTemplate>
|
||||
<span><%# Eval("Cantidad", "{0:N2}")%></span>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Importe">
|
||||
<ItemTemplate>
|
||||
<span><%# Eval("Importe", "{0:N2}")%></span>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Cantidad">
|
||||
<ItemTemplate>
|
||||
<span><%# Eval("Cantidad_Ultima", "{0:N2}")%></span>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Importe">
|
||||
<ItemTemplate>
|
||||
<span><%# Eval("Importe_Ultima", "{0:N2}")%></span>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Cantidad">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtCantidad" Text="" CssClass="txtcant" onkeyup="ValidateCant(this)" type="number" step="any" data-cantidad='<%# Eval("CantidadMax")%>' data-pu='<%# Eval("PU")%>' data-cve='<%# Eval("CveContratoDetalle") %>' Width="90" runat="server"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Importe">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtImporte" Text="" data-cve='<%# Eval("CveContratoDetalle") %>' CssClass="txtimporte" type="number" step="any" Width="90" runat="server"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText=" ">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LnkAnexo" runat="server" OnClick="GetAnexos" AlternateText="Agregar Anexo" CssClass="btn btn-circle btn-sm btn-success anexo" Text="<i class='fa fa-folder'></i>" />
|
||||
<a class="btn btn-circle btn-sm btn-success hidden linkfile">
|
||||
<i class='fa fa-plus'></i><asp:TextBox ID="TXTAnexo" CssClass="hidden" runat="server"></asp:TextBox>
|
||||
</a>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<div class="text-center"><asp:Button id="BtnGuardar" CssClass="btn btn-primary" runat="server" Text="Guardar" Visible="false" /></div>
|
||||
<asp:GridView ID="GvAnexos" AutoGenerateColumns="false" runat="server" ShowHeaderWhenEmpty="true" EmptyDataText="No se encontraron archivos">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Archivo">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HPLArchivo" runat="server"></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
<div class="modal fade " id="dropmodal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content ">
|
||||
<div class="portlet light smmallpadding bordered ">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span class="caption-subject bold uppercase">Dropzone</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
<a href="javascript:$('#dropmodal').modal('hide');" style="color:gray;" ><i class="fa fa-remove"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body ">
|
||||
<div id="my-dropzone" class="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/Metronic/assets/global/plugins/dropzone/dropzone.js"></script>
|
||||
|
||||
<%--<script src="../Scripts/dropzone/dropzone.min.js"></script>--%>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" Runat="Server">
|
||||
|
||||
<script>
|
||||
|
||||
jQuery(document).ready(function () {
|
||||
|
||||
$(".linkfile").click(function () {
|
||||
showmodalFile($(this).find('input').attr('id'));
|
||||
});
|
||||
Sys.Application.add_load(function (s, e) {
|
||||
$(".linkfile").click(function () {
|
||||
showmodalFile($(this).find('input').attr('id'));
|
||||
});
|
||||
});
|
||||
});
|
||||
function showmodalFile(obj) {
|
||||
$('#' + obj).data("append", 'my-dropzone');<% Dim url = Request.Url.AbsoluteUri.Replace(Request.Url.AbsolutePath, "")%>
|
||||
$('#' + obj).data("urlup", '<%= url%>/Ashx/SIGWeb.ashx?Metodo=Uploadfile');
|
||||
$('#' + obj).data("urldown", '<%= url%>/Ashx/SIGWeb.ashx');
|
||||
$('#' + obj).data("urlget", '<%= url %>/Temp/');
|
||||
ADDropzone(obj);
|
||||
$('#dropmodal').modal();
|
||||
}
|
||||
function ValidateCant(variable){
|
||||
var txt = $(variable);
|
||||
var max = txt.data('cantidad');
|
||||
var value = parseInt(txt.val());
|
||||
if (value > max) {
|
||||
txt.val(max);
|
||||
}
|
||||
if (value < 0) {
|
||||
txt.val(0);
|
||||
}
|
||||
var importe = $('.txtimporte[data-cve="' + txt.data('cve') + '"]');
|
||||
importe.val(parseFloat(txt.val()) * parseFloat(txt.data('pu')));
|
||||
FormatoMoneda2(importe);
|
||||
if (parseInt(txt.val()) > 0) {
|
||||
$($(txt.parent()).parent()).find(".linkfile").removeClass("hidden");
|
||||
} else {
|
||||
var ocultar = $($(txt.parent()).parent()).find(".linkfile");
|
||||
if (!ocultar.hasClass("hidden")) {
|
||||
ocultar.addClass("hidden");
|
||||
}
|
||||
}
|
||||
}
|
||||
//);
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
234
Contratos/ContratoAvance.aspx.vb
Normal file
234
Contratos/ContratoAvance.aspx.vb
Normal file
@@ -0,0 +1,234 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.IO
|
||||
Imports System.Data
|
||||
Imports Newtonsoft.Json
|
||||
|
||||
Partial Class Contratos_ContratoAvance
|
||||
Inherits ClsPaginas
|
||||
#Region "Propiedades"
|
||||
Private Property DtDatos As DataTable
|
||||
Get
|
||||
If ViewState("DtDatos") Is Nothing Then
|
||||
Return Nothing
|
||||
Else
|
||||
Return CType(ViewState("DtDatos"), DataTable)
|
||||
End If
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtDatos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CveContrato As Integer
|
||||
Get
|
||||
If ViewState("CveContrato") Is Nothing Then
|
||||
Return Nothing
|
||||
Else
|
||||
Return ViewState("CveContrato").ToString.ToEntero
|
||||
End If
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveContrato") = value
|
||||
End Set
|
||||
End Property
|
||||
'fecha seleccionada del historico de avances
|
||||
Private Property fecha As String
|
||||
Get
|
||||
If ViewState("fecha") Is Nothing Then
|
||||
Return ""
|
||||
Else
|
||||
Return ViewState("fecha").ToString
|
||||
End If
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("fecha") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
BtnGuardar.Visible = False
|
||||
btnanexogral.Visible = False
|
||||
CargaContrato()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region "Filtros"
|
||||
|
||||
Private Sub CargaContrato()
|
||||
DdlContratos.DataSource = GlobalDTContratos.FiltraParametros(String.Format("CveContratoTipo=4"))
|
||||
DdlContratos.DataBind()
|
||||
CargaddlAvance()
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlContratos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlContratos.SelectedIndexChanged
|
||||
CargaddlAvance()
|
||||
End Sub
|
||||
Private Sub CargaddlAvance()
|
||||
DdlAvances.Items.Clear()
|
||||
Dim ObjContratos As New ClsContratos()
|
||||
If ObjContratos.GetContratosAvanceFecha(DdlContratos.SelectedValue.ToEntero, 2) Then
|
||||
DdlAvances.DataSource = ObjContratos.DtResultados
|
||||
End If
|
||||
ObjContratos.Dispose()
|
||||
DdlAvances.DataBind()
|
||||
DdlAvances.Items.Insert(0, New ListItem(" ---- ", "-1"))
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||
CveContrato = DdlContratos.SelectedValue.ToEntero
|
||||
CargaDatosAvance()
|
||||
End Sub
|
||||
Private Sub CargaDatosAvance()
|
||||
GvAnexos.Visible = False
|
||||
Dim ObjContratos As New ClsContratos()
|
||||
If DdlAvances.SelectedValue = "-1" Then
|
||||
If ObjContratos.GetContratosAvanceTodos(CveContrato, 2) Then
|
||||
fecha = ""
|
||||
DtDatos = ObjContratos.DtResultados
|
||||
If ObjContratos.DtResultados.Rows.Count > 0 Then
|
||||
BtnGuardar.Visible = True
|
||||
btnanexogral.Visible = True
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
If ObjContratos.GetContratosAvanceHistoricos(CveContrato, 2, DdlAvances.SelectedValue) Then
|
||||
fecha = DdlAvances.SelectedValue
|
||||
DtDatos = ObjContratos.DtResultados
|
||||
BtnGuardar.Visible = False
|
||||
btnanexogral.Visible = False
|
||||
End If
|
||||
End If
|
||||
ObjContratos.Dispose()
|
||||
CargaGrid()
|
||||
End Sub
|
||||
|
||||
#Region "GV"
|
||||
Private Sub CargaGrid()
|
||||
If DtDatos IsNot Nothing Then
|
||||
If ViewState("Orden") Is Nothing Then
|
||||
Gv.DataSource = DtDatos
|
||||
Else
|
||||
Gv.DataSource = DtDatos.FiltraParametros("", ViewState("Orden").ToString)
|
||||
End If
|
||||
Gv.DataBind()
|
||||
Else
|
||||
Alert("no se encontraron productos en el presupuesto")
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub GV_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles Gv.RowDataBound
|
||||
If e.Row.RowIndex > -1 Then
|
||||
e.Row.FCTextBox("TxtCantidad").Visible = (fecha = "")
|
||||
e.Row.FCLinkButton("LnkAnexo").Visible = Not (fecha = "")
|
||||
If e.Row.DBCampo("CveContratoDetalle").ToString.ToEntero = 0 Then
|
||||
e.Row.FCTextBox("TxtCantidad").Visible = False
|
||||
e.Row.FCLinkButton("LnkAnexo").Visible = False
|
||||
|
||||
If e.Row.DBCampo("CveSubFamilias").ToString.ToEntero = 0 Then
|
||||
If e.Row.DBCampo("CveFamilias").ToString.ToEntero = 0 Then
|
||||
e.Row.CssClass = "SubTotales"
|
||||
Else
|
||||
e.Row.CssClass = "SubTotales2"
|
||||
End If
|
||||
Else
|
||||
e.Row.CssClass = "SubTotales3"
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub GetAnexos(sender As Object, e As System.EventArgs)
|
||||
'Get the button that raised the event
|
||||
Dim btn As LinkButton = DirectCast(sender, LinkButton)
|
||||
Dim gvr As GridViewRow = DirectCast(btn.NamingContainer, GridViewRow)
|
||||
Dim CveContratoDetalle As Integer = gvr.DataKey("CveContratoDetalle").ToString.ToEntero
|
||||
Dim objContrato As New ClsContratos
|
||||
If objContrato.GetContratosAvanceAnexos(CveContratoDetalle, fecha, UsuarioActual.CveUsuario) Then
|
||||
GvAnexos.DataSource = objContrato.DtResultados
|
||||
GvAnexos.DataBind()
|
||||
GvAnexos.Visible = True
|
||||
Else
|
||||
GvAnexos.Visible = False
|
||||
End If
|
||||
objContrato.Dispose()
|
||||
End Sub
|
||||
Protected Sub GvAnexos_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles GvAnexos.RowDataBound
|
||||
If e.Row.RowIndex > -1 Then
|
||||
Dim Archivo As String = e.Row.DBCampo("Archivo").ToString
|
||||
Dim start As Integer = Len(Archivo.Split("-"c)(0))
|
||||
Dim link As HyperLink = e.Row.FCHyperLink("HPLArchivo")
|
||||
link.Text = Archivo.Substring(start + 1)
|
||||
link.NavigateUrl = String.Format("/Empresas/{0}/Contrato/{1}/Anexos/{2}", UsuarioActual.CveEmpresa, CveContrato, Archivo)
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
|
||||
Dim ObjContratos As New ClsContratos
|
||||
ObjContratos.IniciaTransacSQL()
|
||||
Dim TieneError = False
|
||||
Dim CveContratoDetalle As Integer
|
||||
Dim Cantidad As Double
|
||||
Dim filesgral As List(Of Archivo) = AnexoGral.getfiles().Archivos
|
||||
Dim guardarArchivos As New List(Of Archivo)
|
||||
For Each gvr As GridViewRow In Gv.Rows
|
||||
CveContratoDetalle = gvr.DataKey("CveContratoDetalle").ToEntero
|
||||
If CveContratoDetalle > 0 Then
|
||||
Cantidad = gvr.FCTextBox("TxtCantidad").Text.ToDouble
|
||||
If Cantidad > 0 Then
|
||||
If ObjContratos.AddContratosAvance(CveContratoDetalle, Cantidad, TxtFecha.Text.ToDateTime, UsuarioActual.CveUsuario) Then
|
||||
Dim CveContratoAvance As Integer = ObjContratos.DtResultados.Rows(0)("CveContratoAvance").ToString.ToEntero
|
||||
Dim files As List(Of Archivo) = gvr.FCTextBox("TXTAnexo").getfiles().Archivos
|
||||
|
||||
For Each fileItem As Archivo In filesgral
|
||||
guardarArchivos.Add(fileItem)
|
||||
If Not ObjContratos.AddContratosAvanceAnexo(CveContratoAvance, fileItem.filename, UsuarioActual.CveUsuario) Then
|
||||
TieneError = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
For Each fileItem As Archivo In files
|
||||
guardarArchivos.Add(fileItem)
|
||||
If Not ObjContratos.AddContratosAvanceAnexo(CveContratoAvance, fileItem.filename, UsuarioActual.CveUsuario) Then
|
||||
TieneError = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
TieneError = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
If TieneError Then
|
||||
ObjContratos.RollBack()
|
||||
Alert("No se logro guardar el Presupuesto favor de intentarlo mas tarde o comuniquese con soporte", TipoMensaje.MsgAdvertencia)
|
||||
Else
|
||||
Dim urlsave As String = String.Format("Empresas\{0}\Contrato\{1}\Anexos", UsuarioActual.CveEmpresa, CveContrato)
|
||||
For Each fileItem As Archivo In filesgral
|
||||
fileItem.filename.filesMove(fileItem.filename, urlsave)
|
||||
Next
|
||||
|
||||
For Each fileItem As Archivo In guardarArchivos
|
||||
fileItem.filename.filesMove(fileItem.filename, urlsave)
|
||||
Next
|
||||
ObjContratos.Commit()
|
||||
Alert("se guardo Correctamente")
|
||||
End If
|
||||
AnexoGral.Text = "[]"
|
||||
ObjContratos.Dispose()
|
||||
CargaddlAvance()
|
||||
CargaDatosAvance()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
|
||||
253
Contratos/Contratos.aspx
Normal file
253
Contratos/Contratos.aspx
Normal file
@@ -0,0 +1,253 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Contratos.aspx.vb" Inherits="Contratos_Contratos" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
|
||||
|
||||
<style>
|
||||
.dataTables_scrollHead{
|
||||
background-color:#DDD;
|
||||
color:white;
|
||||
}
|
||||
.table-scrollable{
|
||||
margin-top:0px!important;
|
||||
margin-bottom:0px!important;
|
||||
}
|
||||
|
||||
.Texto{
|
||||
text-align:left!important
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkPdf" runat="server"><i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExportar" runat="server"><i class="fa fa-ad-excel"></i> Generar Excel</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="LBAdd" PostBackUrl="/Contratos/Contrato.aspx" CommandArgument="-1" runat="server"><i class="fa fa-plus-circle"></i> Nuevo Contrato</asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</li>
|
||||
|
||||
<%--<img alt="Nuevo Contrato" title="Nuevo Contrato" onclick="document.location.href='/Contratos/Contrato.aspx'" src="/Imagenes/BotonAgregar.gif" style="cursor: pointer;" /> --%>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de Contratos
|
||||
</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" style="">
|
||||
<div class="portlet-title portlet-filterT" style="">
|
||||
<div class="tools">
|
||||
</div>
|
||||
<div class="titlefiltros caption Widthall" style="font-size:14px !important;">
|
||||
<div class="row">
|
||||
<div class="col-md-1" style="max-width:50PX;">
|
||||
Tipo:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlTipo" CssClass="form-control select2me input-sm" runat="server" AppendDataBoundItems="true" DataTextField="ContratoTipo" DataValueField="CveContratoTipo" Width="90%"></asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1" style="max-width:70PX;">
|
||||
Cliente:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlClientes" runat="server" CssClass="form-control select2me input-sm" AppendDataBoundItems="true" DataTextField="Nombre" DataValueField="CveCliente" Width="90%"></asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1" style="max-width:70PX;">
|
||||
Estatus:
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlEstatus" runat="server" AppendDataBoundItems="True" DataTextField="ContratoEstatus" DataValueField="CveContratoEstatus" CssClass="form-control select2me input-sm" Width="90%"></asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1" style="max-width:70PX;">
|
||||
Vendedor:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlVendedor" runat="server" CssClass="form-control select2me input-sm" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" Width="90%">
|
||||
<asp:ListItem Value="-1">Todos</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 col-md-offset-1">
|
||||
<asp:Button ID="BtnFiltrar" runat="server" CausesValidation="true" CssClass=" btn btn-primary " Text="Consultar" ValidationGroup="GrpFiltrar"></asp:Button></td>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<div align="right">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se Encontró Contrato Registrado"
|
||||
CssClass="table table-striped table-hover Widthall ScrollAD" GridLines="None" data-sort="true">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="No. Contrato">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HplNum" runat="server" CssClass="Texto" NavigateUrl='<%# Eval("CveContrato", "/Contratos/Contrato.aspx?CveContrato={0}")%>' Text='<%# Eval("NumeroContrato") %>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Descripcion">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlDescripcionContrato" runat="server" Text='<%# Eval("DescripcionContrato") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%-- <asp:TemplateField HeaderText="Responsable">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlResponsable" runat="server" Text='<%# Eval("Responsable") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>--%>
|
||||
<asp:TemplateField HeaderText="Razon Social" Visible="false" >
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlRazonSocial" runat="server" Text='<%# Eval("Contratante")%>' ></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Razon Social" ItemStyle-HorizontalAlign="Left" >
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HplNum" Width="250" runat="server" CssClass=" Texto truncate col-md-12" NavigateUrl='<%# Eval("CveCliente", "/Ventas/Clientes.aspx?CveCliente={0}")%>' Text='<%# Eval("NombreComercial") %>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
|
||||
<HeaderTemplate>
|
||||
Monto <br /> Adjudicado
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlMonto" runat="server" Text='<%# Eval("Monto", "{0:c}") %>' ></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Vendedor" HeaderStyle-Width="250">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlVendedor" runat="server" Text='<%# Eval("Vendedor") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="SubProyecto">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlSubProyectoContrato" runat="server" Text='<%# Eval("SubProyectoContrato") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100px">
|
||||
<HeaderTemplate>
|
||||
Fecha<br />Inicio
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaInicial", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Fecha Final" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100px">
|
||||
<HeaderTemplate>
|
||||
Fecha<br />Final
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFechaFinal" runat="server" Text='<%# Eval("FechaFinal", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="ContratoAvance" HeaderText="Avance" DataFormatString="{0:#,##0.00}%" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
|
||||
</Columns>
|
||||
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
</asp:GridView>
|
||||
|
||||
<%-- <asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se Encontró Contrato Registrado"
|
||||
CssClass="table table-striped table-hover Widthall ScrollAD" GridLines="None" data-sort="true">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="No. Contrato">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HplNum" runat="server" CssClass="Texto" NavigateUrl='<%# Eval("CveContrato", "/Contratos/Contrato.aspx?CveContrato={0}")%>' Text='<%# Eval("NumeroContrato") %>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Descripcion">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlDescripcionContrato" runat="server" Text='<%# Eval("DescripcionContrato") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Responsable">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlResponsable" runat="server" Text='<%# Eval("Responsable") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Razon Social" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlRazonSocial" runat="server" Text='<%# Eval("Contratante") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Cliente" ItemStyle-HorizontalAlign="Left" >
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HplNum" Width="250" runat="server" CssClass=" Texto truncate col-md-12" NavigateUrl='<%# Eval("CveCliente", "/Ventas/Clientes.aspx?CveCliente={0}")%>' Text='<%# Eval("NombreComercial") %>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Ubicacion">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlUbicacion" runat="server" Text='<%# Eval("Ubicacion") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Vendedor" HeaderStyle-Width="250">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlVendedor" runat="server" Text='<%# Eval("Vendedor") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="SubProyecto">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlSubProyectoContrato" runat="server" Text='<%# Eval("SubProyectoContrato") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEstatusContrato" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Fecha Ing.">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Usuario">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>
|
||||
Presupuesto
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="LtlSecciones" runat="server" Text='Ir' NavigateUrl='<%# "/Contratos/ContratosSecciones.aspx?CveContrato=" & Eval("CveContrato").ToString %>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
</asp:GridView>--%>
|
||||
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
|
||||
</asp:Content>
|
||||
114
Contratos/Contratos.aspx.vb
Normal file
114
Contratos/Contratos.aspx.vb
Normal file
@@ -0,0 +1,114 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class Contratos_Contratos
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
InicializaValores()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
#Region " Inicializa Valores "
|
||||
Private Sub InicializaValores()
|
||||
DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
|
||||
DdlClientes.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlClientes.DataBind()
|
||||
|
||||
DdlTipo.DataSource = GlobalDTContratosTipos().FiltraParametros($"CveEmpresa={UsuarioActual.CveEmpresa}")
|
||||
DdlTipo.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlTipo.DataBind()
|
||||
|
||||
Dim CveEstatusVigente = -1
|
||||
Dim ObjContratos As New ClsContratos
|
||||
ObjContratos.GetContratosEstatus(UsuarioActual.CveEmpresa)
|
||||
DdlEstatus.DataSource = ObjContratos.DtResultados
|
||||
CveEstatusVigente = ObjContratos.DtResultados.FiltroPrimeroValor("CveContratoEstatus", "TipoEstatus = 1", Orderby:="CveContratoEstatus").ToEntero
|
||||
DdlEstatus.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlEstatus.DataBind()
|
||||
|
||||
DdlEstatus.SelectedValueExist(If(CveEstatusVigente > 0, CveEstatusVigente, -1))
|
||||
ObjContratos.Dispose()
|
||||
|
||||
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
|
||||
DdlVendedor.DataBind()
|
||||
|
||||
CargaDatos()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " CARGA DATOS "
|
||||
Protected Sub BtnFiltrar_Click(sender As Object, e As EventArgs) Handles BtnFiltrar.Click
|
||||
CargaDatos()
|
||||
End Sub
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjContratos As New ClsContratos
|
||||
If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, DdlClientes.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero, TipoContrato:=DdlTipo.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero) Then
|
||||
|
||||
GvDatos.DataSource = ObjContratos.DtResultados
|
||||
Else
|
||||
Me.GvDatos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjContratos.Dispose()
|
||||
GvDatos.DataBind()
|
||||
UpTitulos.Update()
|
||||
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("Estatus").ToString = "True" Then
|
||||
' e.Row.Cells(7).Text = "Activo"
|
||||
'Else
|
||||
' e.Row.Cells(7).Text = "Inactivo"
|
||||
'End If
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "I M P R I M I R <i class='fa fa-print'></i>"
|
||||
Protected Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
|
||||
GvDatos.ExportToExcel("ReporteCompras" & Now.ToShortDateString)
|
||||
End Sub
|
||||
|
||||
Private Sub GenerarPDF()
|
||||
Dim ObjContratos As New ClsContratos
|
||||
If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, DdlClientes.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero, TipoContrato:=DdlTipo.SelectedValue.ToEntero) Then
|
||||
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 dt As DataTable = ObjContratos.DtResultados
|
||||
Dim Cliente = If(DdlClientes.SelectedValue = "-1", "", $" <b>Cliente:</b> {DdlClientes.SelectedItem.Text}")
|
||||
Dim Estatus = ($" <b>Estatus:</b> {DdlEstatus.SelectedItem.Text}")
|
||||
Dim params As New List(Of ReportParameter)
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("FechaInicio", "-1"))
|
||||
params.Add(New ReportParameter("FechaFin", "-1"))
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
params.Add(New ReportParameter("AgrupadoPor", $"<b>Agrupado Por:</b> {Cliente}{Estatus}"))
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepContratos.rdlc", dt, params, "ReporteContratos")
|
||||
Else
|
||||
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Protected Sub LnkPdf_Click(sender As Object, e As EventArgs) Handles LnkPdf.Click
|
||||
GenerarPDF()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
End Class
|
||||
262
Contratos/ContratosSecciones.aspx
Normal file
262
Contratos/ContratosSecciones.aspx
Normal file
@@ -0,0 +1,262 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="ContratosSecciones.aspx.vb" Inherits="Contratos_ContratosSecciones" %>
|
||||
|
||||
<%@ Register Assembly="AspMapNET" Namespace="AspMap.Web" TagPrefix="cc1" %>
|
||||
<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="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
<asp:Label ID="LblTitulo" runat="server" Text="Contratos Secciones"></asp:Label>
|
||||
</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>
|
||||
<asp:Panel ID="PnlFiltros" runat="server" DefaultButton="CmdConsultar">
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="display: none;">
|
||||
<tr id="TrProgramar" runat="server" class="SubTotales">
|
||||
<td>Contratos: <asp:DropDownList ID="DdlContrato" runat="server" AutoPostBack="true" DataTextField="NumeroContrato" DataValueField="CveContrato" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 90px !important;"></asp:DropDownList></td>
|
||||
<td>Partida: <asp:DropDownList ID="DdlClasificacion" runat="server" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 90px !important;"></asp:DropDownList></td>
|
||||
<td>Productos y Servicios: <asp:DropDownList ID="DdlPS" runat="server" AutoPostBack="true" DataTextField="PS" DataValueField="CvePS" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 150px !important;"></asp:DropDownList></td>
|
||||
<td>Sección: <asp:DropDownList ID="DdlSeccion" runat="server" AutoPostBack="false" DataTextField="Seccion" DataValueField="CveSeccion" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;"></asp:DropDownList></td>
|
||||
<td>
|
||||
<asp:Button ID="CmdConsultar" runat="server" CausesValidation="true" ValidationGroup="GrConsulta" Text="Consultar" class="btn btn-primary" /></td>
|
||||
<td>
|
||||
<asp:Button ID="BtnAgregar" runat="server" CausesValidation="true" Text="Agregar" ClientIDMode="Static" class="btn btn-success" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</asp:Panel>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table class="table table-striped table-advance table-hover">
|
||||
<thead>
|
||||
<tr class="Titulos">
|
||||
<th width="300px">
|
||||
<asp:LinkButton ID="LbSeccion" runat="server" CausesValidation="false" Text="" CommandArgument="Seccion" OnClick="LbOrden_Click">
|
||||
Partida/PS
|
||||
<asp:Literal ID="ImgSeccion" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton></th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LbCantidad" runat="server" CausesValidation="false" Text="" CommandArgument="Cantidad" OnClick="LbOrden_Click">
|
||||
Importe
|
||||
<asp:Literal ID="ImgCantidad" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton></th>
|
||||
<th width="120px">
|
||||
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="false" Text="" CommandArgument="Estimacion" OnClick="LbOrden_Click">
|
||||
# Estimación
|
||||
<asp:Literal ID="ImgEstimacion" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton></th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="false" Text="" CommandArgument="FolioVenta" OnClick="LbOrden_Click">
|
||||
Factura
|
||||
<asp:Literal ID="ImgFolioVenta" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton></th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LbAvance" runat="server" CausesValidation="false" Text="" CommandArgument="VerFoto" OnClick="LbOrden_Click">
|
||||
Fotografía
|
||||
<asp:Literal ID="ImgVerFoto" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton></th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LbEstimacion" runat="server" CausesValidation="false" Text="" CommandArgument="VerGeom" OnClick="LbOrden_Click">
|
||||
GPS
|
||||
<asp:Literal ID="ImgVerGeom" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GV" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron Contratos Secciones con los Filtros seleccionados" DataKeyNames="CveContratoSeccion,id_gis" ShowHeader="false" SelectedRowStyle-BackColor="#66CCFF" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LtlSeccion" runat="server" CssClass="Texto" Text='<%# Eval("Agrupador")%>' CommandArgument='<%# Eval("ID_GIS") %>' CommandName="Sel"></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlTotal" runat="server" Text='<%# Eval("Total", "{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEstimacion" runat="server" Text='<%# Eval("NumeroEstimacion")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HLFactura" runat="server" Text='<%# Eval("FolioVenta")%>' NavigateUrl='<%# "/Ventas/Ventas.aspx?CveVenta=67225" %>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LBFoto" runat="server" Text='<%# Eval("VerFoto")%>' CommandArgument='<%# Eval("CveContratoSeccion") %>' OnClick="LBFoto_OnClick" NavigateUrl='<%# "/Ventas/Ventas.aspx?CveVenta=67225" %>'></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LBGeom" runat="server" Text='<%# Eval("VerGeom") %>' CommandArgument='<%# Eval("CveContratoSeccion") %>' OnClick="LBGeom_OnClick" NavigateUrl='<%# "/Ventas/Ventas.aspx?CveVenta=67225" %>'></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
</asp:GridView>
|
||||
<asp:UpdatePanel ID="UpContratos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div id="divContrato" runat="server" clientidmode="Static" visible="False" style="background-color: #4F81BD;">
|
||||
<table width="100%" border="1" cellpadding="10" cellspacing="10">
|
||||
<tr>
|
||||
<td style="background-color: white;">
|
||||
<table width="100%" cellpadding="0">
|
||||
<tr>
|
||||
<td style="text-align: right;">
|
||||
<img style="cursor: pointer;" src="/Imagenes/close.gif" alt="Cerrar" onclick="$get('divContrato').style.display='none';" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<asp:Panel ID="PanelContratos" runat="server">
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="575">
|
||||
<tr align="left" id="TrContratos" runat="server" visible="false">
|
||||
|
||||
<td>Contrato: <asp:DropDownList ID="DdlContratoAdd" runat="server" AutoPostBack="true" DataTextField="NumeroContrato" DataValueField="CveContrato" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 90px !important;"></asp:DropDownList></td>
|
||||
<td>Clasificación: <asp:DropDownList ID="DdlClasificacionAdd" runat="server" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 90px !important;"></asp:DropDownList></td>
|
||||
<td>Productos y Servicios: <asp:DropDownList ID="DdlPSAdd" runat="server" AutoPostBack="true" DataTextField="PS" DataValueField="CvePS" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;"></asp:DropDownList></td>
|
||||
<td>Sección: <asp:DropDownList ID="DdlSeccionAdd" runat="server" AutoPostBack="true" DataTextField="Seccion" DataValueField="CveSeccion" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 90px !important;"></asp:DropDownList></td>
|
||||
<td>Cantidad: <asp:TextBox ID="TxtCantidad" runat="server" Width="30px"></asp:TextBox></td>
|
||||
<td>P.U.:<asp:TextBox ID="TxtPU" runat="server" Width="50px"></asp:TextBox></td>
|
||||
<td>
|
||||
<asp:Button Text="Agregar" runat="server" ID="BtnAgregarContratoSeccion" class="btn btn-success" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</asp:Panel>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UPFoto" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div id="divFotos" runat="server" clientidmode="Static" visible="False" style="background-color: white;">
|
||||
<table width="450px" border="0" cellpadding="5" cellspacing="10">
|
||||
<tr>
|
||||
<td style="background-color: white;" colspan="3">
|
||||
<table width="100%" cellpadding="0">
|
||||
<tr>
|
||||
<td style="text-align: right;">
|
||||
<img style="cursor: pointer;" src="/Imagenes/close.gif" alt="Cerrar" onclick="$get('divFotos').style.display='none';" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 33%">
|
||||
<asp:Image ID="Img1" runat="server" Width="100px" /></td>
|
||||
<td style="width: 33%">
|
||||
<asp:Image ID="Img2" runat="server" Width="100px" Visible="False" /></td>
|
||||
<td style="width: 33%">
|
||||
<asp:Image ID="Img3" runat="server" Width="100px" Visible="False" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UPGPS" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div id="divGeom" runat="server" clientidmode="Static" visible="False" style="background-color: white;">
|
||||
<table width="450px" border="1" cellpadding="10" cellspacing="10">
|
||||
<tr>
|
||||
<td style="background-color: white;">
|
||||
<table width="100%" cellpadding="0">
|
||||
<tr>
|
||||
<td style="text-align: right;">
|
||||
<img style="cursor: pointer;" src="/Imagenes/close.gif" alt="Cerrar" onclick="$get('divGeom').style.display='none';" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<img width="350px" height="350px" src="/Imagenes/Gluyas/ImgMapa2.png" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<cc1:Map ID="Mapa" runat="server" Height="450px" Width="900px" MapUnit="Meter" OnInfoTool="Map1_InfoTool" ImageFormat="Png" EnableSession="false" PixelPerInch="100" ImageTempDirectory="/Temp" BackColor="#f2efe9" FontQuality="ClearType" ImageResolution="100" MapTool="Info" ImagePriority="High" PanCursor="url(/imagenes/hand-drag.cur),default" />
|
||||
<cc1:ZoomBar ID="ZBMapa" runat="server" Position="TopLeft" Map="Mapa" EnableViewState="true"
|
||||
Visible="true" />
|
||||
<asp:Label ID="LblCoords" runat="server" Text="" ClientIDMode="Static"></asp:Label>
|
||||
<asp:Label ID="Label1" runat="server" Text="" ClientIDMode="Static" Visible="false"></asp:Label>
|
||||
<asp:HiddenField ID="HdnPosX" runat="server" ClientIDMode="Static" Value="0" />
|
||||
<asp:HiddenField ID="HdnPosY" runat="server" ClientIDMode="Static" Value="0" />
|
||||
<asp:Label ID="LblMsg" runat="server" Text="" Visible="true"></asp:Label>
|
||||
<asp:HiddenField ID="HdnEscala" runat="server" />
|
||||
<asp:Panel ID="divPuntoDetalle" runat="server" ClientIDMode="Static" Width="300px" BackColor="White" Style="border: solid 1px black; color: Black; display: none; position: relative; left: 0;">
|
||||
<table border="0" width="300px" cellpadding="0" cellspacing="1">
|
||||
<tr class="Titulos">
|
||||
<td>
|
||||
<table width="100%" border="0" cellpadding="0" cellspacing="0" id="TbInfoPunto" style="cursor: move;">
|
||||
<tr>
|
||||
<td style="width: 245px">Información</td>
|
||||
<td style="padding-right: 4px; padding-top: 4px" valign="top">
|
||||
<img alt="" src="/imagenes/cerrarX.jpg" style="cursor: pointer;" onclick="$get('divPuntoDetalle').style.display='none';" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<asp:Table ID="tbPuntoDetalle" runat="server"></asp:Table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</asp:Panel>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td style="text-align: center;">
|
||||
<cc1:Map Visible="False" ID="MapGeom" runat="server" Height="350px" Width="350px" MapUnit="Meter" ImageFormat="Png" EnableSession="false" PixelPerInch="100" ImageTempDirectory="/Temp" BackColor="#f2efe9" FontQuality="ClearType" ImageResolution="100" MapTool="Info" ImagePriority="High" PanCursor="url(/imagenes/hand-drag.cur),default" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br />
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script type="text/javascript">
|
||||
|
||||
function Colorea(l) {
|
||||
debugger;
|
||||
var obj = $get("Tr" + l);
|
||||
if (obj) {
|
||||
alert(1);
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</asp:Content>
|
||||
518
Contratos/ContratosSecciones.aspx.vb
Normal file
518
Contratos/ContratosSecciones.aspx.vb
Normal file
@@ -0,0 +1,518 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Drawing
|
||||
Imports AspMap
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Imports System.IO
|
||||
Imports System.Text
|
||||
Imports System.Threading
|
||||
Imports AspMap.Web
|
||||
Imports AspMap.Web.Extensions
|
||||
|
||||
Partial Class Contratos_ContratosSecciones
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
#Region "Propiedades"
|
||||
Private Property PorBoton As Boolean
|
||||
Private Property CveContratoSeccion As Integer
|
||||
Get
|
||||
Return ViewState("CveContratoSeccion").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveContratoSeccion") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CveContrato As Integer
|
||||
Get
|
||||
Return ViewState("CveContrato").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveContrato") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CveClasificacion As Integer
|
||||
Get
|
||||
Return ViewState("CveClasificacion").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveClasificacion") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property Tipo As String
|
||||
Get
|
||||
Return ViewState("Tipo").ToString
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("Tipo") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property Modalidad As Integer
|
||||
Get
|
||||
Return ViewState("Modalidad").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("Modalidad") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property DtDatos As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtDatos"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtDatos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property Seleccionado As String
|
||||
Get
|
||||
Return ViewState("Seleccionado").ToString
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("Seleccionado") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
|
||||
ViewState("Orden") = ""
|
||||
|
||||
PorBoton = False
|
||||
Modalidad = Request("Contratos").ToEntero
|
||||
ConfiguraModalidad()
|
||||
'CveContratoSeccion = -1
|
||||
'CargaSeccion()
|
||||
'CargaContratos()
|
||||
'CargaClasificacion()
|
||||
|
||||
Seleccionado = ""
|
||||
CargaMapaGeom(-52441177.6239012, 3577172.53285846)
|
||||
CveContrato = IfNull(Request("CveContrato"), -1).ToString.ToEntero
|
||||
CveClasificacion = IfNull(Request("CveClasificacion"), -1).ToString.ToEntero
|
||||
Tipo = IfNull(Request("Tipo"), "Con").ToString
|
||||
CargaDatos()
|
||||
|
||||
DdlPS.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todas", "-1"))
|
||||
|
||||
|
||||
'Me.txtFechaF.Text = Now.ToShortDateString
|
||||
'Dim Row() As DataRow = GlobalDTFechasContratosSecciones.Select("CveContratosQueja = -1 AND CveEstatus = 1")
|
||||
'If Row.Length > 0 Then
|
||||
' txtFechaI.Text = Row(0)("Fecha").ToString.ToDate.ToShortDateString()
|
||||
'End If
|
||||
'RegistraScript("try { Browser();Acomoda(); } catch (e) {alert(e);}")
|
||||
End If
|
||||
CargaMapa()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub ConfiguraModalidad()
|
||||
'If Modalidad = 1 Then
|
||||
' TrProgramar.Visible = True
|
||||
LblTitulo.Text = "Contratos Secciones"
|
||||
'ElseIf Modalidad = 2 Then
|
||||
' TrBitacora.Visible = True
|
||||
' LblTitulo.Text = "Bitácoras"
|
||||
' Page.Title = "SAT - Imprimir Bitácoras"
|
||||
' TxtFechaIBit.Text = Now.ToShortDateString
|
||||
' TxtFechaFBit.Text = Now.ToShortDateString
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaSeccion()
|
||||
Dim dt As DataTable = GlobalDTContratosSecciones.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DdlSeccion.DataSource = dt
|
||||
DdlSeccion.DataBind()
|
||||
DdlSeccion.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todas", "-1"))
|
||||
DdlSeccionAdd.DataSource = dt
|
||||
DdlSeccionAdd.DataBind()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub ChkPermitirAvance_CheckedChanged(sender As Object, e As EventArgs)
|
||||
Dim ObjContrato As New ClsContratos
|
||||
Dim Row As GridViewRow = DirectCast(DirectCast(sender, CheckBox).NamingContainer, GridViewRow)
|
||||
ObjContrato.PermitirAvance(GV.DataKeys(Row.RowIndex).Value.ToString.ToEntero, DirectCast(sender, CheckBox).Checked)
|
||||
ObjContrato.Dispose()
|
||||
Alert("Se ha permitido avance a la sección")
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
Protected Sub ChkPermitirEstimacion_CheckedChanged(sender As Object, e As EventArgs)
|
||||
Dim ObjContrato As New ClsContratos
|
||||
Dim Row As GridViewRow = DirectCast(DirectCast(sender, CheckBox).NamingContainer, GridViewRow)
|
||||
ObjContrato.PermitirEstimacion(GV.DataKeys(Row.RowIndex).Value.ToString.ToEntero, DirectCast(sender, CheckBox).Checked)
|
||||
ObjContrato.Dispose()
|
||||
Alert("Se ha permitido estimar en la sección")
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
#Region "C O M B O S"
|
||||
Private Sub CargaContratosAdd()
|
||||
DdlContratoAdd.DataSource = GlobalDTContratos.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DdlContratoAdd.DataBind()
|
||||
' DdlContratoAdd.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todas", "-1"))
|
||||
End Sub
|
||||
Private Sub CargaClasificacionAdd()
|
||||
DdlClasificacionAdd.DataSource = GlobalDTClasificaciones.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DdlClasificacionAdd.DataBind()
|
||||
' DdlClasificacionAdd.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todas", "-1"))
|
||||
End Sub
|
||||
Private Sub CargaPSAdd()
|
||||
Dim ObjPS As New ClsProductosServicios
|
||||
If ObjPS.GetPS(-1, DdlClasificacionAdd.SelectedValue.ToString.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
DdlPSAdd.DataSource = ObjPS.DtResultados
|
||||
Else
|
||||
DdlPSAdd.DataSource = Nothing
|
||||
End If
|
||||
DdlPSAdd.DataBind()
|
||||
|
||||
ObjPS.Dispose()
|
||||
'DdlPSAdd.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todas", "-1"))
|
||||
End Sub
|
||||
Private Sub CargaSeccionAdd()
|
||||
'DdlSeccionAdd.DataSource = GlobalDTContratosSecciones.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
'DdlSeccionAdd.DataBind()
|
||||
'DdlSeccionAdd.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todas", "-1"))
|
||||
Dim ObjSecciones As New ClsContratos
|
||||
If ObjSecciones.GetSecciones() Then
|
||||
DdlSeccionAdd.DataSource = ObjSecciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DdlSeccionAdd.DataBind()
|
||||
|
||||
End If
|
||||
|
||||
ObjSecciones.Dispose()
|
||||
|
||||
End Sub
|
||||
Private Sub CargaContratos()
|
||||
DdlContrato.DataSource = GlobalDTContratos.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DdlContrato.DataBind()
|
||||
DdlContrato.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlContrato.SelectedValue = "7"
|
||||
End Sub
|
||||
Private Sub CargaClasificacion()
|
||||
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
|
||||
DdlClasificacion.DataBind()
|
||||
DdlClasificacion.Items.Insert(0, New ListItem("Todas", "-1"))
|
||||
End Sub
|
||||
'Private Sub CargaCategorias()
|
||||
' DdlPartidas.DataSource = GlobalDTGralCategorias(UsuarioActual.CveEmpresa)
|
||||
' DdlPartidas.DataBind()
|
||||
' DdlPartidas.Items.Insert(0, New ListItem("Todas", "-1"))
|
||||
'End Sub
|
||||
Private Sub CargaPS()
|
||||
Dim ObjPS As New ClsProductosServicios
|
||||
If ObjPS.GetPS(-1, DdlClasificacion.SelectedValue.ToString.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
DdlPS.DataSource = ObjPS.DtResultados.FiltraParametros("", "PS")
|
||||
Else
|
||||
DdlPS.DataSource = Nothing
|
||||
End If
|
||||
DdlPS.DataBind()
|
||||
|
||||
ObjPS.Dispose()
|
||||
DdlPS.Items.Insert(0, New ListItem("Todas", "-1"))
|
||||
End Sub
|
||||
#End Region
|
||||
Protected Sub CmdConsultar_Click(sender As Object, e As System.EventArgs) Handles CmdConsultar.Click
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
PorBoton = True
|
||||
Dim ContratosSecciones As New ClsContratos()
|
||||
|
||||
|
||||
If ContratosSecciones.GetRepContratosAvancesDetalle(-1, CveContrato, CveClasificacion, Tipo, UsuarioActual.CveEmpresa) Then
|
||||
'If ContratosSecciones.GetContratosSecciones(-1, DdlEstatus.SelectedValue.ToEntero, DdlPS.SelectedValue.ToEntero, DdlContrato.SelectedValue.ToEntero, -1, -1, FechaI, FechaF) Then
|
||||
DtDatos = ContratosSecciones.DtResultados
|
||||
'DtDatos.Rows.RemoveAt(0)
|
||||
'DtDatos.Rows.RemoveAt(0)
|
||||
' Cache("DTProgramacion" & UsuarioActual.CveUsuario.ToString()) = ContratosSecciones.DtResultados
|
||||
GV.DataSource = DtDatos
|
||||
|
||||
|
||||
LblTitulo.Text = "Cliente: " & DtDatos.MAX("Cliente")
|
||||
|
||||
DtDatos = DtDatos.FiltraParametros("CveContratoSeccion > 0")
|
||||
|
||||
Else
|
||||
GV.DataSource = Nothing
|
||||
End If
|
||||
ContratosSecciones.Dispose()
|
||||
GV.DataBind()
|
||||
CargaMapa()
|
||||
mapa.ZoomFull()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub GV_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GV.RowCommand
|
||||
If e.CommandName = "Sel" Then
|
||||
Seleccionado = e.CommandArgument.ToString
|
||||
'GV.SelectRow(e.CommandArgument.ToString.ToEntero - 1)
|
||||
CargaMapa()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
'Protected Sub GV_RowCreated(sender As Object, e As GridViewRowEventArgs) Handles GV.RowCreated
|
||||
' If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
' e.Row.ClientIDMode = ClientIDMode.Static
|
||||
' e.Row.ID = String.Format("Tr-{0}", e.Row.DBCampo("ID_GIS"))
|
||||
' End If
|
||||
|
||||
'End Sub
|
||||
|
||||
Protected Sub GV_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GV.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(300) 'Seccion
|
||||
e.Row.Cells(1).Width = Unit.Pixel(100) 'SubSeccion
|
||||
e.Row.Cells(2).Width = Unit.Pixel(120) 'Cantidad
|
||||
e.Row.Cells(3).Width = Unit.Pixel(100) 'PU
|
||||
e.Row.Cells(4).Width = Unit.Pixel(100) 'Permitir Avance
|
||||
e.Row.Cells(5).Width = Unit.Pixel(100) 'Permitir Estimacion
|
||||
'e.Row.Cells(6).Width = Unit.Pixel(100) 'Número Estimación
|
||||
' e.Row.Cells(7).Width = Unit.Pixel(100) 'Factura
|
||||
End If
|
||||
|
||||
e.Row.ClientIDMode = ClientIDMode.Static
|
||||
e.Row.ID = String.Format("Tr{0}", e.Row.DBCampo("ID_GIS"))
|
||||
|
||||
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Center
|
||||
|
||||
If e.Row.DBCampo("NumeroContrato") = "" Then
|
||||
e.Row.CssClass = "SubTotales3" : e.Row.Height = 25
|
||||
ElseIf e.Row.DBCampo("Partida") = "" Then
|
||||
e.Row.CssClass = "SubTotales2" : e.Row.Height = 25
|
||||
ElseIf e.Row.DBCampo("PS") = "" Then
|
||||
e.Row.CssClass = "SubTotales" : e.Row.Height = 25
|
||||
ElseIf e.Row.DBCampo("Seccion") = "" Then
|
||||
e.Row.CssClass = "SubTotales3" : e.Row.Height = 25
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaGrid(ByVal Orden As String)
|
||||
|
||||
If Orden <> String.Empty Then
|
||||
Dim DV As New DataView(CType(Cache("DTProgramacion" & UsuarioActual.CveUsuario.ToString()), DataTable), "", Orden, DataViewRowState.CurrentRows)
|
||||
GV.DataSource = DV.ToTable()
|
||||
DV.Dispose()
|
||||
Else
|
||||
GV.DataSource = CType(Cache("DTProgramacion" & UsuarioActual.CveUsuario.ToString()), DataTable)
|
||||
End If
|
||||
|
||||
GV.DataBind()
|
||||
UpDatos.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
'Protected Sub CmdBuscar_Click(sender As Object, e As System.EventArgs) Handles CmdBuscar.Click
|
||||
' Dim ObjBitacora As New ClsBitacora()
|
||||
|
||||
' Dim FechaI, FechaF As String
|
||||
' FechaI = If(IsDate(TxtFechaIBit.Text.Trim()), TxtFechaIBit.Text.Trim(), "-1")
|
||||
' FechaF = If(IsDate(TxtFechaFBit.Text.Trim()), TxtFechaFBit.Text.Trim(), "-1")
|
||||
|
||||
' If ObjBitacora.GetBitacora(DdlContratos.SelectedValue, FechaI, FechaF) Then
|
||||
' GVBitacora.DataSource = ObjBitacora.DtResultados
|
||||
' Else
|
||||
' GVBitacora.DataSource = Nothing
|
||||
' End If
|
||||
' ObjBitacora.Dispose()
|
||||
|
||||
' GVBitacora.DataBind()
|
||||
'End Sub
|
||||
Protected Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlClasificacion.SelectedIndexChanged
|
||||
CargaPS()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregar_Click(sender As Object, e As System.EventArgs) Handles BtnAgregar.Click
|
||||
RegistraScript("PosicionaObjeto('BtnAgregar','divContrato','');")
|
||||
TrContratos.Visible = True
|
||||
divContrato.Visible = True
|
||||
CargaContratosAdd()
|
||||
CargaClasificacionAdd()
|
||||
CargaSeccionAdd()
|
||||
UpContratos.Update()
|
||||
'Dim con As New ClsContratos
|
||||
'con.AddContratosSecciones(DdlContrato.SelectedValue.ToEntero, DdlPS.SelectedValue.ToEntero, DdlSeccion.SelectedValue.ToEntero, 5, 3, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
'con.Dispose()
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlClasificacionAdd_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlClasificacionAdd.SelectedIndexChanged
|
||||
CargaPSAdd()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregarContratoSeccion_Click(sender As Object, e As System.EventArgs) Handles BtnAgregarContratoSeccion.Click
|
||||
Dim ObjContratosSecciones As New ClsContratos
|
||||
If ObjContratosSecciones.AddContratosSecciones(DdlContratoAdd.SelectedValue.ToEntero, DdlSeccionAdd.SelectedValue.ToEntero, DdlPSAdd.SelectedValue.ToEntero, TxtCantidad.Text.Trim.ToDouble, TxtPU.Text.Trim.ToDouble, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
TxtCantidad.Text = ""
|
||||
TxtPU.Text = ""
|
||||
Alert("El Nuevo Contrato Sección se Agregó Correctamente.", TipoMensaje.MsgInformacion)
|
||||
UpContratos.Update()
|
||||
ViewState("DTContratosSecciones") = ObjContratosSecciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
CargaDatos()
|
||||
|
||||
End If
|
||||
ObjContratosSecciones.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LBFoto_OnClick(ByVal Sender As Object, ByVal E As EventArgs)
|
||||
|
||||
Dim LB As LinkButton = CType(Sender, LinkButton)
|
||||
divFotos.Visible = True
|
||||
|
||||
Dim Con As New ClsContratos
|
||||
If Con.GetContratoSeccion(LB.CommandArgument.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
Dim dt As DataTable = Con.DtResultados
|
||||
RegistraScript("PosicionaObjeto('" & LB.ClientID & "','divFotos','');")
|
||||
If dt.Rows.Count > 0 Then
|
||||
Img1.ImageUrl = "/Empresas/66/Avances/Imagenes/" & dt.Rows(0)("Img1").ToString
|
||||
If dt.Rows(0)("Img2").ToString <> "" Then
|
||||
Img2.Visible = True
|
||||
Img2.ImageUrl = "/Empresas/66/Avances/Imagenes/" & dt.Rows(0)("Img2").ToString
|
||||
End If
|
||||
If dt.Rows(0)("Img3").ToString <> "" Then
|
||||
Img3.Visible = True
|
||||
Img3.ImageUrl = "/Empresas/66/Avances/Imagenes/" & dt.Rows(0)("Img3").ToString
|
||||
End If
|
||||
End If
|
||||
UPFoto.Update()
|
||||
End If
|
||||
Con.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LBGeom_OnClick(ByVal Sender As Object, ByVal E As EventArgs)
|
||||
|
||||
Dim LB As LinkButton = CType(Sender, LinkButton)
|
||||
divGeom.Visible = True
|
||||
|
||||
Dim Con As New ClsContratos
|
||||
If Con.GetContratoSeccion(LB.CommandArgument.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
Dim dt As DataTable = Con.DtResultados
|
||||
RegistraScript("PosicionaObjeto('" & LB.ClientID & "','divGeom','');")
|
||||
CargaMapaGeom(dt.Rows(0)("x").ToString.ToDouble, dt.Rows(0)("y").ToString.ToDouble)
|
||||
UPGPS.Update()
|
||||
End If
|
||||
Con.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaMapaGeom(x As Double, y As Double)
|
||||
|
||||
Dim gml As GoogleMapsLayer = New GoogleMapsLayer()
|
||||
gml.MapType = GoogleMapType.Normal
|
||||
|
||||
MapGeom.BackgroundLayer = gml
|
||||
|
||||
'' set the transparency of the main map image to display other layers over the satellite map
|
||||
MapGeom.ImageFormat = ImageFormat.Png
|
||||
MapGeom.ImageOpacity = 0.8
|
||||
|
||||
'MapGeom.Markers.Add(New Marker(New AspMap.Point(x, y), "x", "y"))
|
||||
'MapGeom.Markers.Add(New Marker(New AspMap.Point(-52441177.6239012, 3577172.53285846), "x", "y"))
|
||||
|
||||
'If Mapa.Markers.Count > 0 Then
|
||||
'MapGeom.ZoomScale(New AspMap.Point(Mapa.Markers(0).Position.X, Mapa.Markers(0).Position.Y), 750000)
|
||||
'End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaMapa()
|
||||
|
||||
Dim dbLayer As AspMap.Layer
|
||||
Dim feature As AspMap.Feature
|
||||
'Dim FillColor, LineColor As Color
|
||||
Mapa.RemoveAllLayers()
|
||||
|
||||
|
||||
|
||||
|
||||
dbLayer = Mapa.AddLayer(AppDomain.CurrentDomain.BaseDirectory & "GIS\Carretera.tab")
|
||||
If dbLayer IsNot Nothing AndAlso DtDatos IsNot Nothing Then
|
||||
|
||||
If (Not dbLayer.AddRelate("ID_GIS", DtDatos, "ID_GIS")) Then
|
||||
Alert("No se puede vincular las tablas")
|
||||
End If
|
||||
Dim renderer As FeatureRenderer = dbLayer.Renderer
|
||||
|
||||
'Seleccionado
|
||||
If Seleccionado <> "" Then
|
||||
feature = renderer.Add() : feature.Expression = String.Format("ID_Gis = {0}", Seleccionado) : feature.Symbol.FillStyle = FillStyle.Solid : feature.Symbol.FillColor = Color.LightSkyBlue : feature.Symbol.LineColor = Color.FromArgb(120, 168, 192) : feature.Tag = "-3"
|
||||
|
||||
End If
|
||||
|
||||
''Estimado
|
||||
feature = renderer.Add() : feature.Expression = "NumeroEstimacionNum > 0 " : feature.Symbol.FillStyle = FillStyle.Solid : feature.Symbol.FillColor = Color.Green : feature.Symbol.LineColor = Color.FromArgb(192, 144, 96) : feature.Tag = "-2"
|
||||
|
||||
''Estimado
|
||||
feature = renderer.Add() : feature.Expression = "PermitirAvanceNum > 0 " : feature.Symbol.FillStyle = FillStyle.Solid : feature.Symbol.FillColor = Color.Yellow : feature.Symbol.LineColor = Color.FromArgb(192, 144, 96) : feature.Tag = "-2"
|
||||
|
||||
''Por Estimar
|
||||
feature = renderer.Add() : feature.Expression = "PermitirEstimacionNum = 1 " : feature.Symbol.FillStyle = FillStyle.Solid : feature.Symbol.FillColor = Color.LightGray : feature.Symbol.LineColor = Color.FromArgb(120, 168, 192) : feature.Tag = "-3"
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub Map1_InfoTool(ByVal sender As Object, ByVal e As InfoToolEventArgs)
|
||||
|
||||
If e.Argument = "" Then
|
||||
Dim records As AspMap.Recordset = Mapa.Identify(e.InfoPoint, 10)
|
||||
|
||||
Seleccionado = records("ID_Gis").ToString
|
||||
|
||||
GV.SelectRow(records("ID_Gis").ToString.ToEntero - 1)
|
||||
'RegistraScript(String.Format("Colorea(Tr{0})", records("ID_GIS")))
|
||||
|
||||
Dim dbLayer As AspMap.Layer = Mapa.Layer(0)
|
||||
|
||||
Dim feature = New AspMap.Feature()
|
||||
|
||||
feature.Expression = String.Format("ID_Gis = " & Seleccionado)
|
||||
feature.Symbol.FillColor = Color.LightSkyBlue
|
||||
dbLayer.Renderer.Add(feature)
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region "O R D E N A M I E N T O"
|
||||
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Dim Orden As String = ""
|
||||
Dim Campo As String = ""
|
||||
Dim Literal As Literal = Nothing
|
||||
Const OrdenInicial As String = ""
|
||||
Dim Arg(2) As String
|
||||
|
||||
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
|
||||
Campo = Arg(0)
|
||||
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
|
||||
|
||||
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
|
||||
Else
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
|
||||
End If
|
||||
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
|
||||
ViewState("Orden") = Orden
|
||||
CargaGrid(Orden)
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
End Class
|
||||
94
Contratos/Estimaciones.aspx
Normal file
94
Contratos/Estimaciones.aspx
Normal file
@@ -0,0 +1,94 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Estimaciones.aspx.vb" Inherits="Contratos_Estimaciones" %>
|
||||
|
||||
<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="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Estimaciones
|
||||
</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>
|
||||
<asp:Panel ID="PnlFiltros" runat="server" DefaultButton="CmdConsultar">
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="">
|
||||
<div class="portlet-title portlet-filterT" style="">
|
||||
<div class="titlefiltros caption ">
|
||||
<ul class="list-inline">
|
||||
<li>Contratista:
|
||||
<asp:DropDownList ID="DdlProveedor" runat="server" AutoPostBack="true" DataTextField="RazonSocial" DataValueField="CveProveedor" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 120px !important;"></asp:DropDownList>
|
||||
</li>
|
||||
<li>Contratos:
|
||||
<asp:DropDownList ID="DdlContrato" runat="server" AutoPostBack="true" DataTextField="NumeroContrato" DataValueField="CveContrato" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 90px !important;"></asp:DropDownList>
|
||||
</li>
|
||||
<li>Sección:
|
||||
<asp:DropDownList ID="DdlSeccion" runat="server" AutoPostBack="false" DataTextField="Seccion" DataValueField="CveSeccion" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;"></asp:DropDownList>
|
||||
</li>
|
||||
<li>Clasificación:
|
||||
<asp:DropDownList ID="DdlClasificacion" runat="server" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 90px !important;"></asp:DropDownList>
|
||||
</li>
|
||||
<li>Productos y Servicios:
|
||||
<asp:DropDownList ID="DdlPS" runat="server" AutoPostBack="true" DataTextField="PS" DataValueField="CvePS" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;"></asp:DropDownList>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<asp:Button ID="CmdConsultar" runat="server" Text="Consultar" class="btn btn-primary" CausesValidation="true" ValidationGroup="GrConsulta" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table class="table table-striped table-advance table-hover">
|
||||
<thead>
|
||||
<tr class="Titulos">
|
||||
<th width="60px">#</th>
|
||||
<th width="60px">Est</th>
|
||||
<th width="300px">
|
||||
<asp:LinkButton ID="LbSubSeccion" runat="server" CausesValidation="false" Text="Concepto" /></th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LbCantidad" runat="server" CausesValidation="false" Text="Importe" /></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<asp:GridView ID="GV" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron Estimaciones con los Filtros seleccionados" DataKeyNames="CveContrato,CveContratoSeccion" ShowHeader="false" SelectedRowStyle-BackColor="#CCFF66" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="Chk" runat="server" Visible='<%# Eval("CveContratoSeccion").ToString <> "" And Eval("CveEstimacion").ToString = ""%>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LitEst" runat="server" Text='<%# Eval("CveEstimacion")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlSeccion" runat="server" Text='<%# IIf(Eval("SubSeccion").ToString <> String.Empty, "Sub Sección: ", "").ToString & Eval("Agrupador").ToString%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlImporte" runat="server" Text='<%# Eval("Importe","{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
</asp:GridView>
|
||||
<br />
|
||||
<asp:Button ID="BtnAgregar" runat="server" CausesValidation="true" Text="Estimar" Visible="false" class="btn btn-primary" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
122
Contratos/Estimaciones.aspx.vb
Normal file
122
Contratos/Estimaciones.aspx.vb
Normal file
@@ -0,0 +1,122 @@
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class Contratos_Estimaciones
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
|
||||
CargaProveedores()
|
||||
CargaContratos()
|
||||
CargaClasificacion()
|
||||
CargaSeccion()
|
||||
'DdlContrato.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todos", "-1"))
|
||||
DdlPS.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todas", "-1"))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim Con As New ClsContratos
|
||||
If Con.GetEstimaciones(DdlProveedor.SelectedValue.ToEntero, -1, DdlContrato.SelectedValue.ToEntero, DdlSeccion.SelectedValue.ToEntero, DdlPS.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa) Then
|
||||
GV.DataSource = Con.DtResultados
|
||||
GV.DataBind()
|
||||
If Con.DtResultados.Rows.Count > 0 Then
|
||||
BtnAgregar.Visible = True
|
||||
End If
|
||||
UpDatos.Update()
|
||||
End If
|
||||
Con.Dispose()
|
||||
End Sub
|
||||
|
||||
#Region "C O M B O S"
|
||||
|
||||
Private Sub CargaProveedores()
|
||||
DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
|
||||
DdlProveedor.DataBind()
|
||||
DdlProveedor.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
|
||||
Private Sub CargaSeccion()
|
||||
DdlSeccion.DataSource = GlobalDTContratosSecciones.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DdlSeccion.DataBind()
|
||||
DdlSeccion.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todas", "-1"))
|
||||
'Dim ObjSecciones As New ClsContratos
|
||||
'If ObjSecciones.GetSecciones() Then
|
||||
' DdlSeccion.DataSource = ObjSecciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
' DdlSeccion.DataBind()
|
||||
|
||||
'End If
|
||||
|
||||
'ObjSecciones.Dispose()
|
||||
|
||||
End Sub
|
||||
Private Sub CargaContratos()
|
||||
DdlContrato.DataSource = GlobalDTContratos.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DdlContrato.DataBind()
|
||||
DdlContrato.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
Private Sub CargaClasificacion()
|
||||
DdlClasificacion.DataSource = GlobalDTClasificaciones.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DdlClasificacion.DataBind()
|
||||
DdlClasificacion.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todas", "-1"))
|
||||
End Sub
|
||||
Private Sub CargaPS()
|
||||
Dim ObjPS As New ClsProductosServicios
|
||||
If ObjPS.GetPS(-1, DdlClasificacion.SelectedValue.ToString.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
DdlPS.DataSource = ObjPS.DtResultados
|
||||
Else
|
||||
DdlPS.DataSource = Nothing
|
||||
End If
|
||||
DdlPS.DataBind()
|
||||
|
||||
ObjPS.Dispose()
|
||||
DdlPS.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todas", "-1"))
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
Protected Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GV.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(60)
|
||||
e.Row.Cells(1).Width = Unit.Pixel(60) 'Seccion
|
||||
e.Row.Cells(2).Width = Unit.Pixel(300) 'SubSeccion
|
||||
e.Row.Cells(3).Width = Unit.Pixel(100) 'Cantidad
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("RazonSocial") = "" Then
|
||||
e.Row.CssClass = "Totales" : e.Row.Height = 25
|
||||
ElseIf e.Row.DBCampo("Contrato") = "" Then
|
||||
e.Row.CssClass = "SubTotales2" : e.Row.Height = 25
|
||||
ElseIf e.Row.DBCampo("Seccion") = "" Then
|
||||
e.Row.CssClass = "SubTotales" : e.Row.Height = 25
|
||||
ElseIf e.Row.DBCampo("Clasificacion") = "" Then
|
||||
e.Row.CssClass = "SubTotales3" : e.Row.Height = 25
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub CmdConsultar_Click(sender As Object, e As EventArgs) Handles CmdConsultar.Click
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregar_Click(sender As Object, e As EventArgs) Handles BtnAgregar.Click
|
||||
Dim Str As New StringBuilder
|
||||
For Each gvr As GridViewRow In GV.Rows
|
||||
If gvr.FCCheckBox("Chk").Checked Then
|
||||
Str.AppendFormat("{0},", gvr.DataKey("CveContratoSeccion"))
|
||||
End If
|
||||
Next
|
||||
'debe de ser por contrato el movimiento
|
||||
If Str.Length > 0 Then
|
||||
Dim Con As New ClsContratos
|
||||
Con.AddEstimaciones(7, Now, -1, -1, Str.ToString, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
Con.Dispose()
|
||||
End If
|
||||
CargaDatos()
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
169
Contratos/FacturacionMasiva.aspx
Normal file
169
Contratos/FacturacionMasiva.aspx
Normal file
@@ -0,0 +1,169 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="FacturacionMasiva.aspx.vb" Inherits="Contratos_FacturacionMasiva" %>
|
||||
|
||||
<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">
|
||||
Facturación Masiva
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
|
||||
<li>
|
||||
<asp:UpdatePanel ID="UpnRefresh" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="ImgFacturarTodos" runat="server"><i class="fa fa-repeat"></i>
|
||||
Facturar Todas</asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
|
||||
|
||||
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpFiltros">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter">
|
||||
<div class="portlet-title portlet-filterT smalltitle magindate">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnCargaAsignados" ClientIDMode="Static" runat="server" Text="Consultar" class="btn btn-default" />
|
||||
<a href="javascript:;" id="ex" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption ">
|
||||
<ul class="list-inline" style="font-size: 12px;">
|
||||
<li>Cliente:
|
||||
<asp:DropDownList ID="DdlCliente" runat="server" AppendDataBoundItems="true" DataTextField="NombreComercial" DataValueField="CveCliente" CssClass="form-control input-sm select2me" Style="width: 250px !important;">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</li>
|
||||
<li>Contrato:
|
||||
<asp:DropDownList ID="DdlContrato" Width="230px" AppendDataBoundItems="true" runat="server" DataTextField="NumeroContrato" DataValueField="CveContrato" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</li>
|
||||
<li>
|
||||
Sucursal:
|
||||
<asp:DropDownList ID="DdlSucursal" Width="230px" AppendDataBoundItems="true" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display:none">
|
||||
<div class="row">
|
||||
<label class="col-md-1">Fecha I.: </label>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control input-sm" CausesValidation="true" MaxLength="10" Width="82px "></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<label class="col-md-1">Fecha F.: </label>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control input-sm" CausesValidation="true" MaxLength="10" Width="82px "></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel UpdateMode="Conditional" ID="UpGv" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:GridView ID="GvCiclosComerciales" runat="server" DataKeyNames="CveCicloComercial, NumeroContrato, CveSubProyecto" AutoGenerateColumns="False" ShowHeader="True" EmptyDataText="No se encontraron pendientes por facturar" GridLines="none" ToolTip="Listado de Pendientes" CssClass="table table-striped table-hover Widthall">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="center" headertext="" ItemStyle-Width="10%">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox runat="server" ID="chkDis" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:HyperLinkField DataTextField="NumeroContrato" DataNavigateUrlFields="CveContrato" DataNavigateUrlFormatString="/Contratos/Contrato.aspx?CveContrato={0}" HeaderText="Número Contrato" ItemStyle-Width="10%" Target="_blank" />
|
||||
<asp:BoundField HeaderText="Descripción" DataField="DescripcionContrato" ItemStyle-CssClass="truncate" ItemStyle-Width="25%" />
|
||||
<asp:HyperLinkField DataTextField="Cliente" HeaderText="Cliente" DataNavigateUrlFields="CveCliente" DataNavigateUrlFormatString="/Ventas/Clientes.aspx?CveCliente={0}" ItemStyle-Width="15%" Target="_blank" />
|
||||
<asp:BoundField HeaderText="Fecha Factura" DataField="FechaVenc" DataFormatString="{0:d}" ItemStyle-Width="10%" />
|
||||
<asp:BoundField HeaderText="Observación" DataField="Observaciones" ItemStyle-Width="10%" />
|
||||
<asp:HyperLinkField Text="Ir" DataNavigateUrlFields="CveCicloComercial" HeaderText="Factura Manual" ItemStyle-Width="15%" Target="_blank" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveCicloComercial={0}" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<br />
|
||||
<asp:UpdatePanel ID="upRecargar" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:LinkButton ID="btnFacturarAqui" runat="server" CssClass="btn btn-primary" style="float:right" onclientclick="javascript:$('#divAgregar').modal();return false;" Text="Facturar Seleccionadas" CausesValidation="False" />
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="divAgregar" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAgregar" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Agregar Observación</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpBodyEstatus" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="form-group form-md-line-input input-iconright" style="margin-bottom:5px">
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label style="margin-bottom: 0; font-size: 13px; color: #888888; opacity: 1; bottom: auto;">Observación Adicional por Partida:</label>
|
||||
<br />
|
||||
<asp:TextBox ID="TxtObservaciones" CssClass="form-control" runat="server"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="BtnFacturar" runat="server" Text="Facturar Ahora" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"></asp:LinkButton>
|
||||
<button id="btnCancelar" data-dismiss="modal" class="btn btn-default">Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
1153
Contratos/FacturacionMasiva.aspx.vb
Normal file
1153
Contratos/FacturacionMasiva.aspx.vb
Normal file
File diff suppressed because it is too large
Load Diff
297
Contratos/ModificarPresupuesto.aspx
Normal file
297
Contratos/ModificarPresupuesto.aspx
Normal file
@@ -0,0 +1,297 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="ModificarPresupuesto.aspx.vb" Inherits="Contratos_ModificarPresupuesto" %>
|
||||
|
||||
<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">
|
||||
Modificaciones a Presupuestos
|
||||
</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-md-6">
|
||||
<div class="portlet light smmallpadding bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="fa fa-info-circle"></i>Datos Generales
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="fullscreen" data-original-title="" title=""></a>
|
||||
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<asp:UpdatePanel ID="UpDatosG" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="rowpadding">
|
||||
<div class="row">
|
||||
<label class="col-md-2 truncate">Presupuesto:</label>
|
||||
<div class="col-md-10">
|
||||
<asp:DropDownList ID="DdlPresupuesto" runat="server" AutoPostBack="true" CssClass="form-control input-sm select2me" DataTextField="Nombre" DataValueField="CvePresupuesto"></asp:DropDownList>
|
||||
<asp:CompareValidator ID="CVPresupuesto" runat="server" ControlToValidate="DdlPresupuesto" ValueToCompare="0" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />Debe seleccionar un <b>''Presupuesto''</b>, por favor seleccione uno." Operator="GreaterThan" Type="Integer" ValidationGroup="GrpGuardar"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEPresupuesto" runat="server" HighlightCssClass="vco" TargetControlID="CVPresupuesto"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-2 truncate">Tipo:</label>
|
||||
<div class="col-md-10">
|
||||
<asp:DropDownList ID="DdlTipo" OnSelectedIndexChanged="DdlTipo_SelectedIndexChanged" runat="server" AutoPostBack="true" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Text="Ampliación" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Reducción" Value="2"></asp:ListItem>
|
||||
<asp:ListItem Text="Transferencia" Value="1,2"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-2 truncate">Justificación:</label>
|
||||
<div class="col-md-10">
|
||||
<asp:TextBox ID="TxtJustificion" runat="server" CssClass="form-control" TextMode="MultiLine"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVObservacion" runat="server" ControlToValidate="TxtJustificion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Justificación''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEObs" runat="server" HighlightCssClass="vco" TargetControlID="RFVObservacion"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="row">
|
||||
<label class="col-md-4 truncate">Fecha:</label>
|
||||
<div class="col-md-8">
|
||||
<div style="display: inline-block; vertical-align: text-bottom;">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
|
||||
<asp:TextBox ID="TxtFecha" runat="server" CssClass="form-control" CausesValidation="true" Style="width: 118px" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="ImgFecha" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="TxtFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CEFechaI" TargetControlID="TxtFecha" PopupButtonID="ImgFecha" Format="dd/MM/yyyy" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVFecha" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFecha" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet light smmallpadding bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption" style="align-items: center">
|
||||
<i class="fa fa-info-circle"></i>Presupuestos
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="fullscreen" data-original-title="" title=""></a>
|
||||
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<div class="rowpadding">
|
||||
<asp:UpdatePanel ID="UpGvClasificaciones" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvPresupuestos" runat="server" ShowFooter="true" GridLines="None" EmptyDataText="No se encontraron presupuestos" CssClass="table table-hover table-striped Widthall ScrollAD" AutoGenerateColumns="False" data-heighterror="600"
|
||||
DataKeyNames="CvePresupuestoDetalle,CveClasificacion" data-footer="1">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Clasificación" DataField="Clasificacion" />
|
||||
<asp:TemplateField HeaderText="Importe" ItemStyle-HorizontalAlign="Right" FooterStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LtlImporte" runat="server" Text='<%# Eval("Autorizado", "{0:C}")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:Label ID="LblTotalImporte" runat="server"></asp:Label>
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Saldo" ItemStyle-HorizontalAlign="Right" FooterStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LtlSaldo" runat="server" Text='<%# Eval("PorEjercer", "{0:C}")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:Label ID="LblTotalSaldo" runat="server"></asp:Label>
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Ampliación" HeaderStyle-HorizontalAlign="Left" FooterStyle-HorizontalAlign="Right" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtAmpliacion" runat="server" CssClass="form-control input-sm sumaGVAmpliacion"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FTEAmpliacion" runat="server" TargetControlID="TxtAmpliacion" FilterType="Custom, Numbers" ValidChars=".," />
|
||||
</ItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:Label ID="LblTotalAmpliacion" runat="server"></asp:Label>
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Reducción" HeaderStyle-HorizontalAlign="Left" FooterStyle-HorizontalAlign="Right" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtReduccion" runat="server" CssClass="form-control input-sm sumaGVReduccion"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FTERecuccion" runat="server" TargetControlID="TxtReduccion" FilterType="Custom, Numbers" ValidChars=".," />
|
||||
</ItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:Label ID="LblTotalReduccion" runat="server"></asp:Label>
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Saldo Final" ItemStyle-HorizontalAlign="Right" FooterStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LtlSaldoFinal" CssClass="sumaSaldoFinalGV" runat="server"></asp:Label>
|
||||
</ItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:Label ID="LblTotalSaldoFinal" runat="server"></asp:Label>
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<FooterStyle BackColor="#DDDDDD" />
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UpGuardar" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-2">
|
||||
<asp:Button ID="BtnGuardar" runat="server" OnClick="BtnGuardar_Click" Text="Guardar" CssClass="btn btn-primary" ValidationGroup="GrpGuardar" />
|
||||
</div>
|
||||
<div class="col-md-5"></div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script type="text/javascript">
|
||||
|
||||
function Ampliacion(i) {
|
||||
calculaTotalAmpliacion();
|
||||
var ampliacion = ToDouble($("#C_GvPresupuestos_TxtAmpliacion_" + i).val().replace("$", "").replace(",", ""));
|
||||
var saldo = ToDouble($("#C_GvPresupuestos_LtlSaldo_" + i).text().replace("$", "").replace(",", ""));
|
||||
|
||||
var SaldoFinal = saldo + ampliacion;
|
||||
|
||||
$("#C_GvPresupuestos_LtlSaldoFinal_" + i).text("$"+formato_numero(SaldoFinal, 2, '.', ','));
|
||||
|
||||
var SaldoTotal = ToDouble(C_GvPresupuestos_LblTotalSaldo.innerText.replace("$", "").replace(",", ""));
|
||||
var ampliacionTotal = ToDouble(C_GvPresupuestos_LblTotalAmpliacion.innerText.replace("$", "").replace(",", ""));
|
||||
|
||||
var SaldoFinalTotal = SaldoTotal + ampliacionTotal;
|
||||
|
||||
C_GvPresupuestos_LblTotalSaldoFinal.innerText = '$ ' + FormatoNumero(SaldoFinalTotal);
|
||||
|
||||
}
|
||||
function Reduccion(i) {
|
||||
|
||||
var reduccion = ToDouble($("#C_GvPresupuestos_TxtReduccion_" + i).val().replace("$", "").replace(",", ""));
|
||||
var saldo = ToDouble($("#C_GvPresupuestos_LtlSaldo_" + i).text().replace("$", "").replace(",", ""));
|
||||
|
||||
var SaldoFinal = saldo - reduccion;
|
||||
|
||||
if (reduccion <= saldo) {
|
||||
$("#C_GvPresupuestos_LtlSaldoFinal_" + i).text("$"+formato_numero(SaldoFinal, 2, '.', ','));
|
||||
}
|
||||
calculaTotalReduccion();
|
||||
var SaldoTotal = ToDouble(C_GvPresupuestos_LblTotalSaldo.innerText.replace("$", "").replace(",", ""));
|
||||
var reduccionTotal = ToDouble(C_GvPresupuestos_LblTotalReduccion.innerText.replace("$", "").replace(",", ""));
|
||||
|
||||
var SaldoFinalTotal = SaldoTotal - reduccionTotal;
|
||||
|
||||
C_GvPresupuestos_LblTotalSaldoFinal.innerText = '$ ' + FormatoNumero(SaldoFinalTotal);
|
||||
|
||||
}
|
||||
function Transferencia(i, Opc) {
|
||||
|
||||
var SaldoFinalTotal = 0;
|
||||
|
||||
switch (Opc) {
|
||||
case "A":
|
||||
$("#C_GvPresupuestos_TxtReduccion_" + i).val('');
|
||||
|
||||
var saldo = ToDouble($("#C_GvPresupuestos_LtlSaldo_" + i).text().replace("$", "").replace(",", ""));
|
||||
var ampliacion = ToDouble($("#C_GvPresupuestos_TxtAmpliacion_" + i).val().replace("$", "").replace(",", ""));
|
||||
|
||||
var SaldoFinal = saldo + ampliacion;
|
||||
|
||||
$("#C_GvPresupuestos_LtlSaldoFinal_" + i).text("$" +formato_numero(SaldoFinal, 2, '.', ','));
|
||||
break;
|
||||
case "R":
|
||||
$("#C_GvPresupuestos_TxtAmpliacion_" + i).val('');
|
||||
|
||||
var saldo = ToDouble($("#C_GvPresupuestos_LtlSaldo_" + i).text().replace("$", "").replace(",", ""));
|
||||
var reduccion = ToDouble($("#C_GvPresupuestos_TxtReduccion_" + i).val().replace("$", "").replace(",", ""));
|
||||
|
||||
var SaldoFinal = saldo - reduccion;
|
||||
|
||||
$("#C_GvPresupuestos_LtlSaldoFinal_" + i).text("$" +formato_numero(SaldoFinal, 2, '.', ','));
|
||||
break;
|
||||
}
|
||||
calculaTotalAmpliacion();
|
||||
calculaTotalReduccion();
|
||||
|
||||
var SaldoTotal = ToDouble(C_GvPresupuestos_LblTotalSaldo.innerText.replace("$", "").replace(",", ""));
|
||||
var reduccionTotal = ToDouble(C_GvPresupuestos_LblTotalReduccion.innerText.replace("$", "").replace(",", ""));
|
||||
var ampliacionTotal = ToDouble(C_GvPresupuestos_LblTotalAmpliacion.innerText.replace("$", "").replace(",", ""));
|
||||
|
||||
SaldoFinalTotal = SaldoTotal + ampliacionTotal - reduccionTotal;
|
||||
|
||||
C_GvPresupuestos_LblTotalSaldoFinal.innerText = '$ ' + FormatoNumero(SaldoFinalTotal);
|
||||
|
||||
}
|
||||
|
||||
function calculaTotalReduccion() {
|
||||
var total = 0;
|
||||
$(".sumaGVReduccion").each(function () {
|
||||
total += ToDouble(this.value);
|
||||
});
|
||||
C_GvPresupuestos_LblTotalReduccion.innerText = '$ ' + FormatoNumero(total);
|
||||
}
|
||||
function calculaTotalAmpliacion() {
|
||||
var total = 0;
|
||||
$(".sumaGVAmpliacion").each(function () {
|
||||
total += ToDouble(this.value);
|
||||
});
|
||||
C_GvPresupuestos_LblTotalAmpliacion.innerText = '$ ' + FormatoNumero(total);
|
||||
}
|
||||
function minmax(value, min, max) {
|
||||
if (parseInt(value) < min || isNaN(parseInt(value)))
|
||||
return "";
|
||||
else if (parseInt(value) > max)
|
||||
return max;
|
||||
else return value;
|
||||
}
|
||||
function formato_numero(numero, decimales, separador_decimal, separador_miles) {
|
||||
numero = parseFloat(numero);
|
||||
if (isNaN(numero)) {
|
||||
return "";
|
||||
}
|
||||
|
||||
if (decimales !== undefined) {
|
||||
// Redondeamos
|
||||
numero = numero.toFixed(decimales);
|
||||
}
|
||||
|
||||
// Convertimos el punto en separador_decimal
|
||||
numero = numero.toString().replace(".", separador_decimal !== undefined ? separador_decimal : ",");
|
||||
|
||||
if (separador_miles) {
|
||||
// Añadimos los separadores de miles
|
||||
var miles = new RegExp("(-?[0-9]+)([0-9]{3})");
|
||||
while (miles.test(numero)) {
|
||||
numero = numero.replace(miles, "$1" + separador_miles + "$2");
|
||||
}
|
||||
}
|
||||
|
||||
return numero;
|
||||
}
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
289
Contratos/ModificarPresupuesto.aspx.vb
Normal file
289
Contratos/ModificarPresupuesto.aspx.vb
Normal file
@@ -0,0 +1,289 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class Contratos_ModificarPresupuesto
|
||||
Inherits ClsPaginas
|
||||
Enum TipoModificacion
|
||||
Ampliacion
|
||||
Reduccion
|
||||
Transferencia
|
||||
End Enum
|
||||
#Region "P R O P I E D A D E S"
|
||||
Public ReadOnly Property EstatusFinal() As Integer
|
||||
Get
|
||||
Return 2
|
||||
End Get
|
||||
End Property
|
||||
Public Property CvePresupuesto() As Integer
|
||||
Get
|
||||
Return ViewState("CvePresupuesto").ToString.ToEntero
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
ViewState("CvePresupuesto") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property Tipo() As TipoModificacion
|
||||
Get
|
||||
Return DirectCast(ViewState("Tipo"), TipoModificacion)
|
||||
End Get
|
||||
Set(ByVal value As TipoModificacion)
|
||||
ViewState("Tipo") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property DtPresupuestos() As DataTable
|
||||
Get
|
||||
Return DirectCast(ViewState("DtPresupuestos"), DataTable)
|
||||
End Get
|
||||
Set(ByVal value As DataTable)
|
||||
ViewState("DtPresupuestos") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property DtClasificaciones() As DataTable
|
||||
Get
|
||||
Return DirectCast(ViewState("DtClasificaciones"), DataTable)
|
||||
End Get
|
||||
Set(ByVal value As DataTable)
|
||||
ViewState("DtClasificaciones") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
Me.CvePresupuesto = IfNull(Request("CvePresupuesto"), -1).ToString.ToEntero
|
||||
InicializaValores()
|
||||
CargaDatos()
|
||||
|
||||
UpDatosG.Update()
|
||||
UpGvClasificaciones.Update()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region "I N I C I A L I Z A - V A L O R E S"
|
||||
Private Sub InicializaValores()
|
||||
Dim ObjContrato As New ClsContratos()
|
||||
'Dim CvePresupuesto = -1
|
||||
Dim Nombre = "-1"
|
||||
Dim CveSubProyecto = -1
|
||||
Dim CveUsuario = -1
|
||||
If ObjContrato.GetPresupuestos(-1, Nombre, CveSubProyecto, EstatusFinal, CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
DtPresupuestos = ObjContrato.DtResultados.Copy
|
||||
End If
|
||||
ObjContrato.Dispose()
|
||||
If DtPresupuestos IsNot Nothing Then
|
||||
DdlPresupuesto.DataSource = DtPresupuestos
|
||||
|
||||
DdlPresupuesto.DataBind()
|
||||
DdlPresupuesto.Items.Insert(0, New ListItem("Seleccione un presupuesto", "-1"))
|
||||
DdlPresupuesto.SelectedValueExist(CvePresupuesto)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "C A R G A - D A T O S"
|
||||
Private Sub CargaDatos()
|
||||
Dim CvePresupuesto = DdlPresupuesto.SelectedValue.ToEntero
|
||||
Dim Nombre = "-1"
|
||||
Dim CveSubProyecto = -1
|
||||
Dim CveUsuario = -1
|
||||
Dim Agrupador = 1 'CLASIFICACION
|
||||
If CvePresupuesto > 0 Then
|
||||
TxtFecha.Text = Now.ToString("dd/MM/yyyy")
|
||||
Dim DrPresupuesto = DtPresupuestos.FiltroPrimero($"CvePresupuesto = {CvePresupuesto}")
|
||||
'Dim DrPresupuesto = DtPresupuestos.AsEnumerable.Where(Function(a) a("CvePresupuesto").ToString.ToEntero = CvePresupuesto).FirstOrDefault
|
||||
|
||||
Dim FechaI As Date = DrPresupuesto("FechaInicio").ToString.ToDate
|
||||
Dim FechaF As Date = DrPresupuesto("FechaFin").ToString.ToDate
|
||||
|
||||
Dim ObjContrato As New ClsContratos()
|
||||
If ObjContrato.GetPresupuestosModificacionesDetalle(CvePresupuesto, FechaI, FechaF, UsuarioActual.CveEmpresa) Then
|
||||
DtClasificaciones = ObjContrato.DtResultados.FiltraParametros("CveClasificacion > 0")
|
||||
End If
|
||||
ObjContrato.Dispose()
|
||||
|
||||
If DtClasificaciones IsNot Nothing Then
|
||||
GvPresupuestos.DataSource = DtClasificaciones
|
||||
GvPresupuestos.DataBind()
|
||||
End If
|
||||
|
||||
Dim StrTipo = DdlTipo.SelectedValue
|
||||
|
||||
Select Case StrTipo
|
||||
'A M P L I A C I O N
|
||||
Case "1"
|
||||
Me.Tipo = TipoModificacion.Ampliacion
|
||||
GvPresupuestos.Columns(3).Visible = True
|
||||
GvPresupuestos.Columns(4).Visible = False
|
||||
'R E D U C C I O N
|
||||
Case "2"
|
||||
Me.Tipo = TipoModificacion.Reduccion
|
||||
GvPresupuestos.Columns(3).Visible = False
|
||||
GvPresupuestos.Columns(4).Visible = True
|
||||
'T R A N S F E R E N C I A'
|
||||
Case "1,2"
|
||||
Me.Tipo = TipoModificacion.Transferencia
|
||||
GvPresupuestos.Columns(3).Visible = True
|
||||
GvPresupuestos.Columns(4).Visible = True
|
||||
End Select
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub GvPresupuestos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvPresupuestos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
Dim StrTipo = DdlTipo.SelectedValue
|
||||
Dim Index = e.Row.RowIndex
|
||||
Select Case StrTipo
|
||||
'A M P L I A C I O N
|
||||
Case "1"
|
||||
e.Row.FCTextBox("TxtAmpliacion").Attributes.Add("onKeyUp ", $"Ampliacion({Index});")
|
||||
'R E D U C C I O N
|
||||
Case "2"
|
||||
Dim Saldo As Decimal = e.Row.FCLabel("LtlSaldo").Text.Replace("$", "").ToDecimal
|
||||
e.Row.FCTextBox("TxtReduccion").Attributes.Add("onKeyUp ", $"this.value = minmax(this.value, 0, {Saldo});Reduccion({Index});")
|
||||
'T R A N S F E R E N C I A'
|
||||
Case "1,2"
|
||||
Dim Saldo As Decimal = e.Row.FCLabel("LtlSaldo").Text.Replace("$", "").ToDecimal
|
||||
e.Row.FCTextBox("TxtAmpliacion").Attributes.Add("onKeyUp ", $"Transferencia({Index},'A');")
|
||||
e.Row.FCTextBox("TxtReduccion").Attributes.Add("onKeyUp ", $"this.value = minmax(this.value, 0, {Saldo});Transferencia({Index},'R');")
|
||||
End Select
|
||||
End If
|
||||
If e.Row.RowType = DataControlRowType.Footer Then
|
||||
e.Row.FCLabel("LblTotalSaldo").Text = String.Format("{0:C}", DtClasificaciones.SUM("PorEjercer"))
|
||||
e.Row.FCLabel("LblTotalImporte").Text = String.Format("{0:C}", DtClasificaciones.SUM("Autorizado"))
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub DdlPresupuesto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPresupuesto.SelectedIndexChanged
|
||||
CargaDatos()
|
||||
UpDatosG.Update()
|
||||
UpGvClasificaciones.Update()
|
||||
End Sub
|
||||
Protected Sub DdlTipo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipo.SelectedIndexChanged
|
||||
Dim Tipo = DdlTipo.SelectedValue
|
||||
|
||||
Select Case Tipo
|
||||
'A M P L I A C I O N
|
||||
Case "1"
|
||||
GvPresupuestos.Columns(3).Visible = True
|
||||
GvPresupuestos.Columns(4).Visible = False
|
||||
'R E D U C C I O N
|
||||
Case "2"
|
||||
GvPresupuestos.Columns(3).Visible = False
|
||||
GvPresupuestos.Columns(4).Visible = True
|
||||
'T R A N S F E R E N C I A'
|
||||
Case "1,2"
|
||||
GvPresupuestos.Columns(3).Visible = True
|
||||
GvPresupuestos.Columns(4).Visible = True
|
||||
End Select
|
||||
|
||||
For Each GvRow As GridViewRow In GvPresupuestos.Rows
|
||||
If GvRow.RowType = DataControlRowType.DataRow Then
|
||||
Dim Index = GvRow.RowIndex
|
||||
Select Case Tipo
|
||||
'A M P L I A C I O N
|
||||
Case "1"
|
||||
GvRow.FCTextBox("TxtAmpliacion").Attributes.Add("onKeyUp ", $"Ampliacion({Index});")
|
||||
'R E D U C C I O N
|
||||
Case "2"
|
||||
Dim Saldo As Decimal = GvRow.FCLabel("LtlSaldo").Text.Replace("$", "").ToDecimal
|
||||
GvRow.FCTextBox("TxtReduccion").Attributes.Add("onKeyUp ", $"this.value = minmax(this.value, 0, {Saldo});Reduccion({Index});")
|
||||
'T R A N S F E R E N C I A'
|
||||
Case "1,2"
|
||||
Dim Saldo As Decimal = GvRow.FCLabel("LtlSaldo").Text.Replace("$", "").ToDecimal
|
||||
GvRow.FCTextBox("TxtAmpliacion").Attributes.Add("onKeyUp ", $"Transferencia({Index},'A');")
|
||||
GvRow.FCTextBox("TxtReduccion").Attributes.Add("onKeyUp ", $"this.value = minmax(this.value, 0, {Saldo});Transferencia({Index},'R');")
|
||||
End Select
|
||||
End If
|
||||
Next
|
||||
UpGvClasificaciones.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
Private Function ValidaDatos() As Boolean
|
||||
Dim CvePresupuesto = DdlPresupuesto.SelectedValue.ToEntero
|
||||
If CvePresupuesto <= 0 Then
|
||||
Alert("Seleccione un Presupuesto.", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
If String.IsNullOrEmpty(TxtJustificion.Text) Then
|
||||
Alert("El campo 'Justificación' no puede estar vacío.", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
If String.IsNullOrEmpty(TxtFecha.Text) Then
|
||||
Alert("El campo 'Fecha' no puede estar vacío.", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
|
||||
If ValidaDatos() Then
|
||||
Dim CvePresupuesto = DdlPresupuesto.SelectedValue.ToEntero
|
||||
Dim Tipo = DdlTipo.SelectedValue
|
||||
Dim Justificacion = TxtJustificion.Text
|
||||
Dim Fecha = TxtFecha.Text.ToDate
|
||||
|
||||
Dim TieneError = False
|
||||
Dim ObjPresu As New ClsContratos
|
||||
ObjPresu.IniciaTransacSQL()
|
||||
|
||||
For Each GvRow As GridViewRow In GvPresupuestos.Rows
|
||||
If GvRow.RowType = DataControlRowType.DataRow Then
|
||||
Dim CvePresupuestoDetalle = GvRow.DataKey("CvePresupuestoDetalle").ToEntero
|
||||
Dim CveCompra = -1
|
||||
If CvePresupuestoDetalle > 0 Then
|
||||
|
||||
Select Case Tipo
|
||||
'A M P L I A C I O N
|
||||
Case "1"
|
||||
Dim Ampliacion = GvRow.FCTextBox("TxtAmpliacion").Text.ToDecimal
|
||||
If Ampliacion > 0 Then
|
||||
TieneError = Not ObjPresu.AddPresupuestoMovimiento(CvePresupuestoDetalle, CveCompra, 1, Ampliacion, Fecha, Justificacion)
|
||||
End If
|
||||
'R E D U C C I O N
|
||||
Case "2"
|
||||
Dim Reduccion = GvRow.FCTextBox("TxtReduccion").Text.ToDecimal
|
||||
If Reduccion > 0 Then
|
||||
TieneError = Not ObjPresu.AddPresupuestoMovimiento(CvePresupuestoDetalle, CveCompra, 2, Reduccion, Fecha, Justificacion)
|
||||
End If
|
||||
'T R A N S F E R E N C I A'
|
||||
Case "1,2"
|
||||
Dim Ampliacion = GvRow.FCTextBox("TxtAmpliacion").Text.ToDecimal
|
||||
If Ampliacion > 0 Then
|
||||
TieneError = Not ObjPresu.AddPresupuestoMovimiento(CvePresupuestoDetalle, CveCompra, 1, Ampliacion, Fecha, Justificacion)
|
||||
End If
|
||||
|
||||
If Not TieneError Then
|
||||
Dim Reduccion = GvRow.FCTextBox("TxtReduccion").Text.ToDecimal
|
||||
If Reduccion > 0 Then
|
||||
TieneError = Not ObjPresu.AddPresupuestoMovimiento(CvePresupuestoDetalle, CveCompra, 2, Reduccion, Fecha, Justificacion)
|
||||
End If
|
||||
End If
|
||||
|
||||
End Select
|
||||
|
||||
End If
|
||||
If TieneError Then
|
||||
Exit For
|
||||
End If
|
||||
|
||||
End If
|
||||
Next
|
||||
If TieneError Then
|
||||
ObjPresu.RollBack()
|
||||
Alert("Ocurrió un error al guardar los datos.", TipoMensaje.MsgError)
|
||||
Else
|
||||
ObjPresu.Commit()
|
||||
Alert("Se guardaron los datos correctamente.")
|
||||
End If
|
||||
ObjPresu.Dispose()
|
||||
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
193
Contratos/PopUpBuscarContrato.aspx
Normal file
193
Contratos/PopUpBuscarContrato.aspx
Normal file
@@ -0,0 +1,193 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PopUpBuscarContrato.aspx.vb" Inherits="Contratos_PopUpBuscarContrato" %>
|
||||
|
||||
<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="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Buscar Contrato
|
||||
</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>
|
||||
<asp:Panel ID="PnlPrincipal" runat="server" HorizontalAlign="Center" DefaultButton="BtnBuscar" Width="750px">
|
||||
<table class="Widthall">
|
||||
<tr>
|
||||
<td class="Titulos" colspan="4">Filtros para búsqueda de contratos</td>
|
||||
</tr>
|
||||
<tr style="text-align:left">
|
||||
<td class="text-right" style="height:25px!important"><b>Compra/Venta:</b></td>
|
||||
<td style="height:25px!important">
|
||||
<asp:DropDownList id="DdlTipo" AutoPostBack="true" Height="30px" Width="150" runat="server" >
|
||||
<asp:ListItem Value="1">Venta</asp:ListItem>
|
||||
<asp:ListItem Value="0">Compra</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</td>
|
||||
|
||||
<td class="text-right"><b>Tipo Contrato:</b></td>
|
||||
<td>
|
||||
<asp:DropDownList id="DdlTipoContrato" Width="150" Height="30px" DataValueField="CveContratoTipo" DataTextField="ContratoTipo" runat="server" CssClass="select2me" ></asp:DropDownList>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="text-align:left">
|
||||
<td class="text-right" style="height:25px!important"><b>No. Contrato:</b></td>
|
||||
<td style="height:25px!important">
|
||||
<asp:TextBox ID="TxtNumeroContrato" Height="30px" runat="server" autofocus></asp:TextBox>
|
||||
</td>
|
||||
<td class="text-right" style="height:25px!important"><b>Descripción:</b></td>
|
||||
<td style="height:25px!important">
|
||||
<asp:TextBox ID="TxtDescripcion" MaxLength="255" Height="30px" runat="server"></asp:TextBox>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="text-align:left" >
|
||||
<td class="text-right" style="height:25px!important"><b>Ubicación:</b></td>
|
||||
<td style="height:25px!important"> <asp:TextBox ID="TxtUbicacion" MaxLength="50" Height="30px" runat="server"></asp:TextBox>
|
||||
</td>
|
||||
<td class="text-right" style="height:25px!important"><b>Responsable:</b></td>
|
||||
<td style="height:25px!important">
|
||||
<asp:TextBox ID="TxtResponsable" MaxLength="50" Height="30px" runat="server"></asp:TextBox>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="text-align:left">
|
||||
|
||||
<td class="text-right" style="height:25px!important"><b><asp:Literal runat="server" ID="ltlContratante" Text="Cliente"></asp:Literal></b></td>
|
||||
<td style="height:25px!important">
|
||||
<asp:DropDownList id="DdlCliente" AppendDataBoundItems="true" Width="150" Height="30px" DataValueField="CveCliente" DataTextField="NombreComercial" runat="server" CssClass="select2me" >
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:DropDownList id="DdlProveedor" AppendDataBoundItems="true" Width="150" Height="30px" DataValueField="CveProveedor" DataTextField="RazonSocial" runat="server" CssClass="select2me" >
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</td>
|
||||
<td class="text-right" style="height:25px!important"><b>Estatus:</b></td>
|
||||
<td style="height:25px!important">
|
||||
<asp:CheckBox ID="ChkEstatus" runat="server" Height="30px" Text="Activo"/>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr style="text-align:left">
|
||||
<td class="text-right" style="height:25px!important"><b>Proyecto:</b></td>
|
||||
<td style="height:25px!important">
|
||||
<asp:DropDownList ID="DdlProyecto" Height="30px" AutoPostBack="true" Width="150" DataValueField="CveProyecto" DataTextField="Proyecto" runat="server" CssClass="select2me"></asp:DropDownList>
|
||||
</td>
|
||||
<td class="text-right" style="height:25px!important"><b>SubProyecto:</b></td>
|
||||
<td style="height:25px!important">
|
||||
<asp:DropDownList ID="DdlSubProtecto" Height="30px" Width="150" DataValueField="CveSubProyecto" DataTextField="SubProyecto" runat="server" CssClass="select2me"></asp:DropDownList>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: center;" colspan="4" >
|
||||
<asp:Button ID="BtnBuscar" runat="server" Text="Buscar" class="btn btn-primary" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</asp:Panel>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table id="TblBusqueda" runat="server" border="0" visible="true" style="width:100%">
|
||||
<tr>
|
||||
<td style="text-align:left">Número de registros encontrados: <b><asp:Literal ID="LtlTotalRegistros" runat="server"></asp:Literal></b></td>
|
||||
<td >
|
||||
<div id="DvBusqueda" class="" align="right" style="margin-right:30px!important">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GV.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GV.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
|
||||
<asp:GridView ID="GV" runat="server" DataKeyNames="CveContrato, NumeroContrato,CveCliente,CveProveedor" AutoGenerateColumns="false" EmptyDataText="No se encontraron registros" ToolTip="Listado de Contratos Encontrados." CssClass="table table-striped table-hover Widthall ScrollAD" data-sort="true" GridLines="None" >
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="No. Contrato" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal id="LtlNumeroContrato" runat="server" Text='<%# Eval("NumeroContrato") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Descrpción" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100" ItemStyle-CssClass="truncate" >
|
||||
<ItemTemplate>
|
||||
<asp:Literal id="LtlDescripcionContrato" runat="server" Text='<%# Eval("DescripcionContrato") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Cliente" ItemStyle-HorizontalAlign="Left" >
|
||||
<ItemTemplate>
|
||||
<asp:Literal id="LtlCliente" runat="server" Text='<%# Eval("Cliente") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Proveedor" ItemStyle-HorizontalAlign="Left" >
|
||||
<ItemTemplate>
|
||||
<asp:Literal id="LtlProveedor" runat="server" Text='<%# Eval("Proveedor") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Estatus" Visible="false" ItemStyle-Width="70">
|
||||
<ItemTemplate>
|
||||
<asp:Literal id="LtlEstatus" runat="server" Text='<%# Eval("SEstatusContrato") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Fecha Inicial" ItemStyle-Width="80">
|
||||
<ItemTemplate>
|
||||
<asp:Literal id="LtlFechaInicial" runat="server" Text='<%# Eval("FechaInicial", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Fecha Final" ItemStyle-Width="80">
|
||||
<ItemTemplate>
|
||||
<asp:Literal id="LtlFechaFinal" runat="server" Text='<%# Eval("FechaFinal", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
</asp:GridView>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script language="javascript" type="text/javascript">
|
||||
function Ir(v) {
|
||||
window.open('v', '_blank');
|
||||
}
|
||||
function Ir2(CveContrato, NumeroContrato) {
|
||||
window.opener.VinculaContrato(CveContrato, NumeroContrato);
|
||||
window.close();
|
||||
}
|
||||
function Ir3(CveOC, Folio, CveEstatusSiguiente) {
|
||||
window.opener.VinculaOC(CveOC, Folio, CveEstatusSiguiente);
|
||||
window.close();
|
||||
}
|
||||
|
||||
function format(input) {
|
||||
var num = input.value.split('.', 1);
|
||||
var decimal = input.value.replace(num.value, '');
|
||||
num = num.value.replace(/\,/g, '');
|
||||
if (!isNaN(num)) {
|
||||
num = num.toString().split('').reverse().join('').replace(/(?=\d*\.?)(\d{3})/g, '$1,');
|
||||
num = num.split('').reverse().join('').replace(/^[\,]/, '');
|
||||
input.value = num + decimal;
|
||||
}
|
||||
}
|
||||
|
||||
function cpf(t) {
|
||||
var v = t.value.replace(/([^0-9\.]+)/g, '');
|
||||
v = v.replace(/^[\.]/, '');
|
||||
v = v.replace(/[\.][\.]/g, '');
|
||||
v = v.replace(/\.(\d)(\d)(\d)/g, '.$1$2');
|
||||
v = v.replace(/\.(\d{1,2})\./g, '.$1');
|
||||
v = v.toString().split('').reverse().join('').replace(/(\d{3})/g, '$1,');
|
||||
v = v.split('').reverse().join('').replace(/^[\,]/, '');
|
||||
t.value = v;
|
||||
}
|
||||
|
||||
</script>
|
||||
</asp:Content>
|
||||
178
Contratos/PopUpBuscarContrato.aspx.vb
Normal file
178
Contratos/PopUpBuscarContrato.aspx.vb
Normal file
@@ -0,0 +1,178 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Partial Class Contratos_PopUpBuscarContrato
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "PROPIEDADES"
|
||||
Private ReadOnly Property Vinculacion As String
|
||||
Get
|
||||
Return ViewState("Vinculacion").ToString
|
||||
End Get
|
||||
End Property
|
||||
Private ReadOnly Property CveProveedor As String
|
||||
Get
|
||||
Return ViewState("CveProveedor").ToString
|
||||
End Get
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
|
||||
CType(Me.Master, BaseMasterPage).EsPopup = True
|
||||
|
||||
ChkEstatus.Checked = True
|
||||
loadComboTipoContrato()
|
||||
CargaProyecto()
|
||||
CargaDatos()
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
DdlCliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa)
|
||||
DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
|
||||
DdlCliente.DataBind()
|
||||
DdlProveedor.DataBind()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaProyecto()
|
||||
If UsuarioActual.Empresa.GralSoloProyecto Then
|
||||
CargaSubProyectoContrato(-1)
|
||||
Else
|
||||
DdlProyecto.DataSource = GlobalDTProyectos(UsuarioActual.Empresa.CveEmpresa)
|
||||
DdlProyecto.DataBind()
|
||||
End If
|
||||
DdlProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlSubProtecto.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyecto.SelectedIndexChanged
|
||||
CargaSubProyectoContrato(DdlProyecto.SelectedValue.ToEntero)
|
||||
End Sub
|
||||
Protected Sub CargaSubProyectoContrato(CveProyecto As Integer)
|
||||
DdlSubProtecto.Items.Clear()
|
||||
DdlSubProtecto.DataSource = GlobalDTSubProyectos(CveProyecto, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("", "", {"CveSubproyecto", "SubProyecto"})
|
||||
DdlSubProtecto.DataBind()
|
||||
DdlSubProtecto.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
UPFiltros.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub loadComboTipoContrato()
|
||||
|
||||
|
||||
If DdlTipo.SelectedValue.ToEntero = 1 Then
|
||||
'3 cliente
|
||||
'4 proveedor
|
||||
GV.Columns(3).Visible = False
|
||||
GV.Columns(2).Visible = True
|
||||
ltlContratante.Text = "Cliente"
|
||||
DdlCliente.Visible = True
|
||||
DdlProveedor.Visible = False
|
||||
DdlCliente.SelectedValue = "-1"
|
||||
Else
|
||||
ltlContratante.Text = "Proveedor"
|
||||
GV.Columns(3).Visible = True
|
||||
GV.Columns(2).Visible = False
|
||||
DdlProveedor.Visible = True
|
||||
DdlCliente.Visible = False
|
||||
DdlProveedor.SelectedValue = "-1"
|
||||
End If
|
||||
UPFiltros.Update()
|
||||
UPDatos.Update()
|
||||
|
||||
Try
|
||||
DdlTipoContrato.DataSource = GlobalDTContratosTipos.FiltraParametros($" CveEmpresa = {UsuarioActual.CveEmpresa} AND TipoMovimiento = {DdlTipo.SelectedValue }")
|
||||
DdlTipoContrato.DataBind()
|
||||
DdlTipoContrato.Items.Insert(0, New ListItem("Seleccione una opción", "-1"))
|
||||
|
||||
Catch ex As Exception
|
||||
Alert(ex.Message, TipoMensaje.MsgError)
|
||||
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnVincular_Click(sender As Object, e As EventArgs)
|
||||
Dim CveContrato As String = ""
|
||||
Dim NumeroContrato As String = ""
|
||||
For i As Integer = 0 To (GV.Rows.Count - 1)
|
||||
If GV.Rows(i).FCCheckBox("CheckVincular").Checked = True Then
|
||||
If CveContrato <> "" Then
|
||||
CveContrato &= String.Format(",{0}", GV.Rows(i).DataKey("CveContrato").ToString)
|
||||
NumeroContrato &= String.Format(",{0}", GV.Rows(i).DataKey("NumeroContrato").ToString)
|
||||
Else
|
||||
CveContrato = GV.Rows(i).DataKey("CveContrato").ToString
|
||||
NumeroContrato = GV.Rows(i).DataKey("NumeroContrato").ToString
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
If CveContrato <> "" AndAlso CveContrato.Length > 0 Then
|
||||
RegistraScript(String.Format("javascript:Ir2('{0}','{1}');", CveContrato, NumeroContrato))
|
||||
Else
|
||||
Alert("No seleccionó ningún Contrato, Por lo cual no se puede vincular.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub DdlTipo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipo.SelectedIndexChanged
|
||||
loadComboTipoContrato()
|
||||
|
||||
End Sub
|
||||
Protected Sub BtnBuscar_Click(sender As Object, e As EventArgs) Handles BtnBuscar.Click
|
||||
|
||||
Dim objContratos As New ClsContratos
|
||||
|
||||
Dim NumeroContrato As String = "-1"
|
||||
Dim Estatus As Integer = 1
|
||||
Dim Descripcion As String = "-1"
|
||||
Dim Ubicacion As String = "-1"
|
||||
Dim Responsable As String = "-1"
|
||||
|
||||
|
||||
|
||||
If ChkEstatus.Checked Then Estatus = 1 Else Estatus = 0
|
||||
If TxtDescripcion.Text.Trim.Length > 0 Then Descripcion = TxtDescripcion.Text
|
||||
If TxtUbicacion.Text.Trim.Length > 0 Then Ubicacion = TxtUbicacion.Text
|
||||
If TxtResponsable.Text.Trim.Length > 0 Then Responsable = TxtResponsable.Text
|
||||
If TxtNumeroContrato.Text.Trim.Length > 0 Then NumeroContrato = TxtNumeroContrato.Text
|
||||
|
||||
If (objContratos.GetContratosBusquedaRep(DdlTipo.SelectedValue.ToEntero, DdlTipoContrato.SelectedValue.ToEntero, NumeroContrato, Descripcion,
|
||||
Ubicacion, Responsable, Estatus, DdlProyecto.SelectedValue.ToEntero, DdlSubProtecto.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa, DdlCliente.SelectedValue.ToEntero, DdlProveedor.SelectedValue.ToEntero)) Then
|
||||
GV.DataSource = objContratos.DtResultados
|
||||
LtlTotalRegistros.Text = objContratos.DtResultados.Rows.Count.ToString
|
||||
Else
|
||||
GV.DataSource = Nothing
|
||||
LtlTotalRegistros.Text = "0"
|
||||
End If
|
||||
|
||||
|
||||
|
||||
objContratos.Dispose()
|
||||
GV.DataBind()
|
||||
UPDatos.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GV.RowDataBound
|
||||
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
Dim Liga As String = String.Format("<a class='Texto' href='/Contratos/Contrato.aspx?CveContrato={0}' target='_blank'>", e.Row.DBCampo("CveContrato"))
|
||||
Dim LigaCliente As String = String.Format("<a class='Texto' href='/Ventas/Clientes.aspx?CveCliente={0}' target='_blank'>", e.Row.DBCampo("CveCliente"))
|
||||
Dim LigaProveedor As String = String.Format("<a class='Texto' href='/Compras/Proveedores.aspx?CveProveedor={0}' target='_blank'>", e.Row.DBCampo("CveProveedor"))
|
||||
|
||||
e.Row.FCLiteral("LtlNumeroContrato").Text = String.Format("<div class='truncate' style='width:100px;'>{0}{1}</a></div>", Liga, e.Row.DBCampo("NumeroContrato"))
|
||||
e.Row.FCLiteral("LtlDescripcionContrato").Text = String.Format("<div class='truncate' style='width:200px;'>{0}</div>", e.Row.DBCampo("DescripcionContrato"))
|
||||
|
||||
e.Row.FCLiteral("LtlCliente").Text = String.Format("<div class='truncate' style='width:200px;'>{0}{1}</a></div>", LigaCliente, e.Row.DBCampo("Cliente"))
|
||||
e.Row.FCLiteral("LtlProveedor").Text = String.Format("<div class='truncate' style='width:200px;'>{0}{1}</a></div>", LigaProveedor, e.Row.DBCampo("Proveedor"))
|
||||
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
328
Contratos/Presupuestos.aspx
Normal file
328
Contratos/Presupuestos.aspx
Normal file
@@ -0,0 +1,328 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Presupuestos.aspx.vb" Inherits="Contratos_Presupuestos" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
.dashboard-stat2 .display .number h3 {
|
||||
font-size: 16px;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Presupuestos
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkAutorizar" runat="server" data-toggle="confirmation" data-popout="true" data-original-title="¿Desea autorizar el presupuesto?" data-btn-ok-label="si"><i class="fa fa-check"></i> Autorizar</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:HyperLink ID="HlModificar" Target="_blank" Visible="false" runat="server"><i class="fa fa-edit"></i> Modificar Presupuesto</asp:HyperLink>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</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-md-6">
|
||||
<div class="portlet light smmallpadding bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="fa fa-info-circle"></i>Datos Generales
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="fullscreen" data-original-title="" title=""></a>
|
||||
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<asp:UpdatePanel ID="UpDatosG" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="rowpadding">
|
||||
<div class="row">
|
||||
<label class="col-md-2 truncate">Nombre:</label>
|
||||
<div class="col-md-10">
|
||||
<asp:TextBox ID="TxtPresupuesto" runat="server" CssClass="form-control input-sm"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVPresupuesto" runat="server" ControlToValidate="TxtPresupuesto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nombre''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEPresupuesto" runat="server" HighlightCssClass="vco" TargetControlID="RFVPresupuesto"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-2 truncate">Observaciones:</label>
|
||||
<div class="col-md-10">
|
||||
<asp:TextBox ID="TxtDescripcion" runat="server" CssClass="form-control" TextMode="MultiLine"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVObservacion" runat="server" ControlToValidate="TxtDescripcion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Observación''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEObs" runat="server" HighlightCssClass="vco" TargetControlID="RFVObservacion"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-2 truncate">Proyecto:</label>
|
||||
<div class="col-md-10">
|
||||
<asp:DropDownList ID="DdlProyecto" runat="server" AutoPostBack="true" CssClass="form-control input-sm select2me" DataTextField="Proyecto" DataValueField="CveProyecto"></asp:DropDownList>
|
||||
<asp:CompareValidator ID="CVProyecto" runat="server" ControlToValidate="DdlProyecto" ValueToCompare="0" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />Debe seleccionar un <b>''Proyecto''</b>, por favor seleccione uno." Operator="GreaterThan" Type="Integer" ValidationGroup="GrpGuardar"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEProyecto" runat="server" HighlightCssClass="vco" TargetControlID="CVProyecto"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-2 truncate">Sub Proyecto:</label>
|
||||
<div class="col-md-10">
|
||||
<asp:DropDownList ID="DdlSubProyecto" runat="server" CssClass="form-control input-sm select2me" DataTextField="SubProyecto2" DataValueField="CveSubProyecto"></asp:DropDownList>
|
||||
<asp:CompareValidator ID="CVSubProyeco" runat="server" ControlToValidate="DdlSubProyecto" ValueToCompare="0" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />Debe seleccionar un <b>''Proyecto''</b>, por favor seleccione uno." Operator="GreaterThan" Type="Integer" ValidationGroup="GrpGuardar"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCESubProyecto" runat="server" HighlightCssClass="vco" TargetControlID="CVSubProyeco"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="row">
|
||||
<label class="col-md-4 truncate">Fecha Inicio:</label>
|
||||
<div class="col-md-8">
|
||||
<div style="display: inline-block; vertical-align: text-bottom;">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
|
||||
<asp:TextBox ID="TxtFechaI" runat="server" CssClass="form-control" CausesValidation="true" Style="width: 118px" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="ImgFechaI" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="TxtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CEFechaI" TargetControlID="TxtFechaI" PopupButtonID="ImgFechaI" Format="dd/MM/yyyy" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVFechaI" runat="server" ControlToValidate="TxtFechaI" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="CVFechaI" runat="server" ControlToValidate="TxtFechaI" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="row">
|
||||
<label class="col-md-4 truncate">Fecha Fin:</label>
|
||||
<div class="col-md-8">
|
||||
<div style="display: inline-block; vertical-align: text-bottom;">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
|
||||
<asp:TextBox ID="TxtFechaF" runat="server" CssClass="form-control" CausesValidation="true" Style="width: 118px" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="ImgFechaF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="TxtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CEFecha" TargetControlID="TxtFechaF" PopupButtonID="ImgFechaF" Format="dd/MM/yyyy" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVFechaF" runat="server" ControlToValidate="TxtFechaF" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="CVFechaF" runat="server" ControlToValidate="TxtFechaF" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOFecha1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOFecha2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6" runat="server" id="DivIndicadores" visible="false">
|
||||
<asp:UpdatePanel UpdateMode="Conditional" ID="UpIndicadores" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h3><b>Estatus: </b>
|
||||
<asp:Literal ID="LtlEstatus" runat="server"></asp:Literal></h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-4 col-md-4">
|
||||
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
|
||||
<div class="display" style="margin-bottom: 0px">
|
||||
<div class="number">
|
||||
<h3 class="font-red-haze">
|
||||
<small class="font-red-haze">$</small>
|
||||
<span data-counter="counterup">
|
||||
<asp:Literal runat="server" ID="LtlAutorizado"></asp:Literal></span>
|
||||
</h3>
|
||||
<small>IMPORTE</small>
|
||||
</div>
|
||||
<%--<div class="icon">
|
||||
<i class="fa fa-credit-card"></i>
|
||||
</div>--%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-4">
|
||||
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding: 5px 5px 25px 5px;">
|
||||
<div class="display">
|
||||
<div class="number">
|
||||
<h3 class="font-blue-sharp">
|
||||
<small class="font-blue-sharp">$</small>
|
||||
<span data-counter="counterup">
|
||||
<asp:Literal runat="server" ID="LtlEjercido"></asp:Literal></span>
|
||||
</h3>
|
||||
<small>EJERCIDO</small>
|
||||
</div>
|
||||
<%--<div class="icon">
|
||||
<i class="icon-pie-chart"></i>
|
||||
</div>--%>
|
||||
</div>
|
||||
<div class="progress-info">
|
||||
<div class="progress">
|
||||
<span style="width: 50%;" id="PBEjercido" runat="server" class="progress-bar progress-bar-info blue-sharp">
|
||||
<span class="sr-only">
|
||||
<asp:Literal runat="server" ID="LtlPorcenEjercido"></asp:Literal></span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="status">
|
||||
<div class="status-title">Porcentaje Ejercido </div>
|
||||
<div class="status-number">
|
||||
<asp:Literal runat="server" ID="Literal3"></asp:Literal>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 col-md-4">
|
||||
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding: 5px 5px 25px 5px;">
|
||||
<div class="display">
|
||||
<div class="number">
|
||||
<h3 class="font-green-sharp">
|
||||
<small class="font-green-sharp">$</small>
|
||||
<span data-counter="counterup">
|
||||
<asp:Literal runat="server" ID="LtlPorEjercer"></asp:Literal></span>
|
||||
</h3>
|
||||
<small>POR EJERCER</small>
|
||||
</div>
|
||||
<%--<div class="icon">
|
||||
<i class="icon-pie-chart"></i>
|
||||
</div>--%>
|
||||
</div>
|
||||
<div class="progress-info">
|
||||
<div class="progress">
|
||||
<span style="width: 50%;" id="PBPorEjercer" runat="server" class="progress-bar progress-bar-success green-sharp">
|
||||
<span class="sr-only">
|
||||
<asp:Literal runat="server" ID="LtlPorcentPorEjer"></asp:Literal></span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="status">
|
||||
<div class="status-title">Porcentaje Por Ejercer </div>
|
||||
<div class="status-number">
|
||||
<asp:Literal runat="server" ID="LtlPorcentaje"></asp:Literal>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet light smmallpadding bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption" style="align-items: center">
|
||||
<i class="fa fa-info-circle"></i>Presupuestos
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="fullscreen" data-original-title="" title=""></a>
|
||||
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<div class="rowpadding">
|
||||
<asp:UpdatePanel ID="UpGvClasificaciones" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvPresupuestos" runat="server" GridLines="None" EmptyDataText="No se encontraron presupuestos" CssClass="table table-hover table-striped Widthall ScrollAD" ShowFooter="true" data-footer="1" AutoGenerateColumns="False" data-heighterror="600"
|
||||
DataKeyNames="CvePresupuestoDetalle,CveClasificacion,CveTipoGasto">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Clasificación" DataField="Clasificacion" />
|
||||
<asp:TemplateField HeaderText="Importe" HeaderStyle-HorizontalAlign="Left" FooterStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblImporteClasiTotal" runat="server" Visible="false"></asp:Label>
|
||||
<asp:TextBox ID="TxtImporteClasi" runat="server" Text='<%#Eval("Importe") %>'></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="SoloNumerosCantidad" runat="server" TargetControlID="TxtImporteClasi" FilterType="Custom, Numbers" ValidChars=".," />
|
||||
</ItemTemplate>
|
||||
<FooterTemplate>
|
||||
<b>Total :</b>
|
||||
<asp:Label ID="LblTotal" CssClass="LabelGVTotal" runat="server"></asp:Label>
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Observaciones" HeaderStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtObservacion" runat="server" CssClass="form-control input-sm" Text='<%# Eval("Observacion") %>'></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="Tipo Gasto" DataField="TipoGasto" />
|
||||
</Columns>
|
||||
<FooterStyle CssClass="Totales" />
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UpGuardar" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-2">
|
||||
<asp:Button ID="BtnGuardar" runat="server" Text="Guardar" CssClass="btn btn-primary" ValidationGroup="GrpGuardar" />
|
||||
</div>
|
||||
<div class="col-md-5"></div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script type="text/javascript">
|
||||
function calculaTotalTipoGasto(TipoGasto) {
|
||||
var total = 0;
|
||||
$(".txt" + TipoGasto).each(function () {
|
||||
total += ToDouble(this.value);
|
||||
});
|
||||
$(".LabelGVTotal" + TipoGasto).text('$ ' + formato_numero(total, 2, '.', ','));
|
||||
}
|
||||
function calculaTotal() {
|
||||
var total = 0;
|
||||
$(".sumaGV").each(function () {
|
||||
total += ToDouble(this.value);
|
||||
});
|
||||
$(".LabelGVTotal").text('$ ' + formato_numero(total, 2, '.', ','));
|
||||
}
|
||||
function formato_numero(numero, decimales, separador_decimal, separador_miles) {
|
||||
numero = parseFloat(numero);
|
||||
if (isNaN(numero)) {
|
||||
return "";
|
||||
}
|
||||
|
||||
if (decimales !== undefined) {
|
||||
// Redondeamos
|
||||
numero = numero.toFixed(decimales);
|
||||
}
|
||||
|
||||
// Convertimos el punto en separador_decimal
|
||||
numero = numero.toString().replace(".", separador_decimal !== undefined ? separador_decimal : ",");
|
||||
|
||||
if (separador_miles) {
|
||||
// Añadimos los separadores de miles
|
||||
var miles = new RegExp("(-?[0-9]+)([0-9]{3})");
|
||||
while (miles.test(numero)) {
|
||||
numero = numero.replace(miles, "$1" + separador_miles + "$2");
|
||||
}
|
||||
}
|
||||
|
||||
return numero;
|
||||
}
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
497
Contratos/Presupuestos.aspx.vb
Normal file
497
Contratos/Presupuestos.aspx.vb
Normal file
@@ -0,0 +1,497 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class Contratos_Presupuestos
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "P R O P I E D A D E S"
|
||||
|
||||
Public Property CvePresupuesto() As Integer
|
||||
Get
|
||||
Return ViewState("CvePresupuesto").ToString.ToEntero
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
ViewState("CvePresupuesto") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property EstatusActual() As Integer
|
||||
Get
|
||||
Return ViewState("EstatusActual").ToString.ToEntero
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
ViewState("EstatusActual") = value
|
||||
End Set
|
||||
End Property
|
||||
Public ReadOnly Property EstatusFinal() As Integer
|
||||
Get
|
||||
Return 2
|
||||
End Get
|
||||
End Property
|
||||
Public Property DtClasificaciones() As DataTable
|
||||
Get
|
||||
Return DirectCast(ViewState("DtClasificaciones"), DataTable)
|
||||
End Get
|
||||
Set(ByVal value As DataTable)
|
||||
ViewState("DtClasificaciones") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
CvePresupuesto = IfNull(Request("CvePresupuesto"), -1).ToString.ToEntero
|
||||
|
||||
If CvePresupuesto > 0 Then
|
||||
CargaDatos()
|
||||
Else
|
||||
InicializaValores()
|
||||
CargaClasificaciones()
|
||||
End If
|
||||
UpAcciones.Update()
|
||||
UpDatosG.Update()
|
||||
UpGvClasificaciones.Update()
|
||||
UpIndicadores.Update()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region "I N I C I A L I Z A - V A L O R E S"
|
||||
Private Sub InicializaValores()
|
||||
TxtFechaI.Text = $"01/01/{Now.Year}"
|
||||
TxtFechaF.Text = Now.ToShortDateString
|
||||
CargaProyecto()
|
||||
CargaMoneda()
|
||||
End Sub
|
||||
Private Sub CargaMoneda()
|
||||
'DdlMoneda.DataSource = GlobalDTMonedas()
|
||||
'DdlMoneda.DataBind()
|
||||
End Sub
|
||||
Private Sub CargaProyecto()
|
||||
DdlProyecto.Items.Clear()
|
||||
DdlProyecto.DataSource = GlobalDTProyectos(UsuarioActual.Empresa.CveEmpresa).FiltraParametros("", "", {"CveProyecto", "Proyecto"})
|
||||
DdlProyecto.DataBind()
|
||||
DdlProyecto.Items.Insert(0, New ListItem("Seleccione un Proyecto", "-1"))
|
||||
End Sub
|
||||
Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyecto.SelectedIndexChanged
|
||||
CargaSubProyectoContrato(DdlProyecto.SelectedValue.ToEntero)
|
||||
End Sub
|
||||
Protected Sub CargaSubProyectoContrato(CveProyecto As Integer)
|
||||
DdlSubProyecto.Items.Clear()
|
||||
If CveProyecto > 0 Then
|
||||
DdlSubProyecto.DataSource = GlobalDTSubProyectos(CveProyecto, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("", "", {"CveSubproyecto", "SubProyecto2"})
|
||||
DdlSubProyecto.DataBind()
|
||||
DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione un SubProyecto", "-1"))
|
||||
Else
|
||||
DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione un SubProyecto", "-1"))
|
||||
End If
|
||||
End Sub
|
||||
Private Sub CargaClasificaciones()
|
||||
Dim ObjPres As New ClsContratos
|
||||
If ObjPres.GetPresupuestosDetalle(-1, -1, UsuarioActual.CveEmpresa) Then
|
||||
DtClasificaciones = ObjPres.DtResultados
|
||||
End If
|
||||
ObjPres.Dispose()
|
||||
|
||||
GvPresupuestos.DataSource = DtClasificaciones
|
||||
GvPresupuestos.DataBind()
|
||||
End Sub
|
||||
Protected Sub GvPresupuestos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvPresupuestos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
Dim TipoGasto = e.Row.DBCampo("TipoGasto")
|
||||
Select Case e.Row.DBCampo("TipoTotal").ToEntero
|
||||
Case 1
|
||||
e.Row.CssClass = "SubTotales"
|
||||
e.Row.FCLabel("LblImporteClasiTotal").Visible = True
|
||||
e.Row.FCLabel("LblImporteClasiTotal").CssClass = $"LabelGVTotal{TipoGasto}"
|
||||
e.Row.FCLabel("LblImporteClasiTotal").Text = String.Format("$ {0:C}", e.Row.DBCampo("Importe").FormatoNumero)
|
||||
e.Row.FCTextBox("TxtImporteClasi").Visible = False
|
||||
e.Row.FCTextBox("TxtObservacion").Visible = False
|
||||
Case 2
|
||||
e.Row.CssClass = "Totales"
|
||||
e.Row.FCLabel("LblImporteClasiTotal").Visible = True
|
||||
e.Row.FCLabel("LblImporteClasiTotal").CssClass = "LabelGVTotal"
|
||||
e.Row.FCLabel("LblImporteClasiTotal").Text = String.Format("$ {0:C}", e.Row.DBCampo("Importe").FormatoNumero)
|
||||
e.Row.FCTextBox("TxtImporteClasi").Visible = False
|
||||
e.Row.FCTextBox("TxtObservacion").Visible = False
|
||||
Case 3
|
||||
Dim Importe = e.Row.FCTextBox("TxtImporteClasi").Text.ToDouble
|
||||
e.Row.FCTextBox("TxtImporteClasi").Text = Importe.FormatoNumero()
|
||||
e.Row.FCTextBox("TxtImporteClasi").CssClass = $"form-control input-sm sumaGV txt{TipoGasto}"
|
||||
e.Row.FCTextBox("TxtImporteClasi").Attributes.Add("onKeyUp ", $"calculaTotal();calculaTotalTipoGasto('{TipoGasto}');")
|
||||
End Select
|
||||
End If
|
||||
If e.Row.RowType = DataControlRowType.Footer Then
|
||||
Dim Importe = DtClasificaciones.SUM("Importe", "CveClasificacion IS NOT NULL")
|
||||
e.Row.FCLabel("LblTotal").Text = String.Format("{0:C}", Importe)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "C A R G A - D A T O S"
|
||||
Private Sub CargaDatos()
|
||||
CargaMoneda()
|
||||
CargaProyecto()
|
||||
EstatusActual = -1
|
||||
|
||||
If CvePresupuesto > 0 Then
|
||||
Dim ObjContrato As New ClsContratos()
|
||||
If ObjContrato.GetPresupuestos(CvePresupuesto, "-1", -1, -1, -1, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
If ObjContrato.DtResultados.Rows.Count = 1 Then
|
||||
|
||||
Dim DrContrato = ObjContrato.DtResultados.Copy(0)
|
||||
If DrContrato IsNot Nothing Then
|
||||
|
||||
Dim ImporteOriginal = DrContrato("Importe").ToString.ToDecimal
|
||||
'Dim ImporteVigente = DrContrato("ImporteVigente").ToString.ToDecimal
|
||||
'Dim CveMoneda = DrContrato("CveMoneda").ToString.ToEntero
|
||||
|
||||
'DdlMoneda.SelectedValueExist(CveMoneda)
|
||||
|
||||
'HdnTotal.Value = ImporteVigente.FormatoNumero
|
||||
|
||||
|
||||
'LblTotal.Text = String.Format("{0:C}", ImporteVigente)
|
||||
TxtPresupuesto.Text = DrContrato("Nombre").ToString
|
||||
TxtDescripcion.Text = DrContrato("Observacion").ToString
|
||||
|
||||
EstatusActual = DrContrato("Estatus").ToString.ToEntero
|
||||
|
||||
Dim CveProyecto = DrContrato("CveProyecto").ToString.ToEntero
|
||||
Dim CveSubProyecto = DrContrato("CveSubProyecto").ToString.ToEntero
|
||||
|
||||
Dim EstatusTexto = DrContrato("EstatusTexto").ToString
|
||||
|
||||
LtlEstatus.Text = EstatusTexto
|
||||
|
||||
DdlProyecto.SelectedValueExist(CveProyecto)
|
||||
CargaSubProyectoContrato(CveProyecto)
|
||||
|
||||
DdlSubProyecto.SelectedValueExist(CveSubProyecto)
|
||||
TxtFechaI.Text = DrContrato("FechaInicio").ToString.ToDate.ToString("dd/MM/yyyy")
|
||||
TxtFechaF.Text = DrContrato("FechaFin").ToString.ToDate.ToString("dd/MM/yyyy")
|
||||
DivIndicadores.Visible = True
|
||||
End If
|
||||
|
||||
If ObjContrato.GetPresupuestosDetalle(CvePresupuesto, -1, UsuarioActual.CveEmpresa) Then
|
||||
DtClasificaciones = ObjContrato.DtResultados
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
If ObjContrato.GetPresupuestosRep(CvePresupuesto, -1, 1, TxtFechaI.Text.ToDate, TxtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, DdlProyecto.SelectedValue.ToEntero,
|
||||
DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveUsuario, -1) Then
|
||||
If ObjContrato.DtResultados.Rows.Count > 0 Then
|
||||
Dim DrRep = ObjContrato.DtResultados.Copy(0)
|
||||
Dim Importe = DrRep("Autorizado").ToString.ToDecimal.FormatoNumero
|
||||
Dim Ejercido = DrRep("Ejercido").ToString.ToDecimal.FormatoNumero
|
||||
Dim PorEjercer = DrRep("PorEjercer").ToString.ToDecimal.FormatoNumero
|
||||
|
||||
|
||||
Dim EjercidoPorcentaje = DrRep("EjercidoPorcentaje").ToString.ToEntero
|
||||
Dim PorEjercerPorcentaje = DrRep("PorEjercerPorcentaje").ToString.ToEntero
|
||||
|
||||
LtlAutorizado.Text = Importe
|
||||
LtlEjercido.Text = Ejercido
|
||||
LtlPorEjercer.Text = PorEjercer
|
||||
|
||||
PBEjercido.Style.Remove("width")
|
||||
PBEjercido.Style.Add("width", $"{EjercidoPorcentaje.ToString}%")
|
||||
|
||||
PBPorEjercer.Style.Remove("width")
|
||||
PBPorEjercer.Style.Add("width", $"{PorEjercerPorcentaje.ToString}%")
|
||||
|
||||
End If
|
||||
End If
|
||||
ObjContrato.Dispose()
|
||||
|
||||
If DtClasificaciones IsNot Nothing Then
|
||||
GvPresupuestos.DataSource = DtClasificaciones
|
||||
GvPresupuestos.DataBind()
|
||||
End If
|
||||
|
||||
DeshabilitaControles(EstatusActual)
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub DeshabilitaControles(EstatusActual As Integer)
|
||||
If EstatusActual = EstatusFinal Then
|
||||
'DdlMoneda.Enabled = False
|
||||
GvPresupuestos.Enabled = False
|
||||
TxtPresupuesto.Enabled = False
|
||||
TxtDescripcion.Enabled = False
|
||||
DdlProyecto.Enabled = False
|
||||
DdlSubProyecto.Enabled = False
|
||||
|
||||
TxtFechaI.Enabled = False
|
||||
TxtFechaF.Enabled = False
|
||||
|
||||
CEFechaI.Enabled = False
|
||||
CEFecha.Enabled = False
|
||||
|
||||
ImgFechaI.Visible = False
|
||||
ImgFechaF.Visible = False
|
||||
|
||||
BtnGuardar.Enabled = False
|
||||
LnkAutorizar.Visible = False
|
||||
|
||||
HlModificar.Visible = True
|
||||
HlModificar.NavigateUrl = $"/Contratos/ModificarPresupuesto.aspx?CvePresupuesto={CvePresupuesto}"
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "G U A R D A R "
|
||||
Private Function ValidaDatos() As Boolean
|
||||
If String.IsNullOrEmpty(TxtPresupuesto.Text.Trim) Then
|
||||
Alert("Debe escirbir un nombre al presupuesto", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
If String.IsNullOrEmpty(TxtDescripcion.Text.Trim) Then
|
||||
Alert("Debe escribir una observación.", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
If String.IsNullOrEmpty(TxtFechaI.Text.Trim) Then
|
||||
Alert("Debe seleccionar un Fecha Inicio.", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
If String.IsNullOrEmpty(TxtFechaF.Text.Trim) Then
|
||||
Alert("Debe seleccionar una Fecha Fin.", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
If DdlSubProyecto.SelectedValue.ToEntero <= 0 Then
|
||||
|
||||
Alert("Debe seleccionar un Sub Proyecto.", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
Dim FechaI As Date = TxtFechaI.Text.ToDate
|
||||
Dim FechaF As Date = TxtFechaF.Text.ToDate
|
||||
|
||||
If FechaF < FechaI Then
|
||||
|
||||
Alert("La Fecha Fin no puede ser menor que la Fecha Inicio.", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
|
||||
'If HdnTotal.Value.ToDouble() <= 0 Then
|
||||
' Alert("El Total no puede ser igual o menor que 0.", TipoMensaje.MsgAdvertencia)
|
||||
' Return False
|
||||
'End If
|
||||
|
||||
Return True
|
||||
End Function
|
||||
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
|
||||
If ValidaDatos() Then
|
||||
If CvePresupuesto > 0 Then
|
||||
If ActualizarPresupuesto() Then
|
||||
Dim Liga = $"document.location.href=""/Contratos/CatPresupuestos.aspx"""
|
||||
|
||||
Alert("El Presupuesto se actualizo correctamente.", TipoMensaje.MsgInformacion, Liga)
|
||||
Else
|
||||
Alert("Ocurrió un error al actualizar el presupuesto", TipoMensaje.MsgError)
|
||||
End If
|
||||
Else
|
||||
AgregarPresupuesto()
|
||||
End If
|
||||
End If
|
||||
|
||||
UpAcciones.Update()
|
||||
UpDatosG.Update()
|
||||
UpGvClasificaciones.Update()
|
||||
UpIndicadores.Update()
|
||||
End Sub
|
||||
Private Function ActualizarPresupuesto() As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
Dim Nombre = TxtPresupuesto.Text.Trim
|
||||
Dim Observacion = TxtDescripcion.Text.Trim
|
||||
Dim CveProyecto = DdlProyecto.SelectedValue.ToEntero
|
||||
Dim FechaI = TxtFechaI.Text.ToDate
|
||||
Dim FechaF = TxtFechaF.Text.ToDate
|
||||
Dim FechaIng = Now
|
||||
Dim CveSubProyecto = DdlSubProyecto.SelectedValue.ToEntero
|
||||
Dim Archivo = ""
|
||||
Dim Estatus = 1
|
||||
Dim TieneError = False
|
||||
|
||||
Dim ObjCont As New ClsContratos
|
||||
ObjCont.IniciaTransacSQL()
|
||||
TieneError = Not ObjCont.UpdatePresupuesto(CvePresupuesto, Nombre, Observacion, CveSubProyecto, FechaI, FechaF, Estatus, Archivo, Now, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
If Not TieneError Then
|
||||
|
||||
For Each GvRow As GridViewRow In GvPresupuestos.Rows
|
||||
If GvRow.RowType = DataControlRowType.DataRow Then
|
||||
Dim CveClasificacion = GvRow.DataKey("CveClasificacion").ToEntero
|
||||
Dim CveTipoGasto = GvRow.DataKey("CveTipoGasto").ToEntero
|
||||
Dim CvePresupuestoDetalle = GvRow.DataKey("CvePresupuestoDetalle").ToEntero
|
||||
Dim Importe = GvRow.FCTextBox("TxtImporteClasi").Text.ToDecimal
|
||||
Dim Obs = GvRow.FCTextBox("TxtObservacion").Text.Trim
|
||||
'ACTUALIZA EL REGISTRO EXISTENTE
|
||||
If CvePresupuestoDetalle > 0 Then
|
||||
|
||||
TieneError = Not ObjCont.UpdatePresupuestosDetalle(CvePresupuestoDetalle, CveClasificacion, Importe, Obs)
|
||||
If TieneError Then
|
||||
Exit For
|
||||
End If
|
||||
|
||||
'AGREGA LA CLASIFICACION SI NO EXISTE EN EN EL DT DETALLE
|
||||
Else
|
||||
If Importe > 0 And CveClasificacion > 0 Then
|
||||
TieneError = Not ObjCont.AddPresupuestosDetalle(CvePresupuesto, CveClasificacion, CveTipoGasto, Importe, Obs)
|
||||
If TieneError Then
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
Next
|
||||
|
||||
If TieneError Then
|
||||
ObjCont.RollBack()
|
||||
Retorno = False
|
||||
Else
|
||||
ObjCont.Commit()
|
||||
Retorno = True
|
||||
End If
|
||||
End If
|
||||
ObjCont.Dispose()
|
||||
Return Retorno
|
||||
End Function
|
||||
Private Sub AgregarPresupuesto()
|
||||
Dim Nombre = TxtPresupuesto.Text.Trim
|
||||
Dim Observacion = TxtDescripcion.Text.Trim
|
||||
Dim CveProyecto = DdlProyecto.SelectedValue.ToEntero
|
||||
Dim FechaI = TxtFechaI.Text.ToDate
|
||||
Dim FechaF = TxtFechaF.Text.ToDate
|
||||
Dim FechaIng = Now
|
||||
Dim CveSubProyecto = DdlSubProyecto.SelectedValue.ToEntero
|
||||
Dim Archivo = ""
|
||||
Dim TieneError = False
|
||||
Dim Estatus = 1
|
||||
|
||||
Dim ObjCont As New ClsContratos
|
||||
ObjCont.IniciaTransacSQL()
|
||||
|
||||
If ObjCont.GetContratosEstatus(UsuarioActual.CveEmpresa) Then
|
||||
|
||||
Dim CvePresupuestoNuevo = ObjCont.AddPresupuesto(Nombre, Observacion, CveSubProyecto, FechaI, FechaF, Estatus, Archivo, Now, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
|
||||
If CvePresupuestoNuevo > 0 Then
|
||||
Dim ImporteClasi = 0.0D
|
||||
Dim CveClasificacion = -1
|
||||
Dim ObsDetalle = ""
|
||||
|
||||
For Each GvRow As GridViewRow In GvPresupuestos.Rows
|
||||
If GvRow.RowType = DataControlRowType.DataRow Then
|
||||
ImporteClasi = GvRow.FCTextBox("TxtImporteClasi").Text.ToDecimal
|
||||
CveClasificacion = GvRow.DataKey("CveClasificacion").ToEntero
|
||||
Dim CveTipoGasto = GvRow.DataKey("CveTipoGasto").ToEntero
|
||||
ObsDetalle = GvRow.FCTextBox("TxtObservacion").Text.Trim
|
||||
If CveClasificacion > 0 Then
|
||||
If ImporteClasi > 0 Then
|
||||
TieneError = Not ObjCont.AddPresupuestosDetalle(CvePresupuestoNuevo, CveClasificacion, CveTipoGasto, ImporteClasi, ObsDetalle)
|
||||
If TieneError Then
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
If Not TieneError Then
|
||||
Me.CvePresupuesto = CvePresupuestoNuevo
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If TieneError Then
|
||||
ObjCont.RollBack()
|
||||
ObjCont.Dispose()
|
||||
Alert("Ocurrió un error al agregar el presupuesto.", TipoMensaje.MsgError)
|
||||
Else
|
||||
ObjCont.Commit()
|
||||
ObjCont.Dispose()
|
||||
Dim Liga = $"document.location.href=""/Contratos/CatPresupuestos.aspx"""
|
||||
|
||||
Alert("Se agregó el presupuesto correctamente.", TipoMensaje.MsgInformacion, Liga)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
Protected Sub LnkAutorizar_Click(sender As Object, e As EventArgs) Handles LnkAutorizar.Click
|
||||
If ValidaDatos() Then
|
||||
If ActualizarPresupuesto() Then
|
||||
If EstatusActual <> EstatusFinal Then
|
||||
Dim ObjPres As New ClsContratos
|
||||
ObjPres.IniciaTransacSQL()
|
||||
Dim TieneError As Boolean = False
|
||||
|
||||
TieneError = Not ObjPres.UpdateEstatusPresupuesto(CvePresupuesto, EstatusFinal)
|
||||
'If ObjPres.UpdateEstatusPresupuesto(CvePresupuesto, EstatusFinal) Then
|
||||
' If ObjPres.GetPresupuestosDetalle(CvePresupuesto, -1, UsuarioActual.CveEmpresa) Then
|
||||
' DtClasificaciones = ObjPres.DtResultados
|
||||
' End If
|
||||
|
||||
' If DtClasificaciones IsNot Nothing Then
|
||||
' Dim DtDetalle = DtClasificaciones.FiltraParametros("CvePresupuestoDetalle > 0", DistinctColumns:={"CvePresupuestoDetalle", "ImporteVigente"})
|
||||
' If DtDetalle.Rows.Count > 0 Then
|
||||
|
||||
' For Each Dr As DataRow In DtDetalle.Rows
|
||||
' Dim CvePresupuestoDetalle As Integer = Dr("CvePresupuestoDetalle").ToString.ToEntero
|
||||
' Dim Importe As Decimal = Dr("ImporteVigente").ToString.ToDecimal
|
||||
' Dim Fecha = Now
|
||||
' Dim Tipo = 1
|
||||
' Dim CveCompra As Integer = -1
|
||||
' Dim Justificacion = "-1"
|
||||
' TieneError = Not ObjPres.AddPresupuestoMovimiento(CvePresupuesto, CveCompra, Tipo, Importe, Fecha, Justificacion)
|
||||
' If TieneError Then
|
||||
' Exit For
|
||||
' End If
|
||||
' Next
|
||||
' End If
|
||||
' End If
|
||||
'Else
|
||||
' TieneError = True
|
||||
'End If
|
||||
|
||||
If TieneError Then
|
||||
ObjPres.RollBack()
|
||||
Alert("Ocurrió un error al autorizar el presupuesto.", TipoMensaje.MsgError)
|
||||
Else
|
||||
ObjPres.Commit()
|
||||
Alert("Se autorizó el presupuesto correctamente.")
|
||||
CargaDatos()
|
||||
DeshabilitaControles(EstatusFinal)
|
||||
End If
|
||||
ObjPres.Dispose()
|
||||
Else
|
||||
Alert("El presupuesto ya esta autorizado", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert("Ocurrió un error al autorizar el presupuesto. No se pudieron guardar los datos", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert("Faltan campos por corregir", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
UpAcciones.Update()
|
||||
UpDatosG.Update()
|
||||
UpGvClasificaciones.Update()
|
||||
UpIndicadores.Update()
|
||||
End Sub
|
||||
End Class
|
||||
17
Contratos/Proyecto.aspx
Normal file
17
Contratos/Proyecto.aspx
Normal file
@@ -0,0 +1,17 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Proyecto.aspx.vb" Inherits="Contratos_Proyecto" %>
|
||||
<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="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Calendarización del proyecto
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<img src ="/Imagenes/SCT/gantt.png" width="995px"/>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
5
Contratos/Proyecto.aspx.vb
Normal file
5
Contratos/Proyecto.aspx.vb
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
Partial Class Contratos_Proyecto
|
||||
Inherits System.Web.UI.Page
|
||||
|
||||
End Class
|
||||
123
Contratos/RepContratos.aspx
Normal file
123
Contratos/RepContratos.aspx
Normal file
@@ -0,0 +1,123 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepContratos.aspx.vb" Inherits="RepContratos" %>
|
||||
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<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="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte de Contratos
|
||||
</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>
|
||||
<asp:Panel ID="PnlFiltros" runat="server" DefaultButton="CmdConsultar" Visible="False">
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="">
|
||||
<div class="portlet-title portlet-filterT" style="">
|
||||
<div class="titlefiltros caption ">
|
||||
<ul class="list-inline">
|
||||
<li>Contratista:
|
||||
<asp:DropDownList ID="DdlProveedor" runat="server" AutoPostBack="true" DataTextField="RazonSocial" DataValueField="CveProveedor" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 90px !important;"></asp:DropDownList>
|
||||
</li>
|
||||
<li>Contratos:
|
||||
<asp:DropDownList ID="DdlContrato" runat="server" AutoPostBack="true" DataTextField="NumeroContrato" DataValueField="CveContrato" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 90px !important;"></asp:DropDownList>
|
||||
</li>
|
||||
<li>Sección:
|
||||
<asp:DropDownList ID="DdlSeccion" runat="server" AutoPostBack="false" DataTextField="Seccion" DataValueField="CveSeccion" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;"></asp:DropDownList>
|
||||
</li>
|
||||
<li>Clasificación:
|
||||
<asp:DropDownList ID="DdlClasificacion" runat="server" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 90px !important;"></asp:DropDownList>
|
||||
</li>
|
||||
<li>Productos y Servicios:
|
||||
<asp:DropDownList ID="DdlPS" runat="server" AutoPostBack="true" DataTextField="PS" DataValueField="CvePS" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;"></asp:DropDownList>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<asp:Button ID="CmdConsultar" runat="server" Text="Consultar" class="btn btn-primary" CausesValidation="true" ValidationGroup="GrConsulta" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table class="table table-striped table-advance table-hover">
|
||||
<thead>
|
||||
<tr class="Titulos">
|
||||
<th width="60px">#</th>
|
||||
<th width="300px">
|
||||
<asp:LinkButton ID="LbSubSeccion" runat="server" CausesValidation="false" Text="Contratista" /></th>
|
||||
<th width="120px">
|
||||
<asp:LinkButton ID="LbCantidad" runat="server" CausesValidation="false" Text="Presupuesto Original" /></th>
|
||||
<th width="120px">
|
||||
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="false" Text="Contratado" /></th>
|
||||
<th width="120px">
|
||||
<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="false" Text="Ejecutado" /></th>
|
||||
<th width="120px">
|
||||
<asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="false" Text="Obra Faltante" /></th>
|
||||
<th width="120px">
|
||||
<asp:LinkButton ID="LinkButton4" runat="server" CausesValidation="false" Text="Original vs Real" /></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<asp:GridView ID="GV" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron Estimaciones con los Filtros seleccionados" DataKeyNames="CveContrato" ShowHeader="false" SelectedRowStyle-BackColor="#CCFF66" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LitEst" runat="server" Text='<%# Eval("CveContrato")%>' />
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Center"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="LtlSeccion" runat="server" Text='<%# Eval("Agrupador") %>' NavigateUrl='<%# Eval("CveContrato","RepContratosDetalle.aspx?CveContrato={0}") %>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlPrespOriginal" runat="server" Text='<%# Eval("PresupuestoOriginal","{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Right"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlContratado" runat="server" Text='<%# Eval("Contratado", "{0:N2}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Right"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEjecutado" runat="server" Text='<%# Eval("Ejecutado", "{0:N2}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Right"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlOFA" runat="server" Text='<%# Eval("OFA", "{0:N2}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Right"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblOrigVsReal" runat="server" Text='<%# Eval("OriginalVsReal", "{0:N2}")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Right"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
</asp:GridView>
|
||||
<br />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
111
Contratos/RepContratos.aspx.vb
Normal file
111
Contratos/RepContratos.aspx.vb
Normal file
@@ -0,0 +1,111 @@
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class RepContratos
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
|
||||
CargaProveedores()
|
||||
CargaContratos()
|
||||
CargaClasificacion()
|
||||
CargaSeccion()
|
||||
'DdlContrato.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todos", "-1"))
|
||||
DdlPS.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todas", "-1"))
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim Con As New ClsContratos
|
||||
If Con.GetRepContratos(DdlProveedor.SelectedValue.ToEntero, DdlContrato.SelectedValue.ToEntero, DdlSeccion.SelectedValue.ToEntero, DdlPS.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa) Then
|
||||
GV.DataSource = Con.DtResultados
|
||||
GV.DataBind()
|
||||
'If Con.DtResultados.Rows.Count > 0 Then
|
||||
' BtnAgregar.Visible = True
|
||||
'End If
|
||||
UpDatos.Update()
|
||||
End If
|
||||
Con.Dispose()
|
||||
End Sub
|
||||
|
||||
#Region "C O M B O S"
|
||||
|
||||
Private Sub CargaProveedores()
|
||||
DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
|
||||
DdlProveedor.DataBind()
|
||||
DdlProveedor.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
|
||||
Private Sub CargaSeccion()
|
||||
DdlSeccion.DataSource = GlobalDTContratosSecciones.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DdlSeccion.DataBind()
|
||||
DdlSeccion.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todas", "-1"))
|
||||
'Dim ObjSecciones As New ClsContratos
|
||||
'If ObjSecciones.GetSecciones() Then
|
||||
' DdlSeccion.DataSource = ObjSecciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
' DdlSeccion.DataBind()
|
||||
|
||||
'End If
|
||||
|
||||
'ObjSecciones.Dispose()
|
||||
|
||||
End Sub
|
||||
Private Sub CargaContratos()
|
||||
DdlContrato.DataSource = GlobalDTContratos.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DdlContrato.DataBind()
|
||||
DdlContrato.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
Private Sub CargaClasificacion()
|
||||
DdlClasificacion.DataSource = GlobalDTClasificaciones.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DdlClasificacion.DataBind()
|
||||
DdlClasificacion.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todas", "-1"))
|
||||
End Sub
|
||||
Private Sub CargaPS()
|
||||
Dim ObjPS As New ClsProductosServicios
|
||||
If ObjPS.GetPS(-1, DdlClasificacion.SelectedValue.ToString.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
DdlPS.DataSource = ObjPS.DtResultados
|
||||
Else
|
||||
DdlPS.DataSource = Nothing
|
||||
End If
|
||||
DdlPS.DataBind()
|
||||
|
||||
ObjPS.Dispose()
|
||||
DdlPS.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todas", "-1"))
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
Protected Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GV.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(60)
|
||||
e.Row.Cells(1).Width = Unit.Pixel(300) 'SubSeccion
|
||||
e.Row.Cells(2).Width = Unit.Pixel(120) 'Cantidad
|
||||
e.Row.Cells(3).Width = Unit.Pixel(120) 'Cantidad
|
||||
e.Row.Cells(4).Width = Unit.Pixel(120) 'Cantidad
|
||||
e.Row.Cells(5).Width = Unit.Pixel(120) 'Cantidad
|
||||
e.Row.Cells(6).Width = Unit.Pixel(120) 'Cantidad
|
||||
|
||||
If e.Row.DBCampo("RazonSocial") = "" Then
|
||||
e.Row.CssClass = "Totales" : e.Row.Height = 25
|
||||
ElseIf e.Row.DBCampo("DescripcionContrato") = "" Then
|
||||
e.Row.CssClass = "SubTotales2" : e.Row.Height = 25
|
||||
ElseIf e.Row.DBCampo("Clasificacion") = "" Then
|
||||
e.Row.CssClass = "SubTotales" : e.Row.Height = 25
|
||||
'ElseIf e.Row.DBCampo("Clasificacion") = "" Then
|
||||
' e.Row.CssClass = "SubTotales3" : e.Row.Height = 25
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("OriginalvsReal").ToDouble < 0 Then e.Row.FCLabel("LblOrigVsReal").ForeColor = Drawing.Color.Red
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub CmdConsultar_Click(sender As Object, e As EventArgs) Handles CmdConsultar.Click
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
|
||||
End Class
|
||||
124
Contratos/RepContratosAvances.aspx
Normal file
124
Contratos/RepContratosAvances.aspx
Normal file
@@ -0,0 +1,124 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepContratosAvances.aspx.vb" Inherits="RepContratosAvances" %>
|
||||
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<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="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte de Contratos
|
||||
</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>
|
||||
<asp:Panel ID="PnlFiltros" runat="server" DefaultButton="CmdConsultar">
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="">
|
||||
<div class="portlet-title portlet-filterT" style="">
|
||||
<div class="titlefiltros caption ">
|
||||
<ul class="list-inline" id="TrProgramar" runat="server">
|
||||
<li>Cliente:
|
||||
<asp:DropDownList ID="DdlCliente" runat="server" AutoPostBack="true" DataTextField="NombreComercial" DataValueField="CveCliente" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 250px !important;"></asp:DropDownList>
|
||||
</li>
|
||||
<li>Contratos:
|
||||
<asp:DropDownList ID="DdlContrato" runat="server" AutoPostBack="true" DataTextField="NumeroContrato" DataValueField="CveContrato" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;"></asp:DropDownList>
|
||||
</li>
|
||||
<li style="display: none;">Sección:
|
||||
<asp:DropDownList ID="DdlSeccion" runat="server" AutoPostBack="false" DataTextField="Seccion" DataValueField="CveSeccion" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;"></asp:DropDownList>
|
||||
</li>
|
||||
<li>Partida:
|
||||
<asp:DropDownList ID="DdlClasificacion" runat="server" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 90px !important;"></asp:DropDownList>
|
||||
</li>
|
||||
<li>Productos y Servicios:
|
||||
<asp:DropDownList ID="DdlPS" runat="server" AutoPostBack="true" DataTextField="PS" DataValueField="CvePS" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 150px !important;"></asp:DropDownList>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<asp:Button ID="CmdConsultar" runat="server" Text="Consultar" class="btn btn-primary" CausesValidation="true" ValidationGroup="GrConsulta" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table class="table table-striped table-advance table-hover">
|
||||
<thead>
|
||||
<tr class="Titulos">
|
||||
<th width="60px">#</th>
|
||||
<th width="300px">
|
||||
<asp:LinkButton ID="LbSubSeccion" runat="server" CausesValidation="false" Text="Cliente/ Contrato / Partida" /></th>
|
||||
<th width="120px">
|
||||
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="false" Text="Contratado" /></th>
|
||||
<th width="120px">
|
||||
<asp:LinkButton ID="LinkButton4" runat="server" CausesValidation="false" Text="Actual" /></th>
|
||||
<th width="120px">
|
||||
<asp:LinkButton ID="LinkButton5" runat="server" CausesValidation="false" Text="Por Estimar" /></th>
|
||||
<th width="120px">
|
||||
<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="false" Text="Ejecutado" /></th>
|
||||
<th width="120px">
|
||||
<asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="false" Text="Obra Faltante" /></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<asp:GridView ID="GV" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron Estimaciones con los Filtros seleccionados" DataKeyNames="CveContrato" ShowHeader="false" SelectedRowStyle-BackColor="#CCFF66" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LitEst" runat="server" Text='<%# Eval("CveContrato")%>' />
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Center"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HplAgrupador" CssClass="Texto" runat="server" Text='<%# Eval("Agrupador") %>' NavigateUrl='<%# Eval("CveContrato", "ContratosDetalle.aspx?CveContrato={0}&Op=2")%>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HplContratado" CssClass="Texto" runat="server" Text='<%# Eval("Contratado", "{0:N2}")%>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Right"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HplActual" CssClass="Texto" runat="server" Text='<%# Eval("LoQueEstoyHaciendo", "{0:N2}")%>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Right"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HPlPorEstimar" CssClass="Texto" runat="server" Text='<%# Eval("PorEstimar", "{0:N2}")%>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Right"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HplEjecutado" CssClass="Texto" runat="server" Text='<%# Eval("Ejecutado", "{0:N2}")%>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Right"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HplOFA" CssClass="Texto" runat="server" Text='<%# Eval("OFA", "{0:N2}")%>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Right"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
</asp:GridView>
|
||||
<br />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
123
Contratos/RepContratosAvances.aspx.vb
Normal file
123
Contratos/RepContratosAvances.aspx.vb
Normal file
@@ -0,0 +1,123 @@
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
|
||||
Partial Class RepContratosAvances
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
|
||||
CargaClientes()
|
||||
CargaContratos()
|
||||
|
||||
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
|
||||
DdlClasificacion.DataBind()
|
||||
DdlClasificacion.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
cargaPS()
|
||||
|
||||
|
||||
'DdlContrato.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todos", "-1"))
|
||||
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim Con As New ClsContratos
|
||||
If Con.GetRepContratosAvances(DdlCliente.SelectedValue.ToEntero, DdlContrato.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
GV.DataSource = Con.DtResultados
|
||||
GV.DataBind()
|
||||
'If Con.DtResultados.Rows.Count > 0 Then
|
||||
' BtnAgregar.Visible = True
|
||||
'End If
|
||||
UpDatos.Update()
|
||||
End If
|
||||
Con.Dispose()
|
||||
End Sub
|
||||
|
||||
#Region "C O M B O S"
|
||||
|
||||
|
||||
Private Sub CargaContratos()
|
||||
DdlContrato.DataSource = GlobalDTContratos.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DdlContrato.DataBind()
|
||||
DdlContrato.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
|
||||
Private Sub CargaClientes()
|
||||
Dim dt As DataTable = Nothing
|
||||
Dim Cli As New ClsClientes
|
||||
If Cli.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
|
||||
dt = Cli.DtResultados
|
||||
End If
|
||||
Cli.Dispose()
|
||||
DdlCliente.DataSource = dt
|
||||
DdlCliente.DataBind()
|
||||
DdlCliente.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GV.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(60)
|
||||
e.Row.Cells(1).Width = Unit.Pixel(300) 'SubSeccion
|
||||
e.Row.Cells(2).Width = Unit.Pixel(120) 'Cantidad
|
||||
e.Row.Cells(3).Width = Unit.Pixel(120) 'Cantidad
|
||||
e.Row.Cells(4).Width = Unit.Pixel(120) 'Cantidad
|
||||
e.Row.Cells(5).Width = Unit.Pixel(120) 'Cantidad
|
||||
e.Row.Cells(6).Width = Unit.Pixel(120) 'Cantidad
|
||||
|
||||
End If
|
||||
|
||||
'If e.Row.DBCampo("RazonSocial") = "" Then
|
||||
' e.Row.CssClass = "Totales" : e.Row.Height = 25
|
||||
If e.Row.DBCampo("NumeroContrato") = "" Then
|
||||
e.Row.CssClass = "SubTotales2" : e.Row.Height = 25
|
||||
ElseIf e.Row.DBCampo("Partida") = "" Then
|
||||
e.Row.CssClass = "SubTotales" : e.Row.Height = 25
|
||||
'ElseIf e.Row.DBCampo("Clasificacion") = "" Then
|
||||
' e.Row.CssClass = "SubTotales3" : e.Row.Height = 25
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("CveContrato") <> "" Then
|
||||
e.Row.FCHyperLink("HplAgrupador").NavigateUrl = String.Format("/Contratos/ContratosSecciones.aspx?CveContrato={0}&CveClasificacion={1}&Tipo=Con&Op=2", e.Row.DBCampo("CveContrato"), e.Row.DBCampo("CveClasificacion"))
|
||||
e.Row.FCHyperLink("HplContratado").NavigateUrl = String.Format("/Contratos/ContratosSecciones.aspx?CveContrato={0}&CveClasificacion={1}&Tipo=Con&Op=2", e.Row.DBCampo("CveContrato"), e.Row.DBCampo("CveClasificacion"))
|
||||
e.Row.FCHyperLink("HplActual").NavigateUrl = String.Format("/Contratos/ContratosSecciones.aspx?CveContrato={0}&CveClasificacion={1}&Tipo=Act&Op=2", e.Row.DBCampo("CveContrato"), e.Row.DBCampo("CveClasificacion"))
|
||||
e.Row.FCHyperLink("HPlPorEstimar").NavigateUrl = String.Format("/Contratos/ContratosSecciones.aspx?CveContrato={0}&CveClasificacion={1}&Tipo=XEst&Op=2", e.Row.DBCampo("CveContrato"), e.Row.DBCampo("CveClasificacion"))
|
||||
e.Row.FCHyperLink("HplEjecutado").NavigateUrl = String.Format("/Contratos/ContratosSecciones.aspx?CveContrato={0}&CveClasificacion={1}&Tipo=Eje&Op=2", e.Row.DBCampo("CveContrato"), e.Row.DBCampo("CveClasificacion"))
|
||||
e.Row.FCHyperLink("HplOFA").NavigateUrl = String.Format("/Contratos/ContratosSecciones.aspx?CveContrato={0}&CveClasificacion={1}&Tipo=OFA&Op=2", e.Row.DBCampo("CveContrato"), e.Row.DBCampo("CveClasificacion"))
|
||||
End If
|
||||
|
||||
' If e.Row.DBCampo("OriginalvsReal").ToDouble < 0 Then e.Row.FCLabel("LblOrigVsReal").ForeColor = Drawing.Color.Red
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub CmdConsultar_Click(sender As Object, e As EventArgs) Handles CmdConsultar.Click
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlClasificacion.SelectedIndexChanged
|
||||
cargaPS()
|
||||
End Sub
|
||||
|
||||
Private Sub cargaPS()
|
||||
Dim dt As DataTable = Nothing
|
||||
Dim PS As New ClsProductosServicios
|
||||
If PS.GetPS(-1, DdlClasificacion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
dt = PS.DtResultados.FiltraParametros("", "PS")
|
||||
End If
|
||||
|
||||
PS.Dispose()
|
||||
|
||||
DdlPS.DataSource = dt
|
||||
DdlPS.DataBind()
|
||||
DdlPS.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
End Class
|
||||
255
Contratos/RepContratosAvancesCP.aspx
Normal file
255
Contratos/RepContratosAvancesCP.aspx
Normal file
@@ -0,0 +1,255 @@
|
||||
<%@ Page Title="SIG | Reporte Contratos Avances" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepContratosAvancesCP.aspx.vb" Inherits="Contratos_RepContratosAvancesCP" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
<link href="/Metronic/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css" rel="stylesheet" />
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
.Widthall {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.dataTables_scrollHeadInner {
|
||||
width: 100% !important;
|
||||
background-color: #dddddd;
|
||||
padding-left: 0px !important;
|
||||
}
|
||||
|
||||
.dataTables_scrollFoot {
|
||||
display: none;
|
||||
position: static;
|
||||
}
|
||||
|
||||
.table-scrollable {
|
||||
margin: 0px !important;
|
||||
}
|
||||
|
||||
.dataTables_scroll {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.table.dataTable {
|
||||
margin-top: 0px !important;
|
||||
}
|
||||
|
||||
.dataTables_scrollBody table th {
|
||||
padding: 0px !important;
|
||||
padding-right: 4px !important;
|
||||
padding-left: 4px !important;
|
||||
}
|
||||
|
||||
.sinlink td a {
|
||||
pointer-events: none;
|
||||
cursor: default;
|
||||
color: black;
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
.white a {
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
.Derecha {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.Izquierda {
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte Contratos Avances
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkPdf" runat="server"><i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExportar" runat="server"><i class="fa fa-ad-excel"></i> Generar Excel</asp:LinkButton>
|
||||
</li>
|
||||
</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">
|
||||
|
||||
|
||||
|
||||
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="">
|
||||
<div class="portlet-title portlet-filterT" style="">
|
||||
<div class="tools">
|
||||
</div>
|
||||
<div class="titlefiltros caption Widthall" style="font-size:14px !important;">
|
||||
<div class="row">
|
||||
<div class="col-md-1" style="max-width:50PX;">
|
||||
Tipo:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlTipo" CssClass="form-control select2me input-sm" runat="server" AppendDataBoundItems="true" DataTextField="ContratoTipo" DataValueField="CveContratoTipo" Width="90%"></asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1" style="max-width:70PX;">
|
||||
Cliente:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlClientes" runat="server" CssClass="form-control select2me input-sm" AppendDataBoundItems="true" DataTextField="Nombre" DataValueField="CveCliente" Width="90%"></asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1" style="max-width:80PX;">
|
||||
Agrupador:
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlAgrupador" CssClass="form-control select2me input-sm" runat="server" AppendDataBoundItems="true" Width="90%">
|
||||
<%--<asp:ListItem Text="Contrato" Value="1" />--%>
|
||||
<asp:ListItem Text="Tipo Contrato" Value="2" />
|
||||
<asp:ListItem Text="Cliente" Value="3" />
|
||||
<%--<asp:ListItem Text="Proveedor" Value="4" />--%>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1" style="max-width:70PX;">
|
||||
Estatus:
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlEstatus" runat="server" AppendDataBoundItems="True" DataTextField="ContratoEstatus" DataValueField="CveContratoEstatus" CssClass="form-control select2me input-sm" Width="90%"></asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1 col-md-offset-1">
|
||||
<asp:Button ID="BtnFiltrar" runat="server" CausesValidation="true" CssClass=" btn btn-primary " Text="Consultar" ValidationGroup="GrpFiltrar"></asp:Button></td>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
<br />
|
||||
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<div id="dvCa" style="width: 100%; top: 30px">
|
||||
<table id="dTable" class="table Widthall ">
|
||||
<tr>
|
||||
<td width="40%" rowspan="2" style="font-size: medium; text-align: center!important; background-color: #b9b9b9;">
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<strong><asp:Literal ID="LtEncabezado" Text="Tipo Contrato" runat="server" /></strong>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</td>
|
||||
<td width="13%" style="font-size: small; text-align: center!important; background-color: #b9b9b9;"><strong>Contratado $</strong></td>
|
||||
<td width="13%" colspan="2" style="font-size: small; text-align: center!important; background-color: #dddddd;"><strong>Avance</strong> </td>
|
||||
<td width="13%" colspan="2" style="font-size: small; text-align: center!important; background-color: #b9b9b9;"><strong>Faltante</strong> </td>
|
||||
<td width="13%" style="font-size: small; text-align: center!important; background-color: #dddddd;"><strong>Por Facturar</strong></td>
|
||||
<td width="8%" id="TH6" style="font-size: small; text-align: center!important; background-color: #dddddd;"><strong>Anticipo</strong> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="13%" style="font-size: small; text-align: center!important; background-color: #b9b9b9;"><strong>Importe $</strong></td>
|
||||
<td width="6.5%" style="font-size: small; text-align: center!important; background-color: #dddddd;"><strong>Importe $</strong> </td>
|
||||
<td width="6.5%" style="font-size: small; text-align: center!important; background-color: #dddddd;"><strong>%</strong> </td>
|
||||
<td width="6.5%" style="font-size: small; text-align: center!important; background-color: #b9b9b9;"><strong>Importe $</strong> </td>
|
||||
<td width="6.5%" style="font-size: small; text-align: center!important; background-color: #b9b9b9;"><strong>%</strong> </td>
|
||||
<td width="13%" style="font-size: small; text-align: center!important; background-color: #dddddd;"><strong>Avance por Facturar $</strong></td>
|
||||
<td width="8%" style="font-size: small; text-align: center!important; background-color: #b9b9b9;"><strong>Importe $</strong> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="GvScroll" style="width: 100%; max-height:630px; min-height:300px; overflow-y:auto;">
|
||||
<asp:GridView ID="GvDatos" ClientIDMode="Static" runat="server" AutoGenerateColumns="false" ShowHeader="false" EmptyDataText="No se encontraron datos con los filtros especificados" CssClass="table table-striped table-hover Widthall" BorderColor="#D3D3D3" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Agrupador" ItemStyle-Width="40%" ItemStyle-CssClass="Texto Izquierda" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HLAgrupador" Text='<%# Eval("Agrupador") %>' Target="_blank" runat="server" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Importe $" ItemStyle-Width="13%" ItemStyle-CssClass="Texto Derecha" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HLImporteContratado" Text='<%# Eval("Importe", "{0:###,###,##0.00}") %>' Target="_blank" runat="server" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Importe $" ItemStyle-Width="9%" ItemStyle-CssClass="Texto Derecha" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HLImporteAvance" Text='<%# Eval("Avance", "{0:###,###,##0.00}") %>' Target="_blank" runat="server" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="%" ItemStyle-Width="4%" ItemStyle-CssClass="Texto Derecha" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HLPorcentajeAvance" Text='<%# Eval("AvancePorcentaje", "{0:###,###,##0.00}") %>' Target="_blank" runat="server" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Importe $" ItemStyle-Width="9%" ItemStyle-CssClass="Texto Derecha" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HLImporteFaltante" Text='<%# Eval("Faltante", "{0:###,###,##0.00}") %>' Target="_blank" runat="server" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="%" ItemStyle-Width="4%" ItemStyle-CssClass="Texto Derecha" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HLPorcentajeFaltante" Text='<%# Eval("FaltantePorcentaje", "{0:###,###,##0.00}") %>' Target="_blank" runat="server" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Avance por Facturar $" ItemStyle-Width="13%" ItemStyle-CssClass="Texto Derecha" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HLAvancePorFacturar" Text='<%# Eval("AvanceXFacturar", "{0:###,###,##0.00}") %>' Target="_blank" runat="server" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="Importe $" DataField="Anticipos" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:###,###,##0.00##}" ItemStyle-Width="8%" />
|
||||
<%-- <asp:HyperLinkField HeaderText="Agrupador" DataTextField="Agrupador" Target="_blank" ItemStyle-Width="40%" ItemStyle-CssClass="Texto Izquierda" DataNavigateUrlFields="CveContrato" DataNavigateUrlFormatString="/Contratos/Contrato.aspx?CveContrato={0}&Tipo=2" />
|
||||
<asp:HyperLinkField HeaderText="Importe $" DataTextField="Importe" Target="_blank" ItemStyle-Width="15%" ItemStyle-CssClass="Texto Derecha" DataTextFormatString="{0:###,###,##0.00}" DataNavigateUrlFields="CveContrato" DataNavigateUrlFormatString="/Contratos/Contrato.aspx?CveContrato={0}&Tipo=2" />
|
||||
<asp:HyperLinkField HeaderText="Importe $" DataTextField="Avance" Target="_blank" ItemStyle-Width="10%" ItemStyle-CssClass="Texto Derecha" DataTextFormatString="{0:###,###,##0.00}" DataNavigateUrlFields="CveContrato" DataNavigateUrlFormatString="/Contratos/Contrato.aspx?CveContrato={0}&Tipo=2" />
|
||||
<asp:HyperLinkField HeaderText="%" DataTextField="AvancePorcentaje" Target="_blank" ItemStyle-Width="5%" ItemStyle-CssClass="Texto Derecha" DataTextFormatString="{0:###,###.##}" DataNavigateUrlFields="CveContrato" DataNavigateUrlFormatString="/Contratos/Contrato.aspx?CveContrato={0}&Tipo=2" />
|
||||
<asp:HyperLinkField HeaderText="Importe $" DataTextField="Faltante" Target="_blank" ItemStyle-Width="10%" ItemStyle-CssClass="Texto Derecha" DataTextFormatString="{0:###,###,##0.00}" DataNavigateUrlFields="CveContrato" DataNavigateUrlFormatString="/Contratos/Contrato.aspx?CveContrato={0}&Tipo=2" />
|
||||
<asp:HyperLinkField HeaderText="%" DataTextField="FaltantePorcentaje" Target="_blank" ItemStyle-Width="5%" ItemStyle-CssClass="Texto Derecha" DataTextFormatString="{0:###,###.##}" DataNavigateUrlFields="CveContrato" DataNavigateUrlFormatString="/Contratos/Contrato.aspx?CveContrato={0}&Tipo=2" />
|
||||
<asp:HyperLinkField- HeaderText="Avance por Facturar $" DataTextField="AvanceXFacturar" Target="_blank" ItemStyle-Width="15%" ItemStyle-CssClass="Texto Derecha" DataTextFormatString="{0:###,###,##0.00}" DataNavigateUrlFields="CveContrato" DataNavigateUrlFormatString="/Contratos/Contrato.aspx?CveContrato={0}&Tipo=2" />--%>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
|
||||
<script src="/Metronic/assets/global/scripts/datatable.js"></script>
|
||||
<script src="/Metronic/assets/global/plugins/datatables/all.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
function pageLoad() {
|
||||
var Tam = TamañoVentana();
|
||||
var Alto = Tam.height - 320;
|
||||
if (Alto < 100) {
|
||||
Alto = 100;
|
||||
}
|
||||
|
||||
$get('GvScroll').style.height = Alto + "px";
|
||||
}
|
||||
|
||||
function OrdenarGV() {
|
||||
var Tam = TamañoVentana();
|
||||
var Alto = Tam.height - 320;
|
||||
if (Alto < 100) {
|
||||
Alto = 100;
|
||||
}
|
||||
var currenttehead = $("<thead></thead>");
|
||||
$('#GvDatos').prepend(currenttehead);
|
||||
currenttehead.append($('#GvDatos tr:nth-child(1)'));
|
||||
$('#GvDatos').DataTable({
|
||||
retrieve: true,
|
||||
scrollY: Alto + 'px',
|
||||
scrollCollapse: true,
|
||||
paging: false,
|
||||
searching: false,
|
||||
info: false,
|
||||
ordering: false
|
||||
});
|
||||
//$('#GvDatos').parent().parent().children().first().css("position", "static");
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</asp:Content>
|
||||
|
||||
162
Contratos/RepContratosAvancesCP.aspx.vb
Normal file
162
Contratos/RepContratosAvancesCP.aspx.vb
Normal file
@@ -0,0 +1,162 @@
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
|
||||
Partial Class Contratos_RepContratosAvancesCP
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
#Region "PROPIEDADES"
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
InicializaValores()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region " Inicializa Valores "
|
||||
Private Sub InicializaValores()
|
||||
|
||||
'DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
|
||||
'DdlProveedor.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
'DdlProveedor.DataBind()
|
||||
|
||||
DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa)
|
||||
DdlClientes.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlClientes.DataBind()
|
||||
|
||||
DdlTipo.DataSource = GlobalDTContratosTipos().FiltraParametros($"CveEmpresa={UsuarioActual.CveEmpresa}")
|
||||
DdlTipo.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlTipo.DataBind()
|
||||
|
||||
|
||||
'DdlContrato.DataSource = GlobalDTContratos().FiltraParametros($"CveEmpresa={UsuarioActual.CveEmpresa}")
|
||||
'DdlContrato.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
'DdlContrato.DataBind()
|
||||
Dim CveEstatusVigente = -1
|
||||
Dim ObjContratos As New ClsContratos
|
||||
ObjContratos.GetContratosEstatus(UsuarioActual.CveEmpresa)
|
||||
DdlEstatus.DataSource = ObjContratos.DtResultados
|
||||
CveEstatusVigente = ObjContratos.DtResultados.FiltroPrimeroValor("CveContratoEstatus", "TipoEstatus = 1", Orderby:="CveContratoEstatus").ToEntero
|
||||
DdlEstatus.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlEstatus.DataBind()
|
||||
ObjContratos.Dispose()
|
||||
|
||||
DdlEstatus.SelectedValueExist(If(CveEstatusVigente > 0, CveEstatusVigente, -1))
|
||||
|
||||
CargaDatos()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " CARGA DATOS "
|
||||
Protected Sub BtnFiltrar_Click(sender As Object, e As EventArgs) Handles BtnFiltrar.Click
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjContratos As New ClsContratos
|
||||
|
||||
If ObjContratos.GetReporteContratosAvancesCP(UsuarioActual.CveEmpresa, DdlClientes.SelectedValue.ToEntero, -1, DdlTipo.SelectedValue.ToEntero, DdlAgrupador.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero) Then
|
||||
GvDatos.DataSource = ObjContratos.DtResultados
|
||||
Else
|
||||
Alert("Ocurrió un error al obtener el Reporte. Por favor vuelva a intentar", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
ObjContratos.Dispose()
|
||||
GvDatos.DataBind()
|
||||
|
||||
'If (GvDatos.Rows.Count > 0) Then
|
||||
' GvDatos.UseAccessibleHeader = True
|
||||
' GvDatos.HeaderRow.TableSection = TableRowSection.TableHeader
|
||||
' RegistraScript("OrdenarGV();")
|
||||
'End If
|
||||
|
||||
LtEncabezado.Text = DdlAgrupador.SelectedItem.Text
|
||||
|
||||
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
|
||||
|
||||
|
||||
If e.Row.DBCampo("CveContrato").ToString.ToEntero > 0 Then
|
||||
Dim Liga = String.Format("/Contratos/Contrato.aspx?CveContrato={0}&Tipo=2", e.Row.DBCampo("CveContrato"))
|
||||
|
||||
e.Row.FCHyperLink("HLAgrupador").NavigateUrl = Liga
|
||||
e.Row.FCHyperLink("HLImporteContratado").NavigateUrl = Liga
|
||||
e.Row.FCHyperLink("HLImporteAvance").NavigateUrl = Liga
|
||||
e.Row.FCHyperLink("HLPorcentajeAvance").NavigateUrl = Liga
|
||||
e.Row.FCHyperLink("HLImporteFaltante").NavigateUrl = Liga
|
||||
e.Row.FCHyperLink("HLPorcentajeFaltante").NavigateUrl = Liga
|
||||
e.Row.FCHyperLink("HLAvancePorFacturar").NavigateUrl = Liga
|
||||
Else
|
||||
e.Row.CssClass = "sinlink SubTotales2"
|
||||
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 "Imprimir"
|
||||
Protected Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
|
||||
GvDatos.ExportToExcel("ReporteCompras" & Now.ToShortDateString)
|
||||
End Sub
|
||||
|
||||
Private Sub GenerarPDF()
|
||||
Dim ObjContratos As New ClsContratos
|
||||
If ObjContratos.GetReporteContratosAvancesCP(UsuarioActual.CveEmpresa, DdlClientes.SelectedValue.ToEntero, -1, DdlTipo.SelectedValue.ToEntero, DdlAgrupador.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero) Then
|
||||
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 dt As DataTable = ObjContratos.DtResultados
|
||||
Dim Cliente = If(DdlClientes.SelectedValue = "-1", "", $" <b>Cliente:</b> {DdlClientes.SelectedItem.Text}")
|
||||
Dim Estatus = ($" <b>Estatus:</b> {DdlEstatus.SelectedItem.Text}")
|
||||
Dim Tipo = If(DdlTipo.SelectedValue = "-1", "", $" <b>Tipo:</b> {DdlTipo.SelectedItem.Text}")
|
||||
Dim Grupo = ($" <b>Grupo:</b> {DdlAgrupador.SelectedItem.Text}")
|
||||
|
||||
Dim params As New List(Of ReportParameter)
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("FechaInicio", "-1"))
|
||||
params.Add(New ReportParameter("FechaFin", "-1"))
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
params.Add(New ReportParameter("AgrupadoPor", $"<b>Agrupado Por:</b> {Cliente}{Estatus}{Tipo}{Grupo}"))
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepContratosAvanceCP.rdlc", dt, params, "ReporteContratosAvanceCP")
|
||||
Else
|
||||
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Protected Sub LnkPdf_Click(sender As Object, e As EventArgs) Handles LnkPdf.Click
|
||||
GenerarPDF()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
147
Contratos/RepContratosCostos.aspx
Normal file
147
Contratos/RepContratosCostos.aspx
Normal file
@@ -0,0 +1,147 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepContratosCostos.aspx.vb" Inherits="Contratos_RepContratosCostos" %>
|
||||
|
||||
<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="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte de Costos de Contratos
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel ID="UpLnkAcciones" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<li>
|
||||
<asp:LinkButton ID="ImgImprimir" runat="server" OnClick="ImgImprimir_Click"> <i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<asp:LinkButton ID="ImgExcel" runat="server" OnClick="ImgExcel_Click"> <i class="fa fa-ad-excel"></i> Generar Excel</asp:LinkButton>
|
||||
</li>
|
||||
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="ImgExcel" />
|
||||
<asp:PostBackTrigger ControlID="ImgImprimir" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
<%--FILTROS--%>
|
||||
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter" id="FiltrosCotratosSuministros">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" 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">
|
||||
Contrato:
|
||||
</div>
|
||||
<div class="col-md-3 ">
|
||||
<asp:DropDownList ID="DdlContratos" runat="server" AppendDataBoundItems="true" DataTextField="NumeroDescripcionContrato" DataValueField="CveContrato" CssClass="form-control input-small input-sm select2me" Width="100%">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 truncate">
|
||||
Fecha Inicio:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<div class="col-md-1 truncate">
|
||||
Fecha Fin:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none;">
|
||||
<div class="row">
|
||||
<div class="col-md-1 truncate">
|
||||
Estatus:
|
||||
</div>
|
||||
<div class="col-md-2 ">
|
||||
<asp:DropDownList ID="DdlEstatus" runat="server" AppendDataBoundItems="true" DataTextField="ContratoEstatus" DataValueField="CveContratoEstatus" CssClass="form-control input-small input-sm select2me" Width="100%">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1 truncate">
|
||||
Tipo:
|
||||
</div>
|
||||
<div class="col-md-2 ">
|
||||
<asp:DropDownList ID="DdlTipo" CssClass="select2me" Width="100%" runat="server">
|
||||
<asp:ListItem Text="Todos" Value="-1" Selected="True" />
|
||||
<asp:ListItem Text="Suministro" Value="1" />
|
||||
<asp:ListItem Text="Activo Fijo (Interno y Externo)" Value="2" />
|
||||
<asp:ListItem Text="Activo Fijo Interno" Value="3" />
|
||||
<asp:ListItem Text="Activo Fijo Externo" Value="4" />
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<%--DATOS--%>
|
||||
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right" align="left">
|
||||
<div style="margin-right: 15px">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Costos con los datos especificados." CssClass="table table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None" OnRowDataBound="GvDatos_RowDataBound">
|
||||
<Columns>
|
||||
<asp:HyperLinkField ItemStyle-HorizontalAlign="Left" HeaderText="Contrato" DataTextField="NumeroContrato" DataTextFormatString="{0}" DataNavigateUrlFields="CveContrato" DataNavigateUrlFormatString="/Contratos/Contrato.aspx?CveContrato={0}" />
|
||||
<asp:HyperLinkField ItemStyle-HorizontalAlign="Left" HeaderText="Serie Folio" DataTextField="SerieFolio" DataTextFormatString="{0}" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" />
|
||||
<asp:BoundField runat="server" HeaderText="Fecha" DataField="FechaMovto" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField runat="server" HeaderText="Tipo" DataField="Tipo" />
|
||||
<asp:BoundField runat="server" HeaderText="Contrato Externo" DataField="ContratoExterno" />
|
||||
<asp:BoundField runat="server" HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField runat="server" HeaderText="PS" DataField="CodigoPS" />
|
||||
<asp:BoundField runat="server" HeaderText="Serie" DataField="SerieLote" />
|
||||
<asp:BoundField runat="server" HeaderText="Costo Almacén" DataField="Surtido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
118
Contratos/RepContratosCostos.aspx.vb
Normal file
118
Contratos/RepContratosCostos.aspx.vb
Normal file
@@ -0,0 +1,118 @@
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class Contratos_RepContratosCostos
|
||||
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.GetContratosCostos(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
|
||||
|
||||
End If
|
||||
ObjContratos.Dispose()
|
||||
GvDatos.DataBind()
|
||||
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
|
||||
|
||||
End If
|
||||
ObjContratos.Dispose()
|
||||
DdlEstatus.DataBind()
|
||||
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 Contrato = DdlContratos.SelectedItem
|
||||
|
||||
Dim FechaI As String = txtFechaI.Text
|
||||
Dim FechaF As String = txtFechaF.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("Estatus", DdlEstatus.SelectedItem.Text))
|
||||
params.Add(New ReportParameter("Tipo", DdlTipo.SelectedItem.Text))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepContratosCostos.rdlc", DtDatos, params, "ReporteContratosCostos", 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
|
||||
#End Region
|
||||
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("NumeroContrato") = "Total" Then
|
||||
e.Row.CssClass = "Totales"
|
||||
e.Row.Cells(0).Controls.RemoveAt(0)
|
||||
e.Row.Cells(0).Text = "Total"
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
132
Contratos/RepContratosDetalle.aspx
Normal file
132
Contratos/RepContratosDetalle.aspx
Normal file
@@ -0,0 +1,132 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepContratosDetalle.aspx.vb" Inherits="RepContratos" %>
|
||||
|
||||
<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="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte de Contratos
|
||||
</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>
|
||||
<asp:Panel ID="PnlFiltros" runat="server" DefaultButton="CmdConsultar" Visible="False">
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="">
|
||||
<div class="portlet-title portlet-filterT" style="">
|
||||
<div class="titlefiltros caption ">
|
||||
<ul class="list-inline" id="TrProgramar" runat="server">
|
||||
<li>Contratista:
|
||||
<asp:DropDownList ID="DdlProveedor" runat="server" AutoPostBack="true" DataTextField="RazonSocial" DataValueField="CveProveedor" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 90px !important;"></asp:DropDownList>
|
||||
</li>
|
||||
<li>Contratos:
|
||||
<asp:DropDownList ID="DdlContrato" runat="server" AutoPostBack="true" DataTextField="NumeroContrato" DataValueField="CveContrato" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 90px !important;"></asp:DropDownList>
|
||||
</li>
|
||||
<li>Sección:
|
||||
<asp:DropDownList ID="DdlSeccion" runat="server" AutoPostBack="false" DataTextField="Seccion" DataValueField="CveSeccion" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;"></asp:DropDownList>
|
||||
</li>
|
||||
<li>Clasificación:
|
||||
<asp:DropDownList ID="DdlClasificacion" runat="server" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 90px !important;"></asp:DropDownList>
|
||||
</li>
|
||||
<li>Productos y Servicios:
|
||||
<asp:DropDownList ID="DdlPS" runat="server" AutoPostBack="true" DataTextField="PS" DataValueField="CvePS" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;"></asp:DropDownList>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<asp:Button ID="CmdConsultar" runat="server" Text="Consultar" class="btn btn-primary" CausesValidation="true" ValidationGroup="GrConsulta" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table class="table table-striped table-advance table-hover">
|
||||
<thead>
|
||||
<tr class="Titulos">
|
||||
<th width="200px">
|
||||
<asp:LinkButton ID="LbSubSeccion" runat="server" CausesValidation="false" Text="Cliente" /></th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LinkButton5" runat="server" CausesValidation="false" Text="Sección" /></th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LinkButton6" runat="server" CausesValidation="false" Text="Subsección" /></th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LbCantidad" runat="server" CausesValidation="false" Text="Presupuesto Original" /></th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="false" Text="Contratado" /></th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="false" Text="Ejecutado" /></th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="false" Text="Obra Faltante" /></th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LinkButton4" runat="server" CausesValidation="false" Text="Original vs Real" /></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<asp:GridView ID="GV" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron Estimaciones con los Filtros seleccionados" ShowHeader="false" SelectedRowStyle-BackColor="#CCFF66" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="LtlClasificacion" runat="server" Text='<%# Eval("Clasificacion") %>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlSeccion" runat="server" Text='<%# Eval("Seccion")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Left"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlSubSeccion" runat="server" Text='<%# Eval("SubSeccion")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Center"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlPrespOriginal" runat="server" Text='<%# Eval("PresupuestoOriginal","{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Right"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlContratado" runat="server" Text='<%# Eval("Contratado", "{0:N2}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Right"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEjecutado" runat="server" Text='<%# Eval("Ejecutado", "{0:N2}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Right"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlOFA" runat="server" Text='<%# Eval("OFA", "{0:N2}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Right"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblOrigVsReal" runat="server" Text='<%# Eval("OriginalVsReal", "{0:N2}")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Right"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
</asp:GridView>
|
||||
<br />
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
114
Contratos/RepContratosDetalle.aspx.vb
Normal file
114
Contratos/RepContratosDetalle.aspx.vb
Normal file
@@ -0,0 +1,114 @@
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class RepContratos
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
|
||||
CargaProveedores()
|
||||
CargaContratos()
|
||||
CargaClasificacion()
|
||||
CargaSeccion()
|
||||
'DdlContrato.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todos", "-1"))
|
||||
|
||||
CargaDatos(Request("CveContrato").ToEntero, "Con")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaDatos(CveContrato As Integer, Tipo As String)
|
||||
Dim Con As New ClsContratos
|
||||
If Con.GetRepContratosAvancesDetalle(-1, CveContrato, -1, TiPO, UsuarioActual.CveEmpresa) Then
|
||||
GV.DataSource = Con.DtResultados
|
||||
GV.DataBind()
|
||||
'If Con.DtResultados.Rows.Count > 0 Then
|
||||
' BtnAgregar.Visible = True
|
||||
'End If
|
||||
UpDatos.Update()
|
||||
End If
|
||||
Con.Dispose()
|
||||
End Sub
|
||||
|
||||
#Region "C O M B O S"
|
||||
|
||||
Private Sub CargaProveedores()
|
||||
DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
|
||||
DdlProveedor.DataBind()
|
||||
DdlProveedor.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
|
||||
Private Sub CargaSeccion()
|
||||
DdlSeccion.DataSource = GlobalDTContratosSecciones.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DdlSeccion.DataBind()
|
||||
DdlSeccion.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todas", "-1"))
|
||||
'Dim ObjSecciones As New ClsContratos
|
||||
'If ObjSecciones.GetSecciones() Then
|
||||
' DdlSeccion.DataSource = ObjSecciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
' DdlSeccion.DataBind()
|
||||
|
||||
'End If
|
||||
|
||||
'ObjSecciones.Dispose()
|
||||
|
||||
End Sub
|
||||
Private Sub CargaContratos()
|
||||
DdlContrato.DataSource = GlobalDTContratos.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DdlContrato.DataBind()
|
||||
DdlContrato.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
Private Sub CargaClasificacion()
|
||||
DdlClasificacion.DataSource = GlobalDTClasificaciones.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DdlClasificacion.DataBind()
|
||||
DdlClasificacion.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todas", "-1"))
|
||||
End Sub
|
||||
Private Sub CargaPS()
|
||||
Dim ObjPS As New ClsProductosServicios
|
||||
If ObjPS.GetPS(-1, DdlClasificacion.SelectedValue.ToString.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
DdlPS.DataSource = ObjPS.DtResultados
|
||||
Else
|
||||
DdlPS.DataSource = Nothing
|
||||
End If
|
||||
DdlPS.DataBind()
|
||||
|
||||
ObjPS.Dispose()
|
||||
DdlPS.Items.Insert(0, New System.Web.UI.WebControls.ListItem("Todas", "-1"))
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
Protected Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GV.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
|
||||
e.Row.Cells(0).Width = Unit.Pixel(200) 'SubSeccion
|
||||
e.Row.Cells(1).Width = Unit.Pixel(100) 'Cantidad
|
||||
e.Row.Cells(2).Width = Unit.Pixel(100) 'Cantidad
|
||||
e.Row.Cells(3).Width = Unit.Pixel(100) 'Cantidad
|
||||
e.Row.Cells(4).Width = Unit.Pixel(100) 'Cantidad
|
||||
e.Row.Cells(5).Width = Unit.Pixel(100) 'Cantidad
|
||||
e.Row.Cells(6).Width = Unit.Pixel(100) 'Cantidad
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("RazonSocial") = "" Then
|
||||
e.Row.CssClass = "Totales" : e.Row.Height = 25
|
||||
ElseIf e.Row.DBCampo("DescripcionContrato") = "" Then
|
||||
e.Row.CssClass = "SubTotales2" : e.Row.Height = 25
|
||||
ElseIf e.Row.DBCampo("Clasificacion") = "" Then
|
||||
e.Row.CssClass = "SubTotales" : e.Row.Height = 25
|
||||
'ElseIf e.Row.DBCampo("Clasificacion") = "" Then
|
||||
' e.Row.CssClass = "SubTotales3" : e.Row.Height = 25
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("OriginalvsReal").ToDouble < 0 Then e.Row.FCLabel("LblOrigVsReal").ForeColor = Drawing.Color.Red
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub CmdConsultar_Click(sender As Object, e As EventArgs) Handles CmdConsultar.Click
|
||||
'CargaDatos()
|
||||
End Sub
|
||||
|
||||
|
||||
End Class
|
||||
157
Contratos/RepContratosFianzas.aspx
Normal file
157
Contratos/RepContratosFianzas.aspx
Normal file
@@ -0,0 +1,157 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepContratosFianzas.aspx.cs" Inherits="Contratos_RepContratosFianzas" %>
|
||||
|
||||
<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">
|
||||
Reporte de Contratos Fianzas
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel ID="UpExportar" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<li>
|
||||
<asp:LinkButton ID="ImgImprimir" runat="server" OnClick="ImgImprimir_Click"> <i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<asp:LinkButton ID="ImgExcel" runat="server" OnClick="ImgExcel_Click"> <i class="fa fa-ad-excel"></i> Generar Excel</asp:LinkButton>
|
||||
</li>
|
||||
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="ImgExcel" />
|
||||
<asp:PostBackTrigger ControlID="ImgImprimir" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</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 id="PFiltro" class="portlet solid grey-cascade portlet-filter">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" Text="Consultar" class="btn btn-primary" ValidationGroup="Valida" />
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
<div class="row" style="margin-left: 10px;">
|
||||
|
||||
<label class="col-md-1 text-right" id="LblDdlContratos" runat="server">Contrato:</label>
|
||||
<div class="col-md-2" id="DivDdlContrato" runat="server">
|
||||
<asp:DropDownList ID="DdlContratos" runat="server" AppendDataBoundItems="true" DataTextField="NumeroDescripcionContrato" DataValueField="CveContrato" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1 text-right" id="LblEstatus" runat="server">Estatus:</label>
|
||||
<div class="col-md-1" id="DivDdlEstatus" runat="server">
|
||||
<asp:DropDownList ID="DdlEstatus" runat="server" CssClass="table-group-action-input form-control input-inline input-sm select2me " Width="100px">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Activa" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Liberada" Value="2"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1 text-right">Fecha V.I.:</label>
|
||||
<div class="col-md-1">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
|
||||
<asp:TextBox ID="txtFechaVencI" runat="server" CssClass="form-control" CausesValidation="true" Width="80%" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioVI" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaVI" runat="server" TargetControlID="txtFechaVencI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario1" TargetControlID="txtFechaVencI" PopupButtonID="ImgCalendarioVI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="cvFechaVI" runat="server" ControlToValidate="txtFechaVencI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFVI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaVI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaVI" runat="server" ControlToValidate="txtFechaVencI" Display="None" ErrorMessage="El campo <b>''Fecha Vencimiento Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoFfvFVI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaVI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<label class="col-md-1 text-right" style="margin-left: 15px">Fecha V.F.:</label>
|
||||
<div class="col-md-1">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
|
||||
<asp:TextBox ID="txtFechaVencF" runat="server" CssClass="form-control" CausesValidation="true" Width="80%" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioVF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaVF" runat="server" TargetControlID="txtFechaVencF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario4" TargetControlID="txtFechaVencF" PopupButtonID="imgCalendarioVF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="cvFechaVF" runat="server" ControlToValidate="txtFechaVencF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFVF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaVF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaVF" runat="server" ControlToValidate="txtFechaVencF" Display="None" ErrorMessage="El campo <b>''Fecha Vencimiento Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoFfvFVF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaVF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
|
||||
<asp:CompareValidator ID="CVFechasVenc" runat="server" ForeColor="#a94442" ControlToCompare="txtFechaVencI" ControlToValidate="txtFechaVencF" Type="Date" Operator="GreaterThan" Display="None" ErrorMessage="<b><span style='text-decoration: underline;'>ERROR:</span></b><br /><b>''Fecha V.F.''</b> debe ser mayor a Fecha V.I." ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCE1" runat="server" HighlightCssClass="vco" TargetControlID="CVFechasVenc" Width="270px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none;">
|
||||
<div class="row" style="margin-left: 10px;">
|
||||
<label class="col-md-1 text-right" id="LblCLiente" runat="server">Cliente:</label>
|
||||
<div class="col-md-2" id="DivCliente" runat="server">
|
||||
<asp:DropDownList ID="DdlClientes" runat="server" AppendDataBoundItems="true" DataTextField="NombreComercial" DataValueField="CveCliente" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%"> </asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%-- GRIEDVIEW --%>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="portlet light ">
|
||||
|
||||
<div class="portlet-title">
|
||||
<div class="caption" style="font-size: 25px">
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right" align="left">
|
||||
<div style="margin-right: 15px">
|
||||
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvFianzas.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvFianzas.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body">
|
||||
<asp:GridView ID="GvFianzas" runat="server" GridLines="None" DataKeyNames="CveContrato, NumeroContrato, CveContratosEstatus, ContratoEstatus, CveCliente, NombreComercial, CveContratoFianza, Folio, CveEstatusFianza, EstatusFianza, FechaVencimiento" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
|
||||
<Columns>
|
||||
<asp:HyperLinkField DataTextField="NumeroContrato" HeaderText="Contrato" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Left" DataTextFormatString="{0}" DataNavigateUrlFields="CveContrato" DataNavigateUrlFormatString="/Contratos/Contrato.aspx?CveContrato={0}" />
|
||||
<asp:BoundField DataField="NombreComercial" HeaderText="Cliente" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Left" />
|
||||
|
||||
<asp:BoundField DataField="ContratoEstatus" HeaderText="Estatus Contrato" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Left" />
|
||||
|
||||
<asp:BoundField DataField="Folio" HeaderText="Folio Fianza" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="EstatusFianza" HeaderText="Estatus Fianza" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Left" />
|
||||
|
||||
<asp:BoundField DataField="FechaVencimiento" HeaderText="Fecha Vencimiento" DataFormatString="{0:d}" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center" />
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%-- END GRIEDVIEW --%>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
147
Contratos/RepContratosFianzas.aspx.cs
Normal file
147
Contratos/RepContratosFianzas.aspx.cs
Normal file
@@ -0,0 +1,147 @@
|
||||
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 Contratos_RepContratosFianzas : ClsPaginas
|
||||
{
|
||||
#region "Propiedades"
|
||||
private DataTable DTDatos
|
||||
{
|
||||
get
|
||||
{
|
||||
return (DataTable)ViewState["DTDatos"];
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
ViewState["DTDatos"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
InicializaFiltros();
|
||||
CargaDatos();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#region "BOTONES"
|
||||
|
||||
protected void BtnConsultar_Click(object sender, EventArgs e)
|
||||
{
|
||||
CargaDatos();
|
||||
}
|
||||
|
||||
|
||||
protected void ImgImprimir_Click(object sender, EventArgs e)
|
||||
{
|
||||
GenerarPDF();
|
||||
}
|
||||
|
||||
protected void ImgExcel_Click(object sender, EventArgs e)
|
||||
{
|
||||
GenerarPDF("Excel");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region "CARGA DATOS"
|
||||
|
||||
protected void InicializaFiltros()
|
||||
{
|
||||
DdlContratos.SelectedValue = "-1";
|
||||
txtFechaVencI.Text = DateTime.Today.ToShortDateString();
|
||||
txtFechaVencF.Text = DateTime.Today.AddYears(1).ToShortDateString();
|
||||
CargaContratos();
|
||||
CargaClientes();
|
||||
|
||||
}
|
||||
|
||||
protected void CargaContratos()
|
||||
{
|
||||
DdlContratos.DataSource = GlobalDTContratos.FiltraParametros("CveEmpresa = " + UsuarioActual.CveEmpresa);
|
||||
DdlContratos.DataBind();
|
||||
}
|
||||
protected void CargaClientes()
|
||||
{
|
||||
DdlClientes.DataSource = get_GlobalDTCliente(UsuarioActual.CveEmpresa);
|
||||
DdlClientes.DataBind();
|
||||
DdlClientes.Items.Insert(0, new ListItem("Todos", "-1"));
|
||||
DdlClientes.SelectedValue = "-1";
|
||||
}
|
||||
|
||||
protected void CargaDatos()
|
||||
{
|
||||
int CveContrato = DdlContratos.SelectedValue.ToEntero();
|
||||
int Estatus = DdlEstatus.SelectedValue.ToEntero();
|
||||
int CveCliente = DdlClientes.SelectedValue.ToEntero();
|
||||
|
||||
String FechaVI = txtFechaVencI.Text;
|
||||
String FechaVF = txtFechaVencF.Text;
|
||||
|
||||
ClsContratos ObjContrato = new ClsContratos();
|
||||
|
||||
if (ObjContrato.GetContratoFianza(CveContrato, Estatus, FechaVI, FechaVF, UsuarioActual.CveEmpresa, CveCliente))
|
||||
{
|
||||
DTDatos = ObjContrato.DtResultados;
|
||||
GvFianzas.DataSource = DTDatos;
|
||||
}
|
||||
ObjContrato.Dispose();
|
||||
GvFianzas.DataBind();
|
||||
UPFiltros.Update();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region "REPORTE"
|
||||
|
||||
private void GenerarPDF(string Formato = "PDF")
|
||||
{
|
||||
var Contrato = DdlContratos.SelectedItem;
|
||||
var Estatus = DdlEstatus.SelectedItem;
|
||||
|
||||
string FechaI = txtFechaVencI.Text;
|
||||
string FechaF = txtFechaVencF.Text;
|
||||
|
||||
if (txtFechaVencI.Text == "")
|
||||
FechaI = "-1";
|
||||
if (txtFechaVencF.Text == "")
|
||||
FechaF = "-1";
|
||||
|
||||
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);
|
||||
|
||||
List<ReportParameter> @params = new List<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", DateTime.Now.ToShortDateString()));
|
||||
@params.Add(new ReportParameter("Contrato", Contrato.Text));
|
||||
@params.Add(new ReportParameter("Estatus", Estatus.Text));
|
||||
|
||||
if (Imagen.Exists)
|
||||
{
|
||||
@params.Add(new ReportParameter("LogoPath", logouri));
|
||||
}
|
||||
else
|
||||
{
|
||||
@params.Add(new ReportParameter("LogoPath", ""));
|
||||
}
|
||||
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepContratosFianzas.rdlc", DTDatos, @params, "ReporteContratosFianzas", Formato);
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
148
Contratos/RepContratosSuministros.aspx
Normal file
148
Contratos/RepContratosSuministros.aspx
Normal file
@@ -0,0 +1,148 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepContratosSuministros.aspx.vb" Inherits="Contratos_RepContratosSuministros" %>
|
||||
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<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="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte de Contratos Suministros
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel ID="UpLnkAcciones" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<li>
|
||||
<asp:LinkButton ID="ImgImprimir" runat="server" OnClick="ImgImprimir_Click"> <i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<asp:LinkButton ID="ImgExcel" runat="server" OnClick="ImgExcel_Click"> <i class="fa fa-ad-excel"></i> Generar Excel</asp:LinkButton>
|
||||
</li>
|
||||
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="ImgExcel" />
|
||||
<asp:PostBackTrigger ControlID="ImgImprimir" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
<%--FILTROS--%>
|
||||
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter" id="FiltrosCotratosSuministros">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" 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">
|
||||
Contrato:
|
||||
</div>
|
||||
<div class="col-md-3 ">
|
||||
<asp:DropDownList ID="DdlContratos" runat="server" AppendDataBoundItems="true" DataTextField="NumeroDescripcionContrato" DataValueField="CveContrato" CssClass="form-control input-small input-sm select2me" Width="100%">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 truncate">
|
||||
Fecha Inicio:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<div class="col-md-1 truncate">
|
||||
Fecha Fin:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none;">
|
||||
<div class="row">
|
||||
<div class="col-md-1 truncate">
|
||||
Estatus:
|
||||
</div>
|
||||
<div class="col-md-2 ">
|
||||
<asp:DropDownList ID="DdlEstatus" runat="server" AppendDataBoundItems="true" DataTextField="ContratoEstatus" DataValueField="CveContratoEstatus" CssClass="form-control input-small input-sm select2me" Width="100%">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1 truncate">
|
||||
Tipo:
|
||||
</div>
|
||||
<div class="col-md-2 ">
|
||||
<asp:DropDownList ID="DdlTipo" CssClass="select2me" Width="100%" runat="server">
|
||||
<asp:ListItem Text="Todos" Value="-1" Selected="True" />
|
||||
<asp:ListItem Text="Suministro" Value="1" />
|
||||
<asp:ListItem Text="Activo Fijo (Interno y Externo)" Value="2" />
|
||||
<asp:ListItem Text="Activo Fijo Interno" Value="3" />
|
||||
<asp:ListItem Text="Activo Fijo Externo" Value="4" />
|
||||
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<%--DATOS--%>
|
||||
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right" align="left">
|
||||
<div style="margin-right: 15px">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Contratos Suministros con los datos especificados." ToolTip="Listado de Contratos Suministros" CssClass="table table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None">
|
||||
<Columns>
|
||||
<%--<asp:BoundField runat="server" HeaderText="No" DataField="NoFila" ItemStyle-HorizontalAlign="Center" />--%>
|
||||
<asp:HyperLinkField ItemStyle-HorizontalAlign="Left" HeaderText="Serie Folio" DataTextField="SerieFolio" DataTextFormatString="{0}" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" />
|
||||
<asp:HyperLinkField ItemStyle-HorizontalAlign="Left" HeaderText="Contrato" DataTextField="NumeroContrato" DataTextFormatString="{0}" DataNavigateUrlFields="CveContrato" DataNavigateUrlFormatString="/Contratos/Contrato.aspx?CveContrato={0}" />
|
||||
<asp:BoundField runat="server" HeaderText="Tipo" DataField="Tipo" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="Contrato Externo" DataField="ContratoExterno" ItemStyle-Width="3%" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField runat="server" HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField runat="server" HeaderText="SubTotal" DataField="SubTotal" DataFormatString="{0:C}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField runat="server" HeaderText="Costo Almacén" DataField="Surtido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
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
|
||||
195
Contratos/RepPedidosDevolucionesXContrato.aspx
Normal file
195
Contratos/RepPedidosDevolucionesXContrato.aspx
Normal file
@@ -0,0 +1,195 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepPedidosDevolucionesXContrato.aspx.vb" Inherits="Ventas_RepPedidosDevolucionesXContrato" %>
|
||||
|
||||
<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">
|
||||
Reporte de Pedidos y Devoluciones por Contrato
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel ID="UpLnkAcciones" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="ImgImprimir" runat="server" OnClick="ImgImprimir_Click"> <i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="ImgExcel" runat="server" OnClick="ImgExcel_Click"> <i class="fa fa-ad-excel"></i> Generar Excel</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="ImgExcel" />
|
||||
<asp:PostBackTrigger ControlID="ImgImprimir" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<%--FILTROS--%>
|
||||
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter" id="FiltrosCotratosSuministros">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" 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">
|
||||
Contrato:
|
||||
</div>
|
||||
<div class="col-md-3 ">
|
||||
<asp:DropDownList ID="DdlContratos" runat="server" AppendDataBoundItems="true" DataTextField="NumeroDescripcionContrato" DataValueField="CveContrato" CssClass="form-control input-small input-sm select2me" Width="100%">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 truncate">
|
||||
Fecha Inicio:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<div class="col-md-1 truncate">
|
||||
Fecha Fin:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none;">
|
||||
<div class="row">
|
||||
<div class="col-md-1 truncate">
|
||||
Tipo:
|
||||
</div>
|
||||
<div class="col-md-2 ">
|
||||
<asp:DropDownList ID="DdlTipo" CssClass="select2me" Width="100%" runat="server">
|
||||
<asp:ListItem Text="Todos" Value="-1" Selected="True" />
|
||||
<asp:ListItem Text="Activo Fijo Interno" Value="1" />
|
||||
<asp:ListItem Text="Activo Fijo Externo" Value="2" />
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<%--DATOS--%>
|
||||
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<span class="caption-subject bold uppercase" style="line-height: 2;">Pedidos</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body rowpadding">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right" align="left">
|
||||
<div style="margin-right: 15px">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="Aun no hay registros." ShowHeaderWhenEmpty="true"
|
||||
DataKeyNames="CveMovimientoDetalle,CodigoPS" ToolTip="Listado de Movimientos"
|
||||
CssClass="table table-hover table-striped Widthall ScrollAD" data-sort="false" GridLines="None"
|
||||
OnRowDataBound="GvDatos_RowDataBound">
|
||||
<Columns>
|
||||
<asp:HyperLinkField HeaderText="Contrato" ItemStyle-HorizontalAlign="Center" Target="_blank" DataNavigateUrlFields="CveContrato" DataNavigateUrlFormatString="/Contratos/Contrato.aspx?CveContrato={0}" DataTextField="Contrato" ItemStyle-Width="7%" />
|
||||
<asp:HyperLinkField HeaderText="Pedido" ItemStyle-HorizontalAlign="Center" Target="_blank" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataTextField="SerieFolio" ItemStyle-Width="7%" />
|
||||
<asp:HyperLinkField HeaderText="Almacen" ItemStyle-HorizontalAlign="Center" Target="_blank" DataNavigateUrlFields="CveMovimiento" ItemStyle-Width="5%" DataNavigateUrlFormatString="/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}" DataTextField="Folio" />
|
||||
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:#,##0.##}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="3%" />
|
||||
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" ItemStyle-Width="40%" />
|
||||
<asp:BoundField HeaderText="Contrato Externo" DataField="ContratoExterno" ItemStyle-Width="3%" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="SerieLote" DataField="SerieLote" ItemStyle-Width="10%" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<span class="caption-subject bold uppercase" style="line-height: 2;">Devoluciones</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body rowpadding">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right" align="left">
|
||||
<div style="margin-right: 15px">
|
||||
<input type="text" id="TxtBusqueda2" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvDevs.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvDevs.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<asp:GridView ID="GvDevs" runat="server" AutoGenerateColumns="False" EmptyDataText="Aun no hay registros." ShowHeaderWhenEmpty="true"
|
||||
DataKeyNames="CveMovimientoDetalle,CodigoPS" ToolTip="Listado de Movimientos"
|
||||
CssClass="table table-hover table-striped Widthall ScrollAD" data-sort="false" GridLines="None"
|
||||
OnRowDataBound="GvDevs_RowDataBound">
|
||||
<Columns>
|
||||
<asp:HyperLinkField HeaderText="Contrato" ItemStyle-HorizontalAlign="Center" Target="_blank" DataNavigateUrlFields="CveContrato" DataNavigateUrlFormatString="/Contratos/Contrato.aspx?CveContrato={0}" DataTextField="Contrato" ItemStyle-Width="7%" />
|
||||
<asp:HyperLinkField HeaderText="Devolución" ItemStyle-HorizontalAlign="Center" Target="_blank" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataTextField="SerieFolio" ItemStyle-Width="7%" />
|
||||
<asp:HyperLinkField HeaderText="Almacen" ItemStyle-HorizontalAlign="Center" Target="_blank" DataNavigateUrlFields="CveMovimiento" ItemStyle-Width="5%" DataNavigateUrlFormatString="/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}" DataTextField="Folio" />
|
||||
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:#,##0.##}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="3%" />
|
||||
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" ItemStyle-Width="40%" />
|
||||
<asp:BoundField HeaderText="Contrato Externo" DataField="ContratoExterno" ItemStyle-Width="3%" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="SerieLote" DataField="SerieLote" ItemStyle-Width="10%" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
153
Contratos/RepPedidosDevolucionesXContrato.aspx.vb
Normal file
153
Contratos/RepPedidosDevolucionesXContrato.aspx.vb
Normal file
@@ -0,0 +1,153 @@
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class Ventas_RepPedidosDevolucionesXContrato
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "P R O P I E D A D E S"
|
||||
Private Property DsDatos As DataSet
|
||||
Get
|
||||
DsDatos = DirectCast(ViewState("DtDatos"), DataSet)
|
||||
End Get
|
||||
|
||||
Set(ByVal value As DataSet)
|
||||
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.AddYears(-1).ToShortDateString
|
||||
txtFechaF.Text = Now.ToShortDateString
|
||||
|
||||
CargaContratos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjContratos As New ClsContratos
|
||||
If ObjContratos.GetRepDevolucionesPedidos(DdlContratos.SelectedValue.ToEntero, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, -1, DdlTipo.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
DsDatos = ObjContratos.DsResultados
|
||||
|
||||
GvDatos.DataSource = DsDatos.Tables(0)
|
||||
GvDevs.DataSource = DsDatos.Tables(1)
|
||||
End If
|
||||
ObjContratos.Dispose()
|
||||
|
||||
GvDatos.DataBind()
|
||||
GvDevs.DataBind()
|
||||
|
||||
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
|
||||
|
||||
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")
|
||||
If DsDatos Is Nothing Then
|
||||
Alert("No se ha consultado ningun contrato", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
Dim Contrato = DdlContratos.SelectedItem
|
||||
|
||||
Dim FechaI As String = txtFechaI.Text
|
||||
Dim FechaF As String = txtFechaF.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("Estatus", ""))
|
||||
params.Add(New ReportParameter("Tipo", DdlTipo.SelectedItem.Text))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
|
||||
Dim lrds As New List(Of ReportDataSource)
|
||||
lrds.Add(New ReportDataSource("DataSet1", DsDatos.Tables(0)))
|
||||
lrds.Add(New ReportDataSource("DataSet2", DsDatos.Tables(1)))
|
||||
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepPedDevolucionesXContrato.rdlc", lrds, params, "ReportePedidosDevoluciones", 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
|
||||
#End Region
|
||||
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("CodigoPS") = "" Then
|
||||
e.Row.CssClass = "SubTotales2"
|
||||
e.Row.Attributes.Add("style", "background-color:#B9B5B4 !important;")
|
||||
e.Row.Cells(1).Text = ""
|
||||
e.Row.Cells(5).Text = ""
|
||||
e.Row.Cells(6).Text = ""
|
||||
|
||||
Dim Texto = $"Pedido: <b><a href='/Ventas/Ventas.aspx?CveVenta={e.Row.DBCampo("CveVenta")}' target='_blank'>{e.Row.DBCampo("SerieFolio")}</a></b> | "
|
||||
Texto += If(e.Row.DBCampo("CveMovimiento").ToString = "", " SIN MOVIMIENTO DE ALMACÉN", $"Folio Almacén: <b><a href ='/Inventarios/EntradasSalidas.aspx?CveMovimiento={e.Row.DBCampo("CveMovimiento")}' target='_blank'>{e.Row.DBCampo("Folio")}</a></b>")
|
||||
|
||||
e.Row.Cells(1).ColumnSpan = 2
|
||||
e.Row.Cells(2).Visible = False
|
||||
e.Row.Cells(1).Text = Texto
|
||||
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
|
||||
Else
|
||||
If e.Row.DBCampo("CveMovimiento").ToString = "" Then
|
||||
e.Row.Cells(2).Text = "SIN MOVIMIENTO DE ALMACÉN"
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub GvDevs_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("CodigoPS") = "" Then
|
||||
e.Row.CssClass = "SubTotales2"
|
||||
e.Row.Attributes.Add("style", "background-color:#B9B5B4 !important;")
|
||||
e.Row.Cells(1).Text = ""
|
||||
e.Row.Cells(5).Text = ""
|
||||
e.Row.Cells(6).Text = ""
|
||||
|
||||
Dim Texto = $"Devolución: <b><a href='/Ventas/Ventas.aspx?CveVenta={e.Row.DBCampo("CveVenta")}' target='_blank'>{e.Row.DBCampo("SerieFolio")}</a></b> | "
|
||||
Texto += If(e.Row.DBCampo("CveMovimiento").ToString = "", " SIN MOVIMIENTO DE ALMACÉN", $"Folio Almacén: <b><a href ='/Inventarios/EntradasSalidas.aspx?CveMovimiento={e.Row.DBCampo("CveMovimiento")}' target='_blank'>{e.Row.DBCampo("Folio")}</a></b>")
|
||||
|
||||
e.Row.Cells(1).ColumnSpan = 2
|
||||
e.Row.Cells(2).Visible = False
|
||||
e.Row.Cells(1).Text = Texto
|
||||
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
|
||||
Else
|
||||
If e.Row.DBCampo("CveMovimiento").ToString = "" Then
|
||||
e.Row.Cells(2).Text = "SIN MOVIMIENTO DE ALMACÉN"
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
581
Contratos/RepPresupuestos.aspx
Normal file
581
Contratos/RepPresupuestos.aspx
Normal file
@@ -0,0 +1,581 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepPresupuestos.aspx.vb" Inherits="Contratos_RepPresupuestos" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
.dataTables_scrollHead {
|
||||
background-color: #95A5A6;
|
||||
color: white;
|
||||
}
|
||||
|
||||
@import url(https://fonts.googleapis.com/css?family=Droid+Sans:400,700|Droid+Serif:400,700);
|
||||
|
||||
#chartProyectos {
|
||||
height: 800px;
|
||||
width: 800px;
|
||||
}
|
||||
|
||||
.amcharts-chart-div a {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.contenedor {
|
||||
margin: 0 auto;
|
||||
text-align: left;
|
||||
color: #989A8F;
|
||||
width: 450px;
|
||||
height: 200px;
|
||||
}
|
||||
|
||||
.calificador {
|
||||
height: 270px;
|
||||
width: 75%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.toplistaVerde {
|
||||
background-color: #1BA39C;
|
||||
height: 33%;
|
||||
width: 300px;
|
||||
padding-top: 17%;
|
||||
}
|
||||
|
||||
.toplistaAmarillo {
|
||||
background-color: #c29d0b;
|
||||
height: 33%;
|
||||
width: 300px;
|
||||
padding-top: 17%;
|
||||
}
|
||||
|
||||
.toplistaRojo {
|
||||
background-color: #E43A45;
|
||||
height: 33%;
|
||||
width: 300px;
|
||||
padding-top: 17%;
|
||||
}
|
||||
|
||||
.toplistaAzul {
|
||||
background-color: #337ab7;
|
||||
height: 33%;
|
||||
width: 300px;
|
||||
padding-top: 17%;
|
||||
}
|
||||
|
||||
.bottomlista {
|
||||
margin-top: 25%;
|
||||
}
|
||||
|
||||
|
||||
.circuloVerde {
|
||||
width: 40%;
|
||||
height: 400%;
|
||||
border: 4px solid;
|
||||
border-radius: 50% !important;
|
||||
border-color: #1BA39C;
|
||||
font-size: 30px;
|
||||
color: #fff;
|
||||
line-height: 405%;
|
||||
text-align: center;
|
||||
background-color: #FFFFFF;
|
||||
margin-left: 30%;
|
||||
margin-top: -10%;
|
||||
}
|
||||
|
||||
.verde {
|
||||
color: #1BA39C;
|
||||
}
|
||||
|
||||
.circuloAmarillo {
|
||||
width: 40%;
|
||||
height: 400%;
|
||||
border: 4px solid;
|
||||
border-radius: 50% !important;
|
||||
border-color: #c29d0b;
|
||||
font-size: 30px;
|
||||
color: #fff;
|
||||
line-height: 405%;
|
||||
text-align: center;
|
||||
background-color: #FFFFFF;
|
||||
margin-left: 30%;
|
||||
margin-top: -10%;
|
||||
}
|
||||
|
||||
.amarillo {
|
||||
color: #c29d0b;
|
||||
}
|
||||
|
||||
.circuloRojo {
|
||||
width: 40%;
|
||||
height: 400%;
|
||||
border: 4px solid;
|
||||
border-radius: 50% !important;
|
||||
border-color: #E43A45;
|
||||
font-size: 30px;
|
||||
color: #fff;
|
||||
line-height: 405%;
|
||||
text-align: center;
|
||||
background-color: #FFFFFF;
|
||||
margin-left: 30%;
|
||||
margin-top: -10%;
|
||||
}
|
||||
|
||||
.rojo {
|
||||
color: #E43A45;
|
||||
}
|
||||
|
||||
.circuloAzul {
|
||||
width: 40%;
|
||||
height: 400%;
|
||||
border: 4px solid;
|
||||
border-radius: 50% !important;
|
||||
border-color: #337ab7;
|
||||
font-size: 30px;
|
||||
color: #fff;
|
||||
line-height: 405%;
|
||||
text-align: center;
|
||||
background-color: #FFFFFF;
|
||||
margin-left: 30%;
|
||||
margin-top: -10%;
|
||||
}
|
||||
|
||||
.azul {
|
||||
color: #337ab7;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte de Presupuestos
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:LinkButton ID="ImgImprimir" runat="server"> <i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="ImgExcel" runat="server"><i class="fa fa-ad-excel"></i> Generar Excel</asp:LinkButton>
|
||||
</li>
|
||||
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:HyperLink ID="HpGrafica" data-toggle="modal" data-target="#DivModalGrafca" runat="server"><i class="fa fa-bar-chart"></i> Ver Graficas</asp:HyperLink>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
|
||||
<asp:UpdatePanel ID="UpFiltros" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultarFiltros" OnClick="BtnConsultarFiltros_Click" runat="server" Text="Consultar" ValidationGroup="GrpFiltros" class="btn btn-primary" />
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption ">
|
||||
<div class="row">
|
||||
<div class="col-md-1" style="max-width: 90px">Fecha Inicio:</div>
|
||||
<div class="col-md-2" style="max-width: 130px">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 90px !important; padding: 0px;">
|
||||
<asp:TextBox ID="TxtFiltrosFechaInicio" CssClass="form-control input-sm ADSMaskDate" Style="width: 88px" runat="server"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="LnkFechaI" class="btn default " Text=" <i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEEFiltrosFechaInicio" runat="server" TargetControlID="TxtFiltrosFechaInicio" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CEFiltrosFechaInicio" TargetControlID="TxtFiltrosFechaInicio" PopupButtonID="LnkFechaI" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVFiltrosFechaInicio" runat="server" ControlToValidate="TxtFiltrosFechaInicio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpFiltros"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEFiltrosFechaInicio" runat="server" HighlightCssClass="vco" TargetControlID="RFVFiltrosFechaInicio"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1" style="max-width: 75px">Fecha Fin:</div>
|
||||
<div class="col-md-2" style="max-width: 130px">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 90px !important; padding: 0px;">
|
||||
<asp:TextBox ID="TxtFiltrosFechaFin" CssClass="form-control input-sm ADSMaskDate" Style="width: 88px" runat="server"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="LnkFechaF" class="btn default " Text=" <i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEEFiltrosFechaFin" runat="server" TargetControlID="TxtFiltrosFechaFin" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CEFiltrosFechaFin" TargetControlID="TxtFiltrosFechaFin" PopupButtonID="LnkFechaF" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVFiltrosFechaFin" runat="server" ControlToValidate="TxtFiltrosFechaFin" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpFiltros"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEFiltrosFechaFin" runat="server" HighlightCssClass="vco" TargetControlID="RFVFiltrosFechaFin"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1" style="max-width: 80px">Agrupador:</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlAgrupador" Width="150px" runat="server" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Text="Clasificacion" Value="1" />
|
||||
<asp:ListItem Text="Centro de Costo" Value="2" Selected="True" />
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1" style="max-width: 80px">Mensual:</div>
|
||||
<div class="col-md-2">
|
||||
<asp:CheckBox ID="ChkMensual" runat="server" CssClass="md-checksd2" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none;">
|
||||
<div class="row">
|
||||
<div class="col-md-1" style="max-width: 120px">Proyecto:</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlProyecto" DataTextField="Proyecto" AppendDataBoundItems="true" DataValueField="CveProyecto" AutoPostBack="true" OnSelectedIndexChanged="DdlProyecto_SelectedIndexChanged" Width="200px" runat="server" CssClass="form-control input-sm select2me">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1" style="max-width: 120px">SubProyecto:</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlSubProyecto" DataTextField="SubProyecto" AppendDataBoundItems="true" DataValueField="CveSubProyecto" Width="200px" runat="server" CssClass="form-control input-sm select2me">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1" style="max-width: 120px">Clasificacion:</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlClasificacion" DataTextField="Clasificacion" AppendDataBoundItems="true" DataValueField="CveClasificacion" Width="200px" runat="server" CssClass="form-control input-sm select2me">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1" style="max-width: 120px">Tipo Gasto:</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlTipoGasto" Width="200px" DataTextField="TipoGasto" DataValueField="CveTipoGasto" AppendDataBoundItems="true" runat="server" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Text="Todos" Value="-1" Selected="True" />
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel UpdateMode="Conditional" ID="UpIndicadores" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="row" id="DivIndicadores" runat="server" visible="false">
|
||||
<div class="col-lg-4 col-md-4">
|
||||
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding-top px;">
|
||||
<div class="display" style="margin-bottom: 0px">
|
||||
<div class="number">
|
||||
<h3 class="font-red-haze">
|
||||
<small class="font-red-haze">$</small>
|
||||
<span data-counter="counterup">
|
||||
<asp:Literal runat="server" ID="LtlAutorizado"></asp:Literal></span>
|
||||
</h3>
|
||||
<small>AUTORIZADO</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 col-md-4">
|
||||
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding: 5px 5px 25px 5px;">
|
||||
<div class="display">
|
||||
<div class="number">
|
||||
<h3 class="font-blue-sharp">
|
||||
<small class="font-blue-sharp">$</small>
|
||||
<span data-counter="counterup">
|
||||
<asp:Literal runat="server" ID="LtlEjercido"></asp:Literal></span>
|
||||
</h3>
|
||||
<small>EJERCIDO</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="progress-info">
|
||||
<div class="progress">
|
||||
<span style="width: 50%;" id="PBEjercido" runat="server" class="progress-bar progress-bar-info blue-sharp">
|
||||
<span class="sr-only">
|
||||
<asp:Literal runat="server" ID="LtlPorcenEjercido"></asp:Literal></span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="status">
|
||||
<div class="status-title">Porcentaje Ejercido </div>
|
||||
<div class="status-number">
|
||||
<asp:Literal runat="server" ID="LtlPorcentajeEjercido"></asp:Literal>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 col-md-4">
|
||||
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke; padding: 5px 5px 25px 5px;">
|
||||
<div class="display">
|
||||
<div class="number">
|
||||
<h3 class="font-green-sharp">
|
||||
<small class="font-green-sharp">$</small>
|
||||
<span data-counter="counterup">
|
||||
<asp:Literal runat="server" ID="LtlPorEjercer"></asp:Literal></span>
|
||||
</h3>
|
||||
<small>POR EJERCER</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="progress-info">
|
||||
<div class="progress">
|
||||
<span style="width: 50%;" id="PBPorEjercer" runat="server" class="progress-bar progress-bar-success green-sharp">
|
||||
<span class="sr-only">
|
||||
<asp:Literal runat="server" ID="LtlPorcentPorEjer"></asp:Literal></span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="status">
|
||||
<div class="status-title">Porcentaje Por Ejercer </div>
|
||||
<div class="status-number">
|
||||
<asp:Literal runat="server" ID="LtlPorcentajePorEjercer"></asp:Literal>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div id="DivRepDatos" runat="server" visible="false">
|
||||
<table class="table Widthall ">
|
||||
<tr>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 20%; border-right: 3px solid white;">Agrupador</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 20%; border-right: 3px solid white;">Autorizado</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 30%; border-right: 3px solid white;">Ejercido</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 30%; border-right: 3px solid white;">Por Ejercer</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="Sin resultados" ShowHeaderWhenEmpty="true" CssClass="table table-striped table-hover Widthall ScrollAD" GridLines="None" data-sort="true">
|
||||
<Columns>
|
||||
<%--<asp:HyperLinkField HeaderText="Descripcion" DataTextField="Agrupador" ItemStyle-Width="20%"--%>
|
||||
<asp:BoundField HeaderText="Descripcion" DataField="Agrupador" ItemStyle-Width="20%" />
|
||||
<asp:BoundField HeaderText="Importe" DataField="Autorizado" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="20%" />
|
||||
<asp:BoundField HeaderText="Importe" DataField="Ejercido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="20%" />
|
||||
<asp:BoundField HeaderText="%" DataField="EjercidoPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" />
|
||||
<asp:BoundField HeaderText="Importe" DataField="PorEjercer" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="20%" />
|
||||
<asp:BoundField HeaderText="%" DataField="PorEjercerPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UpDatosMensual" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div id="DivDatosMensual" runat="server" visible="false" style="overflow-x: auto; overflow-y: auto">
|
||||
<table class="table" style="overflow-x: auto">
|
||||
<tr>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; min-width: 200px; border-right: 3px solid white;">Agrupador</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; min-width: 120px; border-right: 3px solid white;">Autorizado</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; min-width: 140px; border-right: 3px solid white;">Enero</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; min-width: 140px; border-right: 3px solid white;">Febrero</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; min-width: 140px; border-right: 3px solid white;">Marzo</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; min-width: 140px; border-right: 3px solid white;">Abril</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; min-width: 140px; border-right: 3px solid white;">Mayo</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; min-width: 140px; border-right: 3px solid white;">Junio</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; min-width: 140px; border-right: 3px solid white;">Julio</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; min-width: 140px; border-right: 3px solid white;">Agosto</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; min-width: 140px; border-right: 3px solid white;">Septiembre</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; min-width: 140px; border-right: 3px solid white;">Octubre</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; min-width: 140px; border-right: 3px solid white;">Noviembre</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; min-width: 140px; border-right: 3px solid white;">Diciembre</td>
|
||||
</tr>
|
||||
</table>
|
||||
<asp:GridView ID="GvDatosMensual" OnRowDataBound="GvDatosMensual_RowDataBound" runat="server" AutoGenerateColumns="False" Style="min-width: 2000px; overflow-y: hidden" Width="2000px" EmptyDataText="Sin resultados" ShowHeaderWhenEmpty="true" CssClass="table table-striped table-hover" GridLines="None" data-sort="true">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Descripcion" DataField="Agrupador" ItemStyle-Width="200px" />
|
||||
<asp:BoundField HeaderText="Importe" DataField="Autorizado" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="120px" />
|
||||
|
||||
<asp:BoundField HeaderText="Ejercido" DataField="EneroEjercido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
|
||||
<asp:BoundField HeaderText="%" DataField="EneroEjercidoPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="40px" />
|
||||
<%-- <asp:BoundField HeaderText="Por Ejercer" DataField="EneroPorEjercer" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="130px" />
|
||||
<asp:BoundField HeaderText="%" DataField="EneroPorEjercerPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="60px" />--%>
|
||||
|
||||
<asp:BoundField HeaderText="Ejercido" DataField="FebreroEjercido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
|
||||
<asp:BoundField HeaderText="%" DataField="FebreroEjercidoPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="40px" />
|
||||
<%-- <asp:BoundField HeaderText="Por Ejercer" DataField="FebreroPorEjercer" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="130px" />
|
||||
<asp:BoundField HeaderText="%" DataField="FebreroPorEjercerPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="60px" />--%>
|
||||
|
||||
<asp:BoundField HeaderText="Ejercido" DataField="MarzoEjercido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
|
||||
<asp:BoundField HeaderText="%" DataField="MarzoEjercidoPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="40px" />
|
||||
<%-- <asp:BoundField HeaderText="Por Ejercer" DataField="MarzoPorEjercer" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="130px" />
|
||||
<asp:BoundField HeaderText="%" DataField="MarzoPorEjercerPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="60px" />--%>
|
||||
|
||||
<asp:BoundField HeaderText="Ejercido" DataField="AbrilEjercido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
|
||||
<asp:BoundField HeaderText="%" DataField="AbrilEjercidoPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="40px" />
|
||||
<%--<asp:BoundField HeaderText="Por Ejercer" DataField="DiciembrePorEjercer" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="130px" />
|
||||
<asp:BoundField HeaderText="%" DataField="DiciembrePorEjercerPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="60px" />--%>
|
||||
|
||||
<asp:BoundField HeaderText="Ejercido" DataField="MayoEjercido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
|
||||
<asp:BoundField HeaderText="%" DataField="MayoEjercidoPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="40px" />
|
||||
<%-- <asp:BoundField HeaderText="Por Ejercer" DataField="MayoPorEjercer" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="130px" />
|
||||
<asp:BoundField HeaderText="%" DataField="MayoPorEjercerPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="60px" />--%>
|
||||
|
||||
<asp:BoundField HeaderText="Ejercido" DataField="JunioEjercido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
|
||||
<asp:BoundField HeaderText="%" DataField="JunioEjercidoPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="40px" />
|
||||
<%-- <asp:BoundField HeaderText="Por Ejercer" DataField="JunioPorEjercer" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="130px" />
|
||||
<asp:BoundField HeaderText="%" DataField="JunioPorEjercerPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="60px" />--%>
|
||||
|
||||
<asp:BoundField HeaderText="Ejercido" DataField="JulioEjercido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
|
||||
<asp:BoundField HeaderText="%" DataField="JulioEjercidoPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="40px" />
|
||||
<%--<asp:BoundField HeaderText="Por Ejercer" DataField="JulioPorEjercer" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="130px" />
|
||||
<asp:BoundField HeaderText="%" DataField="JulioPorEjercerPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="60px" />--%>
|
||||
|
||||
<asp:BoundField HeaderText="Ejercido" DataField="AgostoEjercido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
|
||||
<asp:BoundField HeaderText="%" DataField="AgostoEjercidoPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="40px" />
|
||||
<%--<asp:BoundField HeaderText="Por Ejercer" DataField="AgostoPorEjercer" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="130px" />
|
||||
<asp:BoundField HeaderText="%" DataField="AgostoPorEjercerPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="60px" />--%>
|
||||
|
||||
<asp:BoundField HeaderText="Ejercido" DataField="SeptiembreEjercido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
|
||||
<asp:BoundField HeaderText="%" DataField="SeptiembreEjercidoPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="40px" />
|
||||
<%--<asp:BoundField HeaderText="Por Ejercer" DataField="SeptiembrePorEjercer" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="130px" />
|
||||
<asp:BoundField HeaderText="%" DataField="SeptiembrePorEjercerPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="60px" />--%>
|
||||
|
||||
<asp:BoundField HeaderText="Ejercido" DataField="OctubreEjercido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
|
||||
<asp:BoundField HeaderText="%" DataField="OctubreEjercidoPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="40px" />
|
||||
<%-- <asp:BoundField HeaderText="Por Ejercer" DataField="OctubrePorEjercer" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="130px" />
|
||||
<asp:BoundField HeaderText="%" DataField="OctubrePorEjercerPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="60px" />--%>
|
||||
|
||||
<asp:BoundField HeaderText="Ejercido" DataField="NoviembreEjercido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
|
||||
<asp:BoundField HeaderText="%" DataField="NoviembreEjercidoPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="40px" />
|
||||
<%-- <asp:BoundField HeaderText="Por Ejercer" DataField="NoviembrePorEjercer" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="130px" />
|
||||
<asp:BoundField HeaderText="%" DataField="NoviembrePorEjercerPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="60px" />--%>
|
||||
|
||||
<asp:BoundField HeaderText="Ejercido" DataField="DiciembreEjercido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
|
||||
<asp:BoundField HeaderText="%" DataField="DiciembreEjercidoPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="40px" />
|
||||
<%--<asp:BoundField HeaderText="Por Ejercer" DataField="DiciembrePorEjercer" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="130px" />
|
||||
<asp:BoundField HeaderText="%" DataField="DiciembrePorEjercerPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="60px" />--%>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="DivModalGrafca" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalGrafica" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<h4 class="modal-title">Centros de Costo </h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:HiddenField ID="HdnJsonProyecto" Value="[]" runat="server" ClientIDMode="Static" />
|
||||
<asp:HiddenField ID="HdnJsonGraficos" Value="[]" runat="server" ClientIDMode="Static" />
|
||||
<div id="chartProyectos"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="modal-btn">
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script src="https://www.amcharts.com/lib/3/amcharts.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/pie.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/serial.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/gauge.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/plugins/animate/animate.min.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
|
||||
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
|
||||
<script type="text/javascript">
|
||||
|
||||
function CargaChartProyecto(data) {
|
||||
|
||||
var chartCentrosCostos = AmCharts.makeChart("chartProyectos", {
|
||||
"type": "serial",
|
||||
"theme": "light",
|
||||
"dataProvider": data,
|
||||
"valueAxes": [{
|
||||
"stackType": "3d",
|
||||
"unit": "%",
|
||||
"position": "left"
|
||||
}],
|
||||
"graphs": [{
|
||||
"balloonText": "<b>[[category]]</b><br><span style='font-size:14px'>[[title]]: <b>$ [[Ejercido]]</b></span>",
|
||||
"fillColors": "#DD5F2E",
|
||||
"fillAlphas": 0.9,
|
||||
"labelText": "[[Ejercido]]",
|
||||
"lineColor": "#000000",
|
||||
"lineAlpha": 0.2,
|
||||
"title": "Ejercido",
|
||||
"type": "column",
|
||||
"color": "#000000",
|
||||
"valueField": "EjercidoProporcion"
|
||||
}, {
|
||||
"balloonText": "<b>[[category]]</b><br><span style='font-size:14px'>[[title]]: <b>$ [[PorEjercer]]</b></span>",
|
||||
"fillColors": "#DEAD7F",
|
||||
"fillAlphas": 0.9,
|
||||
"labelText": "[[PorEjercer]]",
|
||||
"lineColor": "#000000",
|
||||
"lineAlpha": 0.2,
|
||||
"title": "Por Ejercer",
|
||||
"type": "column",
|
||||
"color": "#000000",
|
||||
"valueField": "PorEjercerProporcion"
|
||||
},
|
||||
{
|
||||
"balloonText": "<b>[[category]]</b><br><span style='font-size:14px'>[[title]]: <b>$ [[Autorizado]]</b></span>",
|
||||
"fillColors": "#037638",
|
||||
"fillAlphas": 0.9,
|
||||
"labelText": "[[Autorizado]]",
|
||||
"lineColor": "#000000",
|
||||
"lineAlpha": 0.2,
|
||||
"title": "Autorizado",
|
||||
"type": "column",
|
||||
"color": "#000000",
|
||||
"valueField": "AutorizadoProporcion"
|
||||
}],
|
||||
"plotAreaFillAlphas": 0.1,
|
||||
"depth3D": 0,
|
||||
"angle": 30,
|
||||
"rotate": true,
|
||||
"categoryField": "Agrupador",
|
||||
"categoryAxis": {
|
||||
"gridPosition": "start",
|
||||
"axisAlpha": 0,
|
||||
"gridAlpha": 0,
|
||||
"position": "left"
|
||||
},
|
||||
"export": {
|
||||
"enabled": true
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
function CargaChartMensual(data, graficos) {
|
||||
var chart = AmCharts.makeChart("chartProyectos", {
|
||||
"type": "serial",
|
||||
"theme": "light",
|
||||
"legend": {
|
||||
"useGraphSettings": true
|
||||
},
|
||||
"dataProvider": data,
|
||||
"synchronizeGrid": true,
|
||||
"valueAxes": [{
|
||||
"id": "v1",
|
||||
"axisColor": "#FF6600",
|
||||
"axisThickness": 2,
|
||||
"axisAlpha": 1,
|
||||
"position": "left"
|
||||
}],
|
||||
"graphs": graficos,
|
||||
"chartCursor": {
|
||||
"cursorPosition": "mouse"
|
||||
},
|
||||
"categoryField": "Mes",
|
||||
"categoryAxis": {
|
||||
"axisColor": "#DADADA",
|
||||
"minorGridEnabled": true
|
||||
},
|
||||
"export": {
|
||||
"enabled": false
|
||||
}
|
||||
});
|
||||
|
||||
chart.addListener("dataUpdated", zoomChart);
|
||||
zoomChart();
|
||||
|
||||
function zoomChart() {
|
||||
chart.zoomToIndexes(chart.dataProvider.length - 20, chart.dataProvider.length - 1);
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
518
Contratos/RepPresupuestos.aspx.vb
Normal file
518
Contratos/RepPresupuestos.aspx.vb
Normal file
@@ -0,0 +1,518 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports Newtonsoft.Json
|
||||
Imports Newtonsoft.Json.Linq
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class Contratos_RepPresupuestos
|
||||
Inherits ClsPaginas
|
||||
#Region "P R O P I E D A D E S"
|
||||
|
||||
Public Property DtPresupuestos() As DataTable
|
||||
Get
|
||||
Return DirectCast(ViewState("DtPresupuestos"), DataTable)
|
||||
End Get
|
||||
Set(ByVal value As DataTable)
|
||||
ViewState("DtPresupuestos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
InicializaValores()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region " INICIALIZA VALORES "
|
||||
Private Sub InicializaValores()
|
||||
|
||||
TxtFiltrosFechaInicio.Text = $"01/09/{Now.Year - 1}"
|
||||
TxtFiltrosFechaFin.Text = $"31/08/{Now.Year}"
|
||||
|
||||
DdlTipoGasto.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa)
|
||||
DdlTipoGasto.DataBind()
|
||||
|
||||
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
|
||||
DdlClasificacion.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlClasificacion.DataBind()
|
||||
|
||||
DdlProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1).FiltraParametros("", "", {"CveProyecto", "Proyecto"}), GlobalDTProyectos(UsuarioActual.CveEmpresa, -1).FiltraParametros("", "", {"CveProyecto", "Proyecto"}))
|
||||
DdlProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlProyecto.DataBind()
|
||||
|
||||
CargaSubProyecto()
|
||||
UpFiltros.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " CARGA DATOS "
|
||||
|
||||
Private Sub CargaSubProyecto()
|
||||
DdlSubProyecto.Items.Clear()
|
||||
If DdlProyecto.SelectedValue.ToEntero > 0 Or UsuarioActual.Empresa.Tipo_CentroCosto = 1 Then
|
||||
DdlSubProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, DdlProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa, 1))
|
||||
End If
|
||||
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlSubProyecto.DataBind()
|
||||
End Sub
|
||||
Protected Sub BtnConsultarFiltros_Click(sender As Object, e As EventArgs)
|
||||
CargaDatos()
|
||||
End Sub
|
||||
Private Sub CargaDatos()
|
||||
Dim CveTipoGasto = DdlTipoGasto.SelectedValue.ToEntero
|
||||
Dim Agrupador = DdlAgrupador.SelectedValue.ToEntero
|
||||
Dim FechaInicio = If(IsDate(TxtFiltrosFechaInicio.Text), TxtFiltrosFechaInicio.Text.ToDate, MinFecha)
|
||||
Dim FechaFin = If(IsDate(TxtFiltrosFechaFin.Text), TxtFiltrosFechaFin.Text.ToDate, MaxFecha)
|
||||
Dim EsMensual = ChkMensual.Checked
|
||||
|
||||
If Not EsMensual Then
|
||||
Dim ObjPresupuestos As New ClsContratos
|
||||
If ObjPresupuestos.GetPresupuestosRep(-1, CveTipoGasto, Agrupador, FechaInicio, FechaFin, UsuarioActual.CveEmpresa, DdlProyecto.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveUsuario, DdlClasificacion.SelectedValue.ToEntero) Then
|
||||
|
||||
DtPresupuestos = ObjPresupuestos.DtResultados
|
||||
GvDatos.DataSource = DtPresupuestos
|
||||
End If
|
||||
ObjPresupuestos.Dispose()
|
||||
DivDatosMensual.Visible = False
|
||||
DivRepDatos.Visible = True
|
||||
DivIndicadores.Visible = True
|
||||
GvDatos.DataBind()
|
||||
GvDatos.HeaderRow.Cells(0).Text = If(Agrupador = 1, "Clasificación", "Centro de Costo")
|
||||
UpDatos.Update()
|
||||
|
||||
Else
|
||||
Dim ObjPresupuestos As New ClsContratos
|
||||
If ObjPresupuestos.GetPresupuestosMensualRep(-1, CveTipoGasto, Agrupador, FechaInicio, FechaFin, UsuarioActual.CveEmpresa, DdlProyecto.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveUsuario, DdlClasificacion.SelectedValue.ToEntero) Then
|
||||
DtPresupuestos = ObjPresupuestos.DtResultados
|
||||
GvDatosMensual.DataSource = DtPresupuestos
|
||||
End If
|
||||
ObjPresupuestos.Dispose()
|
||||
DivDatosMensual.Visible = True
|
||||
DivRepDatos.Visible = False
|
||||
DivIndicadores.Visible = False
|
||||
GvDatosMensual.DataBind()
|
||||
GvDatosMensual.HeaderRow.Cells(0).Text = If(Agrupador = 1, "Clasificación", "Centro de Costo")
|
||||
UpDatosMensual.Update()
|
||||
|
||||
End If
|
||||
|
||||
Select Case Agrupador
|
||||
Case 1 'CLASIFICACON
|
||||
HpGrafica.Visible = False
|
||||
CargaIndicadores(EsMensual)
|
||||
Case 2 'CENTRO DE COSTO
|
||||
HpGrafica.Visible = True
|
||||
CargaIndicadores(EsMensual)
|
||||
End Select
|
||||
|
||||
UpAcciones.Update()
|
||||
UpModalGrafica.Update()
|
||||
UpIndicadores.Update()
|
||||
|
||||
If EsMensual Then
|
||||
RegistraScript($"CargaChartMensual({HdnJsonProyecto.Value},{HdnJsonGraficos.Value});", "2")
|
||||
Else
|
||||
|
||||
RegistraScript($"CargaChartProyecto({HdnJsonProyecto.Value});", "2")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Private Sub CargaIndicadores(EsMensual As Boolean, Optional Tipo As String = "1")
|
||||
If DtPresupuestos IsNot Nothing And GvDatos.Rows.Count > 0 Then
|
||||
|
||||
Dim DtDatos = DtPresupuestos.FiltraParametros($"Tipo = {Tipo}")
|
||||
|
||||
If EsMensual Then
|
||||
Dim jsonGraphs = New JArray()
|
||||
Dim jsonData = New JArray()
|
||||
Dim Random = New Random()
|
||||
|
||||
Dim JEnero As New JObject
|
||||
Dim JNombreEnero = New JProperty("Mes", "Enero")
|
||||
JEnero.Add(JNombreEnero)
|
||||
|
||||
Dim JFebrero As New JObject
|
||||
Dim JNombreFebrero = New JProperty("Mes", "Febrero")
|
||||
JFebrero.Add(JNombreFebrero)
|
||||
|
||||
Dim JMarzo As New JObject
|
||||
Dim JNombreMarzo = New JProperty("Mes", "Marzo")
|
||||
JMarzo.Add(JNombreMarzo)
|
||||
|
||||
Dim JAbril As New JObject
|
||||
Dim JNombreAbril = New JProperty("Mes", "Abril")
|
||||
JAbril.Add(JNombreAbril)
|
||||
|
||||
Dim JMayo As New JObject
|
||||
Dim JNombreMayo = New JProperty("Mes", "Mayo")
|
||||
JMayo.Add(JNombreMayo)
|
||||
|
||||
Dim JJunio As New JObject
|
||||
Dim JNombreJunio = New JProperty("Mes", "Junio")
|
||||
JJunio.Add(JNombreJunio)
|
||||
|
||||
Dim JJulio As New JObject
|
||||
Dim JNombreJulio = New JProperty("Mes", "Julio")
|
||||
JJulio.Add(JNombreJulio)
|
||||
|
||||
Dim JAgosto As New JObject
|
||||
Dim JNombreAgosto = New JProperty("Mes", "Agosto")
|
||||
JAgosto.Add(JNombreAgosto)
|
||||
|
||||
Dim JSeptiembre As New JObject
|
||||
Dim JNombreSeptiembre = New JProperty("Mes", "Septiembre")
|
||||
JSeptiembre.Add(JNombreSeptiembre)
|
||||
|
||||
Dim JOctubre As New JObject
|
||||
Dim JNombreOctubre = New JProperty("Mes", "Octubre")
|
||||
JOctubre.Add(JNombreOctubre)
|
||||
|
||||
Dim JNoviembre As New JObject
|
||||
Dim JNombreNoviembre = New JProperty("Mes", "Noviembre")
|
||||
JNoviembre.Add(JNombreNoviembre)
|
||||
|
||||
Dim JDiciembre As New JObject
|
||||
Dim JNombreDiciembre = New JProperty("Mes", "Diciembre")
|
||||
JDiciembre.Add(JNombreDiciembre)
|
||||
|
||||
For Each Dr As DataRow In DtDatos.Rows
|
||||
|
||||
Dim NombreValorAgrupador As String = $"Valor{ Dr("Agrupador").ToString()}"
|
||||
Dim HtmlColor = String.Format("#{0:X6}", Random.Next(&H1000000))
|
||||
|
||||
Dim jGraph = New JObject(New JProperty("valueAxis", "v1"),
|
||||
New JProperty("lineColor", HtmlColor),
|
||||
New JProperty("bullet", "round"),
|
||||
New JProperty("bulletBorderThickness", 1),
|
||||
New JProperty("hideBulletsCount", 30),
|
||||
New JProperty("fillAlphas", 0),
|
||||
New JProperty("title", Dr("Agrupador").ToString()),
|
||||
New JProperty("valueField", NombreValorAgrupador)
|
||||
)
|
||||
jsonGraphs.Add(jGraph)
|
||||
|
||||
Dim ValorEnero = Dr("EneroEjercido").ToString.ToDecimal()
|
||||
Dim JValorEnero = New JProperty(NombreValorAgrupador, ValorEnero)
|
||||
|
||||
JEnero.Add(JValorEnero)
|
||||
|
||||
Dim ValorFebrero = Dr("FebreroEjercido").ToString.ToDecimal()
|
||||
Dim JValorFebrero = New JProperty(NombreValorAgrupador, ValorFebrero)
|
||||
|
||||
JFebrero.Add(JValorFebrero)
|
||||
|
||||
Dim ValorMarzo = Dr("MarzoEjercido").ToString.ToDecimal()
|
||||
Dim JValorMarzo = New JProperty(NombreValorAgrupador, ValorMarzo)
|
||||
|
||||
JMarzo.Add(JValorMarzo)
|
||||
|
||||
Dim ValorAbril = Dr("AbrilEjercido").ToString.ToDecimal()
|
||||
Dim JValorAbril = New JProperty(NombreValorAgrupador, ValorAbril)
|
||||
|
||||
JAbril.Add(JValorAbril)
|
||||
|
||||
Dim ValorMayo = Dr("MayoEjercido").ToString.ToDecimal()
|
||||
Dim JValorMayo = New JProperty(NombreValorAgrupador, ValorMayo)
|
||||
|
||||
JMayo.Add(JValorMayo)
|
||||
|
||||
Dim ValorJunio = Dr("JunioEjercido").ToString.ToDecimal()
|
||||
Dim JValorJunio = New JProperty(NombreValorAgrupador, ValorJunio)
|
||||
|
||||
JJunio.Add(JValorJunio)
|
||||
|
||||
Dim ValorJulio = Dr("JulioEjercido").ToString.ToDecimal()
|
||||
Dim JValorJulio = New JProperty(NombreValorAgrupador, ValorJulio)
|
||||
|
||||
JJulio.Add(JValorJulio)
|
||||
|
||||
Dim ValorAgosto = Dr("AgostoEjercido").ToString.ToDecimal()
|
||||
Dim JValorAgosto = New JProperty(NombreValorAgrupador, ValorAgosto)
|
||||
|
||||
JAgosto.Add(JValorAgosto)
|
||||
|
||||
Dim ValorSeptiembre = Dr("SeptiembreEjercido").ToString.ToDecimal()
|
||||
Dim JValorSeptiembre = New JProperty(NombreValorAgrupador, ValorSeptiembre)
|
||||
|
||||
JSeptiembre.Add(JValorSeptiembre)
|
||||
|
||||
Dim ValorOctubre = Dr("OctubreEjercido").ToString.ToDecimal()
|
||||
Dim JValorOctubre = New JProperty(NombreValorAgrupador, ValorOctubre)
|
||||
|
||||
JOctubre.Add(JValorOctubre)
|
||||
|
||||
Dim ValorNoviembre = Dr("NoviembreEjercido").ToString.ToDecimal()
|
||||
Dim JValorNoviembre = New JProperty(NombreValorAgrupador, ValorNoviembre)
|
||||
|
||||
JNoviembre.Add(JValorNoviembre)
|
||||
|
||||
Dim ValorDiciembre = Dr("DiciembreEjercido").ToString.ToDecimal()
|
||||
Dim JValorDiciembre = New JProperty(NombreValorAgrupador, ValorDiciembre)
|
||||
|
||||
JDiciembre.Add(JValorDiciembre)
|
||||
Next
|
||||
|
||||
jsonData.Add(JEnero)
|
||||
jsonData.Add(JFebrero)
|
||||
jsonData.Add(JMarzo)
|
||||
jsonData.Add(JAbril)
|
||||
jsonData.Add(JMayo)
|
||||
jsonData.Add(JJunio)
|
||||
jsonData.Add(JJulio)
|
||||
jsonData.Add(JAgosto)
|
||||
jsonData.Add(JSeptiembre)
|
||||
jsonData.Add(JOctubre)
|
||||
jsonData.Add(JNoviembre)
|
||||
jsonData.Add(JDiciembre)
|
||||
|
||||
HdnJsonProyecto.Value = jsonData.ToString
|
||||
HdnJsonGraficos.Value = jsonGraphs.ToString
|
||||
|
||||
Else
|
||||
Dim DrPresupuesto = DtPresupuestos.FiltroPrimero("Tipo = 0 AND CveAgrupador IS NULL")
|
||||
|
||||
Dim Autorizado = DrPresupuesto("Autorizado").ToString.ToDecimal
|
||||
Dim Ejercido = DrPresupuesto("Ejercido").ToString.ToDecimal
|
||||
Dim PorEjercer = DrPresupuesto("PorEjercer").ToString.ToDecimal
|
||||
|
||||
Dim EjercidoPorcentaje = DrPresupuesto("EjercidoPorcentaje").ToString.ToDecimal
|
||||
Dim PorEjercerPorcentaje = DrPresupuesto("PorEjercerPorcentaje").ToString.ToDecimal
|
||||
|
||||
LtlAutorizado.Text = Autorizado.FormatoNumero
|
||||
LtlEjercido.Text = Ejercido.FormatoNumero
|
||||
LtlPorEjercer.Text = PorEjercer.FormatoNumero
|
||||
|
||||
PBEjercido.Style.Remove("width")
|
||||
PBEjercido.Style.Add("width", $"{EjercidoPorcentaje.ToString}%")
|
||||
|
||||
PBPorEjercer.Style.Remove("width")
|
||||
PBPorEjercer.Style.Add("width", $"{PorEjercerPorcentaje.ToString}%")
|
||||
|
||||
LtlPorcentajeEjercido.Text = EjercidoPorcentaje.FormatoNumero + " %"
|
||||
LtlPorcentajePorEjercer.Text = PorEjercerPorcentaje.FormatoNumero + " %"
|
||||
|
||||
Dim json = New JArray(
|
||||
From dr In DtDatos
|
||||
Select New JObject(
|
||||
New JProperty("Agrupador", dr("Agrupador").ToString()),
|
||||
New JProperty("Autorizado", dr("Autorizado").ToString().ToDecimal().FormatoNumero),
|
||||
New JProperty("Ejercido", dr("Ejercido").ToString().ToDecimal().FormatoNumero),
|
||||
New JProperty("PorEjercer", dr("PorEjercer").ToString().ToDecimal().FormatoNumero),
|
||||
New JProperty("AutorizadoProporcion", 100),
|
||||
New JProperty("EjercidoProporcion", dr("EjercidoPorcentaje").ToString().ToDecimal()),
|
||||
New JProperty("PorEjercerProporcion", dr("PorEjercerPorcentaje").ToString().ToDecimal()))
|
||||
)
|
||||
|
||||
HdnJsonProyecto.Value = json.ToString
|
||||
End If
|
||||
|
||||
|
||||
Else
|
||||
LtlAutorizado.Text = ""
|
||||
LtlEjercido.Text = ""
|
||||
LtlPorEjercer.Text = ""
|
||||
PBEjercido.Style.Remove("width")
|
||||
PBPorEjercer.Style.Remove("width")
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
Select Case e.Row.DBCampo("Tipo").ToEntero
|
||||
Case 0
|
||||
e.Row.CssClass = "Totales"
|
||||
Case 1
|
||||
e.Row.CssClass = "SubTotales"
|
||||
End Select
|
||||
If e.Row.DBCampo("Autorizado").ToDecimal = 0 Then
|
||||
e.Row.Cells(1).Text = "-"
|
||||
End If
|
||||
If e.Row.DBCampo("Ejercido").ToDecimal = 0 Then
|
||||
e.Row.Cells(2).Text = "-"
|
||||
End If
|
||||
If e.Row.DBCampo("EjercidoPorcentaje").ToDecimal = 0 Then
|
||||
e.Row.Cells(3).Text = "-"
|
||||
End If
|
||||
If e.Row.DBCampo("PorEjercer").ToDecimal = 0 Then
|
||||
e.Row.Cells(4).Text = "-"
|
||||
End If
|
||||
If e.Row.DBCampo("PorEjercerPorcentaje").ToDecimal = 0 Then
|
||||
e.Row.Cells(5).Text = "-"
|
||||
End If
|
||||
|
||||
If e.Row.RowIndex > 0 Then
|
||||
Dim CveAgrupador = e.Row.DBCampo("CveAgrupador").ToEntero
|
||||
Dim EsProyecto = False
|
||||
Dim FechaFin = e.Row.DBCampo("FechaFFiltro").ToDate.ToShortDateString
|
||||
Dim FechaInicio = e.Row.DBCampo("FechaIFiltro").ToDate.ToShortDateString
|
||||
If Not CveAgrupador > 0 Then
|
||||
If DdlAgrupador.SelectedValue.ToEntero = 2 Then
|
||||
CveAgrupador = e.Row.DBCampo("CveProyecto").ToEntero
|
||||
Else
|
||||
CveAgrupador = e.Row.DBCampo("CveClasificacion").ToEntero
|
||||
End If
|
||||
EsProyecto = True
|
||||
End If
|
||||
Dim Css = "Texto"
|
||||
Dim Liga = $"/Contratos/RepPresupuestosDetalle.aspx?&CveAgrupador={CveAgrupador}&CveClasificacion={e.Row.DBCampo("CveClasificacionFiltro")}&CveProyecto={e.Row.DBCampo("CveProyectoFiltro")}&CveSubProyecto={e.Row.DBCampo("CveSubProyectoFiltro")}&CveTipoGasto={e.Row.DBCampo("CveTipoGastoFiltro")}&Agrupador={e.Row.DBCampo("AgrupadorFiltro")}&Mensual={False}&EsProyecto={EsProyecto}&FechaFin={FechaFin}&FechaInicio={FechaInicio}"
|
||||
e.Row.Cells(0).Text = "<a class=" + "" + Css + "" + " href=" + "" + Liga + "" + ">" + e.Row.Cells(0).Text + "</a>"
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
Protected Sub ChkMensual_CheckedChanged(sender As Object, e As EventArgs) Handles ChkMensual.CheckedChanged
|
||||
|
||||
DivRepDatos.Visible = Not ChkMensual.Checked
|
||||
DivDatosMensual.Visible = ChkMensual.Checked
|
||||
|
||||
UpDatos.Update()
|
||||
UpDatosMensual.Update()
|
||||
End Sub
|
||||
Protected Sub GvDatosMensual_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
Select Case e.Row.DBCampo("Tipo").ToEntero
|
||||
Case 0
|
||||
e.Row.CssClass = "Totales"
|
||||
Case 1
|
||||
e.Row.CssClass = "SubTotales"
|
||||
End Select
|
||||
|
||||
If e.Row.DBCampo("EneroEjercido").ToDecimal = 0 Then
|
||||
e.Row.Cells(2).Text = "-"
|
||||
End If
|
||||
If e.Row.DBCampo("FebreroEjercido").ToDecimal = 0 Then
|
||||
e.Row.Cells(4).Text = "-"
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("MarzoEjercido").ToDecimal = 0 Then
|
||||
e.Row.Cells(6).Text = "-"
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("AbrilEjercido").ToDecimal = 0 Then
|
||||
e.Row.Cells(8).Text = "-"
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("MayoEjercido").ToDecimal = 0 Then
|
||||
e.Row.Cells(10).Text = "-"
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("JunioEjercido").ToDecimal = 0 Then
|
||||
e.Row.Cells(12).Text = "-"
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("JulioEjercido").ToDecimal = 0 Then
|
||||
e.Row.Cells(14).Text = "-"
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("AgostoEjercido").ToDecimal = 0 Then
|
||||
e.Row.Cells(16).Text = "-"
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("SeptiembreEjercido").ToDecimal = 0 Then
|
||||
e.Row.Cells(18).Text = "-"
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("OctubreEjercido").ToDecimal = 0 Then
|
||||
e.Row.Cells(20).Text = "-"
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("NoviembreEjercido").ToDecimal = 0 Then
|
||||
e.Row.Cells(22).Text = "-"
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("DiciembreEjercido").ToDecimal = 0 Then
|
||||
e.Row.Cells(24).Text = "-"
|
||||
End If
|
||||
|
||||
If e.Row.RowIndex > 0 Then
|
||||
If DdlAgrupador.SelectedValue.ToEntero = 2 Then
|
||||
If e.Row.DBCampo("CveAgrupador").ToEntero > 0 Or e.Row.DBCampo("CveProyecto").ToEntero > 0 Then
|
||||
Dim CveAgrupador = e.Row.DBCampo("CveAgrupador").ToEntero
|
||||
Dim EsProyecto = False
|
||||
If Not e.Row.DBCampo("CveAgrupador").ToEntero > 0 Then
|
||||
CveAgrupador = e.Row.DBCampo("CveProyecto").ToEntero
|
||||
EsProyecto = True
|
||||
End If
|
||||
Dim FechaFin = e.Row.DBCampo("FechaFFiltro").ToDate.ToShortDateString
|
||||
Dim FechaInicio = e.Row.DBCampo("FechaIFiltro").ToDate.ToShortDateString
|
||||
Dim Css = "Texto"
|
||||
Dim Liga = $"/Contratos/RepPresupuestosDetalle.aspx?&CveAgrupador={CveAgrupador}&CveClasificacion={e.Row.DBCampo("CveClasificacionFiltro")}&CveProyecto={e.Row.DBCampo("CveProyectoFiltro")}&CveSubProyecto={e.Row.DBCampo("CveSubProyectoFiltro")}&CveTipoGasto={e.Row.DBCampo("CveTipoGastoFiltro")}&Agrupador={e.Row.DBCampo("AgrupadorFiltro")}&Mensual={True}&EsProyecto={EsProyecto}&FechaFin={FechaFin}&FechaInicio={FechaInicio}"
|
||||
e.Row.Cells(0).Text = "<a class=" + "" + Css + "" + " href=" + "" + Liga + "" + ">" + e.Row.Cells(0).Text + "</a>"
|
||||
End If
|
||||
Else
|
||||
If e.Row.DBCampo("CveAgrupador").ToEntero > 0 Then
|
||||
Dim CveAgrupador = e.Row.DBCampo("CveAgrupador").ToEntero
|
||||
Dim EsProyecto = False
|
||||
If Not e.Row.DBCampo("CveAgrupador").ToEntero > 0 Then
|
||||
CveAgrupador = e.Row.DBCampo("CveProyecto").ToEntero
|
||||
EsProyecto = True
|
||||
End If
|
||||
Dim FechaFin = e.Row.DBCampo("FechaFFiltro").ToDate.ToShortDateString
|
||||
Dim FechaInicio = e.Row.DBCampo("FechaIFiltro").ToDate.ToShortDateString
|
||||
Dim Css = "Texto"
|
||||
Dim Liga = $"/Contratos/RepPresupuestosDetalle.aspx?&CveAgrupador={CveAgrupador}&CveClasificacion={e.Row.DBCampo("CveClasificacionFiltro")}&CveProyecto={e.Row.DBCampo("CveProyectoFiltro")}&CveSubProyecto={e.Row.DBCampo("CveSubProyectoFiltro")}&CveTipoGasto={e.Row.DBCampo("CveTipoGastoFiltro")}&Agrupador={e.Row.DBCampo("AgrupadorFiltro")}&Mensual={True}&EsProyecto={EsProyecto}&FechaFin={FechaFin}&FechaInicio={FechaInicio}"
|
||||
e.Row.Cells(0).Text = "<a class=" + "" + Css + "" + " href=" + "" + Liga + "" + ">" + e.Row.Cells(0).Text + "</a>"
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
CargaSubProyecto()
|
||||
End Sub
|
||||
|
||||
#Region " IMPRESION - NUEVO "
|
||||
Protected Sub ImgExcel_Click(sender As Object, e As System.EventArgs) Handles ImgExcel.Click
|
||||
GenerarPDF("EXCEL")
|
||||
End Sub
|
||||
|
||||
Private Sub ImgImprimir_Click(sender As Object, e As EventArgs) Handles ImgImprimir.Click
|
||||
GenerarPDF()
|
||||
End Sub
|
||||
|
||||
Private Sub GenerarPDF(Optional Formato As String = "PDF")
|
||||
Dim Agrupador = If(DdlAgrupador.SelectedValue = "-1", "", $" <b>Agrupador:</b> {DdlAgrupador.SelectedItem.Text}")
|
||||
Dim Proyecto = If(DdlProyecto.SelectedValue = "-1", "", $" <b>Proyecto:</b> {DdlProyecto.SelectedItem.Text}")
|
||||
Dim SubProyecto = If(DdlSubProyecto.SelectedValue = "-1", "", $" <b>SubProyecto:</b> {DdlSubProyecto.SelectedItem.Text}")
|
||||
Dim Clasificacion = If(DdlClasificacion.SelectedValue = "-1", "", $" <b>Clasificación:</b> {DdlClasificacion.SelectedItem.Text}")
|
||||
Dim TipoGasto = If(DdlTipoGasto.SelectedValue = "-1", "", $" <b>Tipo Gasto:</b> {DdlTipoGasto.SelectedItem.Text}")
|
||||
Dim FechaIn As String = $" <b>Fecha Inicio:</b> {TxtFiltrosFechaInicio.Text}"
|
||||
Dim FechaFn As String = $" <b>Fecha Fin:</b> {TxtFiltrosFechaFin.Text}"
|
||||
If TxtFiltrosFechaInicio.Text = "" Then FechaIn = ""
|
||||
If TxtFiltrosFechaFin.Text = "" Then FechaFn = ""
|
||||
|
||||
If DtPresupuestos.Rows.Count > 0 Then
|
||||
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("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
params.Add(New ReportParameter("AgrupadoPor", $"{FechaIn}{FechaFn}{Agrupador}{Proyecto}{SubProyecto}{Clasificacion}{TipoGasto}"))
|
||||
params.Add(New ReportParameter("Autorizado", LtlAutorizado.Text.FormatoNumero()))
|
||||
params.Add(New ReportParameter("Ejercido", LtlEjercido.Text.FormatoNumero()))
|
||||
params.Add(New ReportParameter("PorEjercer", LtlPorEjercer.Text.FormatoNumero()))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepPresupuestoAnual.rdlc", DtPresupuestos, params, "Reporte de Presupuestos Anual", Formato)
|
||||
Else
|
||||
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
368
Contratos/RepPresupuestosDetalle.aspx
Normal file
368
Contratos/RepPresupuestosDetalle.aspx
Normal file
@@ -0,0 +1,368 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepPresupuestosDetalle.aspx.vb" Inherits="Contratos_RepPresupuestosDetalle" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
.dataTables_scrollHead {
|
||||
background-color: #95A5A6;
|
||||
color: white;
|
||||
}
|
||||
|
||||
@import url(https://fonts.googleapis.com/css?family=Droid+Sans:400,700|Droid+Serif:400,700);
|
||||
|
||||
#chartProyectos {
|
||||
height: 800px;
|
||||
width: 800px;
|
||||
}
|
||||
|
||||
.amcharts-chart-div a {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.contenedor {
|
||||
margin: 0 auto;
|
||||
text-align: left;
|
||||
color: #989A8F;
|
||||
width: 450px;
|
||||
height: 200px;
|
||||
}
|
||||
|
||||
.calificador {
|
||||
height: 270px;
|
||||
width: 75%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.toplistaVerde {
|
||||
background-color: #1BA39C;
|
||||
height: 33%;
|
||||
width: 300px;
|
||||
padding-top: 17%;
|
||||
}
|
||||
|
||||
.toplistaAmarillo {
|
||||
background-color: #c29d0b;
|
||||
height: 33%;
|
||||
width: 300px;
|
||||
padding-top: 17%;
|
||||
}
|
||||
|
||||
.toplistaRojo {
|
||||
background-color: #E43A45;
|
||||
height: 33%;
|
||||
width: 300px;
|
||||
padding-top: 17%;
|
||||
}
|
||||
|
||||
.toplistaAzul {
|
||||
background-color: #337ab7;
|
||||
height: 33%;
|
||||
width: 300px;
|
||||
padding-top: 17%;
|
||||
}
|
||||
|
||||
.bottomlista {
|
||||
margin-top: 25%;
|
||||
}
|
||||
|
||||
|
||||
.circuloVerde {
|
||||
width: 40%;
|
||||
height: 400%;
|
||||
border: 4px solid;
|
||||
border-radius: 50% !important;
|
||||
border-color: #1BA39C;
|
||||
font-size: 30px;
|
||||
color: #fff;
|
||||
line-height: 405%;
|
||||
text-align: center;
|
||||
background-color: #FFFFFF;
|
||||
margin-left: 30%;
|
||||
margin-top: -10%;
|
||||
}
|
||||
|
||||
.verde {
|
||||
color: #1BA39C;
|
||||
}
|
||||
|
||||
.circuloAmarillo {
|
||||
width: 40%;
|
||||
height: 400%;
|
||||
border: 4px solid;
|
||||
border-radius: 50% !important;
|
||||
border-color: #c29d0b;
|
||||
font-size: 30px;
|
||||
color: #fff;
|
||||
line-height: 405%;
|
||||
text-align: center;
|
||||
background-color: #FFFFFF;
|
||||
margin-left: 30%;
|
||||
margin-top: -10%;
|
||||
}
|
||||
|
||||
.amarillo {
|
||||
color: #c29d0b;
|
||||
}
|
||||
|
||||
.circuloRojo {
|
||||
width: 40%;
|
||||
height: 400%;
|
||||
border: 4px solid;
|
||||
border-radius: 50% !important;
|
||||
border-color: #E43A45;
|
||||
font-size: 30px;
|
||||
color: #fff;
|
||||
line-height: 405%;
|
||||
text-align: center;
|
||||
background-color: #FFFFFF;
|
||||
margin-left: 30%;
|
||||
margin-top: -10%;
|
||||
}
|
||||
|
||||
.rojo {
|
||||
color: #E43A45;
|
||||
}
|
||||
|
||||
.circuloAzul {
|
||||
width: 40%;
|
||||
height: 400%;
|
||||
border: 4px solid;
|
||||
border-radius: 50% !important;
|
||||
border-color: #337ab7;
|
||||
font-size: 30px;
|
||||
color: #fff;
|
||||
line-height: 405%;
|
||||
text-align: center;
|
||||
background-color: #FFFFFF;
|
||||
margin-left: 30%;
|
||||
margin-top: -10%;
|
||||
}
|
||||
|
||||
.azul {
|
||||
color: #337ab7;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte Detallado de Presupuestos
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:LinkButton ID="ImgImprimir" runat="server"> <i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="ImgExcel" runat="server"><i class="fa fa-ad-excel"></i> Generar Excel</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" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultarFiltros" OnClick="BtnConsultarFiltros_Click" runat="server" Text="Consultar" ValidationGroup="GrpFiltros" class="btn btn-primary" />
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption ">
|
||||
<div class="row">
|
||||
<div class="col-md-1" style="max-width: 90px">Fecha Inicio:</div>
|
||||
<div class="col-md-2" style="max-width: 130px">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 90px !important; padding: 0px;">
|
||||
<asp:TextBox ID="TxtFiltrosFechaInicio" CssClass="form-control input-sm ADSMaskDate" Style="width: 88px" runat="server"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="LnkFechaI" class="btn default " Text=" <i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEEFiltrosFechaInicio" runat="server" TargetControlID="TxtFiltrosFechaInicio" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CEFiltrosFechaInicio" TargetControlID="TxtFiltrosFechaInicio" PopupButtonID="LnkFechaI" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVFiltrosFechaInicio" runat="server" ControlToValidate="TxtFiltrosFechaInicio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpFiltros"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEFiltrosFechaInicio" runat="server" HighlightCssClass="vco" TargetControlID="RFVFiltrosFechaInicio"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1" style="max-width: 75px">Fecha Fin:</div>
|
||||
<div class="col-md-2" style="max-width: 130px">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 90px !important; padding: 0px;">
|
||||
<asp:TextBox ID="TxtFiltrosFechaFin" CssClass="form-control input-sm ADSMaskDate" Style="width: 88px" runat="server"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="LnkFechaF" class="btn default " Text=" <i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEEFiltrosFechaFin" runat="server" TargetControlID="TxtFiltrosFechaFin" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CEFiltrosFechaFin" TargetControlID="TxtFiltrosFechaFin" PopupButtonID="LnkFechaF" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVFiltrosFechaFin" runat="server" ControlToValidate="TxtFiltrosFechaFin" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpFiltros"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEFiltrosFechaFin" runat="server" HighlightCssClass="vco" TargetControlID="RFVFiltrosFechaFin"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1" style="max-width: 80px">Agrupador:</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlAgrupador" Width="150px" runat="server" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Text="Clasificacion" Value="1" />
|
||||
<asp:ListItem Text="Centro de Costo" Value="2" Selected="True" />
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1" style="max-width: 80px">Mensual:</div>
|
||||
<div class="col-md-2">
|
||||
<asp:CheckBox ID="ChkMensual" runat="server" CssClass="md-checksd2" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none;" id="idnecesaria2">
|
||||
<div class="row">
|
||||
<div class="col-md-1" style="max-width: 120px">Proyecto:</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlProyecto" DataTextField="Proyecto" AppendDataBoundItems="true" DataValueField="CveProyecto" AutoPostBack="true" OnSelectedIndexChanged="DdlProyecto_SelectedIndexChanged" Width="200px" runat="server" CssClass="form-control input-sm select2me">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1" style="max-width: 120px">SubProyecto:</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlSubProyecto" DataTextField="SubProyecto" AppendDataBoundItems="true" DataValueField="CveSubProyecto" Width="200px" runat="server" CssClass="form-control input-sm select2me">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1" style="max-width: 120px">Clasificacion:</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlClasificacion" DataTextField="Clasificacion" AppendDataBoundItems="true" DataValueField="CveClasificacion" Width="200px" runat="server" CssClass="form-control input-sm select2me">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1" style="max-width: 120px">Tipo Gasto:</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlTipoGasto" Width="200px" DataTextField="TipoGasto" DataValueField="CveTipoGasto" AppendDataBoundItems="true" runat="server" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Text="Todos" Value="-1" Selected="True" />
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div id="DivRepDatos" runat="server" visible="false">
|
||||
<table class="table Widthall ">
|
||||
<tr>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 20%; border-right: 3px solid white;">Agrupador</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 20%; border-right: 3px solid white;">Autorizado</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 30%; border-right: 3px solid white;">Ejercido</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 30%; border-right: 3px solid white;">Por Ejercer</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="Sin resultados" ShowHeaderWhenEmpty="true" CssClass="table table-striped table-hover Widthall ScrollAD" GridLines="None" data-sort="true">
|
||||
<Columns>
|
||||
<%--<asp:HyperLinkField HeaderText="Descripcion" DataTextField="Agrupador" ItemStyle-Width="20%"--%>
|
||||
<asp:BoundField HeaderText="Descripcion" DataField="Agrupador" ItemStyle-Width="20%" />
|
||||
<asp:BoundField HeaderText="Importe" DataField="Autorizado" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="20%" />
|
||||
<asp:BoundField HeaderText="Importe" DataField="Ejercido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="20%" />
|
||||
<asp:BoundField HeaderText="%" DataField="EjercidoPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" />
|
||||
<asp:BoundField HeaderText="Importe" DataField="PorEjercer" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="20%" />
|
||||
<asp:BoundField HeaderText="%" DataField="PorEjercerPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UpDatosMensual" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div id="DivDatosMensual" runat="server" visible="false" style="overflow-x: auto; overflow-y: auto">
|
||||
<table class="table" style="overflow-x: auto">
|
||||
<tr>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; min-width: 200px; border-right: 3px solid white;">Agrupador</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; min-width: 120px; border-right: 3px solid white;">Autorizado</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; min-width: 140px; border-right: 3px solid white;">Enero</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; min-width: 140px; border-right: 3px solid white;">Febrero</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; min-width: 140px; border-right: 3px solid white;">Marzo</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; min-width: 140px; border-right: 3px solid white;">Abril</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; min-width: 140px; border-right: 3px solid white;">Mayo</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; min-width: 140px; border-right: 3px solid white;">Junio</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; min-width: 140px; border-right: 3px solid white;">Julio</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; min-width: 140px; border-right: 3px solid white;">Agosto</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; min-width: 140px; border-right: 3px solid white;">Septiembre</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; min-width: 140px; border-right: 3px solid white;">Octubre</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; min-width: 140px; border-right: 3px solid white;">Noviembre</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; min-width: 140px; border-right: 3px solid white;">Diciembre</td>
|
||||
</tr>
|
||||
</table>
|
||||
<asp:GridView ID="GvDatosMensual" OnRowDataBound="GvDatosMensual_RowDataBound" runat="server" AutoGenerateColumns="False" Style="min-width: 2000px; overflow-y: hidden" Width="2000px" EmptyDataText="Sin resultados" ShowHeaderWhenEmpty="true" CssClass="table table-striped table-hover" GridLines="None" data-sort="true">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Descripcion" DataField="Agrupador" ItemStyle-Width="200px" />
|
||||
<asp:BoundField HeaderText="Importe" DataField="Autorizado" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="120px" />
|
||||
|
||||
<asp:BoundField HeaderText="Ejercido" DataField="EneroEjercido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
|
||||
<asp:BoundField HeaderText="%" DataField="EneroEjercidoPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="40px" />
|
||||
<%-- <asp:BoundField HeaderText="Por Ejercer" DataField="EneroPorEjercer" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="130px" />
|
||||
<asp:BoundField HeaderText="%" DataField="EneroPorEjercerPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="60px" />--%>
|
||||
|
||||
<asp:BoundField HeaderText="Ejercido" DataField="FebreroEjercido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
|
||||
<asp:BoundField HeaderText="%" DataField="FebreroEjercidoPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="40px" />
|
||||
<%-- <asp:BoundField HeaderText="Por Ejercer" DataField="FebreroPorEjercer" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="130px" />
|
||||
<asp:BoundField HeaderText="%" DataField="FebreroPorEjercerPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="60px" />--%>
|
||||
|
||||
<asp:BoundField HeaderText="Ejercido" DataField="MarzoEjercido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
|
||||
<asp:BoundField HeaderText="%" DataField="MarzoEjercidoPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="40px" />
|
||||
<%-- <asp:BoundField HeaderText="Por Ejercer" DataField="MarzoPorEjercer" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="130px" />
|
||||
<asp:BoundField HeaderText="%" DataField="MarzoPorEjercerPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="60px" />--%>
|
||||
|
||||
<asp:BoundField HeaderText="Ejercido" DataField="AbrilEjercido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
|
||||
<asp:BoundField HeaderText="%" DataField="AbrilEjercidoPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="40px" />
|
||||
<%--<asp:BoundField HeaderText="Por Ejercer" DataField="DiciembrePorEjercer" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="130px" />
|
||||
<asp:BoundField HeaderText="%" DataField="DiciembrePorEjercerPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="60px" />--%>
|
||||
|
||||
<asp:BoundField HeaderText="Ejercido" DataField="MayoEjercido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
|
||||
<asp:BoundField HeaderText="%" DataField="MayoEjercidoPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="40px" />
|
||||
<%-- <asp:BoundField HeaderText="Por Ejercer" DataField="MayoPorEjercer" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="130px" />
|
||||
<asp:BoundField HeaderText="%" DataField="MayoPorEjercerPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="60px" />--%>
|
||||
|
||||
<asp:BoundField HeaderText="Ejercido" DataField="JunioEjercido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
|
||||
<asp:BoundField HeaderText="%" DataField="JunioEjercidoPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="40px" />
|
||||
<%-- <asp:BoundField HeaderText="Por Ejercer" DataField="JunioPorEjercer" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="130px" />
|
||||
<asp:BoundField HeaderText="%" DataField="JunioPorEjercerPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="60px" />--%>
|
||||
|
||||
<asp:BoundField HeaderText="Ejercido" DataField="JulioEjercido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
|
||||
<asp:BoundField HeaderText="%" DataField="JulioEjercidoPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="40px" />
|
||||
<%--<asp:BoundField HeaderText="Por Ejercer" DataField="JulioPorEjercer" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="130px" />
|
||||
<asp:BoundField HeaderText="%" DataField="JulioPorEjercerPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="60px" />--%>
|
||||
|
||||
<asp:BoundField HeaderText="Ejercido" DataField="AgostoEjercido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
|
||||
<asp:BoundField HeaderText="%" DataField="AgostoEjercidoPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="40px" />
|
||||
<%--<asp:BoundField HeaderText="Por Ejercer" DataField="AgostoPorEjercer" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="130px" />
|
||||
<asp:BoundField HeaderText="%" DataField="AgostoPorEjercerPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="60px" />--%>
|
||||
|
||||
<asp:BoundField HeaderText="Ejercido" DataField="SeptiembreEjercido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
|
||||
<asp:BoundField HeaderText="%" DataField="SeptiembreEjercidoPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="40px" />
|
||||
<%--<asp:BoundField HeaderText="Por Ejercer" DataField="SeptiembrePorEjercer" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="130px" />
|
||||
<asp:BoundField HeaderText="%" DataField="SeptiembrePorEjercerPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="60px" />--%>
|
||||
|
||||
<asp:BoundField HeaderText="Ejercido" DataField="OctubreEjercido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
|
||||
<asp:BoundField HeaderText="%" DataField="OctubreEjercidoPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="40px" />
|
||||
<%-- <asp:BoundField HeaderText="Por Ejercer" DataField="OctubrePorEjercer" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="130px" />
|
||||
<asp:BoundField HeaderText="%" DataField="OctubrePorEjercerPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="60px" />--%>
|
||||
|
||||
<asp:BoundField HeaderText="Ejercido" DataField="NoviembreEjercido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
|
||||
<asp:BoundField HeaderText="%" DataField="NoviembreEjercidoPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="40px" />
|
||||
<%-- <asp:BoundField HeaderText="Por Ejercer" DataField="NoviembrePorEjercer" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="130px" />
|
||||
<asp:BoundField HeaderText="%" DataField="NoviembrePorEjercerPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="60px" />--%>
|
||||
|
||||
<asp:BoundField HeaderText="Ejercido" DataField="DiciembreEjercido" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" />
|
||||
<asp:BoundField HeaderText="%" DataField="DiciembreEjercidoPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="40px" />
|
||||
<%--<asp:BoundField HeaderText="Por Ejercer" DataField="DiciembrePorEjercer" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="130px" />
|
||||
<asp:BoundField HeaderText="%" DataField="DiciembrePorEjercerPorcentaje" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="60px" />--%>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
313
Contratos/RepPresupuestosDetalle.aspx.vb
Normal file
313
Contratos/RepPresupuestosDetalle.aspx.vb
Normal file
@@ -0,0 +1,313 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class Contratos_RepPresupuestosDetalle
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "P R O P I E D A D E S"
|
||||
|
||||
Public Property Gpo() As Integer
|
||||
Get
|
||||
Return DirectCast(ViewState("Gpo"), Integer)
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
ViewState("Gpo") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property DtPresupuestos() As DataTable
|
||||
Get
|
||||
Return DirectCast(ViewState("DtPresupuestos"), DataTable)
|
||||
End Get
|
||||
Set(ByVal value As DataTable)
|
||||
ViewState("DtPresupuestos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
|
||||
InicializaValores()
|
||||
CargaUrlParametros()
|
||||
CargaDatos()
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region " INICIALIZA VALORES "
|
||||
Private Sub InicializaValores()
|
||||
|
||||
TxtFiltrosFechaInicio.Text = $"01/09/{Now.Year - 1}"
|
||||
TxtFiltrosFechaFin.Text = $"31/08/{Now.Year}"
|
||||
|
||||
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
|
||||
DdlClasificacion.Items.Insert(0, New ListItem("Todas", "-1"))
|
||||
DdlClasificacion.DataBind()
|
||||
|
||||
DdlTipoGasto.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa)
|
||||
DdlTipoGasto.DataBind()
|
||||
|
||||
DdlProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1).FiltraParametros("", "", {"CveProyecto", "Proyecto"}), GlobalDTProyectos(UsuarioActual.CveEmpresa, -1).FiltraParametros("", "", {"CveProyecto", "Proyecto"}))
|
||||
DdlProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlProyecto.DataBind()
|
||||
|
||||
CargaSubProyecto()
|
||||
|
||||
UpFiltros.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaSubProyecto()
|
||||
DdlSubProyecto.Items.Clear()
|
||||
If DdlProyecto.SelectedValue.ToEntero > 0 Or UsuarioActual.Empresa.Tipo_CentroCosto = 1 Then
|
||||
DdlSubProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, DdlProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa, 1))
|
||||
End If
|
||||
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlSubProyecto.DataBind()
|
||||
End Sub
|
||||
Private Sub CargaUrlParametros()
|
||||
Dim CveClasificacion = IfNull(Request("CveClasificacion"), -1).ToString.ToEntero
|
||||
Dim FechaInicio = IfNull(Request("FechaInicio"), $"01/09/{Now.Year}").ToString
|
||||
Dim FechaFin = IfNull(Request("FechaFin"), $"31/08/{Now.Year + 1}").ToString
|
||||
Dim CveProyecto = IfNull(Request("CveProyecto"), -1).ToString.ToEntero
|
||||
Dim CveSubProyecto = IfNull(Request("CveSubProyecto"), -1).ToString.ToEntero
|
||||
Dim CveTipoGasto = IfNull(Request("CveTipoGasto"), -1).ToString.ToEntero
|
||||
Dim Agrupador = IfNull(Request("Agrupador"), -1).ToString.ToEntero
|
||||
Gpo = IfNull(Request("CveAgrupador"), -1).ToString.ToEntero
|
||||
Dim Mensual = CBool(IfNull(Request("Mensual"), False))
|
||||
Dim EsProyecto = CBool(IfNull(Request("EsProyecto"), False))
|
||||
If Agrupador = 1 Then Agrupador = 2 Else Agrupador = 1
|
||||
DdlAgrupador.SelectedValueExist(Agrupador)
|
||||
DdlClasificacion.SelectedValueExist(CveClasificacion)
|
||||
If DdlAgrupador.SelectedValue.ToEntero = 2 Then
|
||||
DdlClasificacion.SelectedValueExist(Gpo)
|
||||
DdlProyecto.SelectedValueExist(CveProyecto)
|
||||
DdlSubProyecto.SelectedValueExist(CveSubProyecto)
|
||||
ElseIf DdlAgrupador.SelectedValue.ToEntero = 1 Then
|
||||
If Not EsProyecto Then
|
||||
Dim Dr As DataRow = GlobalDTSubProyectos(-1, Gpo)(0)
|
||||
DdlProyecto.SelectedValueExist(Dr("CveProyecto"))
|
||||
CargaSubProyecto()
|
||||
DdlSubProyecto.SelectedValueExist(Gpo)
|
||||
Else
|
||||
DdlProyecto.SelectedValueExist(Gpo)
|
||||
DdlSubProyecto.SelectedValueExist(CveSubProyecto)
|
||||
End If
|
||||
End If
|
||||
DdlTipoGasto.SelectedValueExist(CveTipoGasto)
|
||||
TxtFiltrosFechaInicio.Text = FechaInicio
|
||||
TxtFiltrosFechaFin.Text = FechaFin
|
||||
ChkMensual.Checked = Mensual
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " CARGA DATOS "
|
||||
Protected Sub BtnConsultarFiltros_Click(sender As Object, e As EventArgs)
|
||||
CargaDatos()
|
||||
End Sub
|
||||
Private Sub CargaDatos()
|
||||
If ChkMensual.Checked Then
|
||||
Dim ObjPresupuestos As New ClsContratos
|
||||
If ObjPresupuestos.GetPresupuestosMensualRep(-1, DdlTipoGasto.SelectedValue.ToEntero, DdlAgrupador.SelectedValue.ToEntero, TxtFiltrosFechaInicio.Text.ToDate, TxtFiltrosFechaFin.Text.ToDate, UsuarioActual.CveEmpresa, DdlProyecto.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveUsuario, DdlClasificacion.SelectedValue.ToEntero) Then
|
||||
GvDatosMensual.DataSource = ObjPresupuestos.DtResultados
|
||||
DtPresupuestos = ObjPresupuestos.DtResultados
|
||||
End If
|
||||
ObjPresupuestos.Dispose()
|
||||
DivDatosMensual.Visible = True
|
||||
DivRepDatos.Visible = False
|
||||
GvDatosMensual.DataBind()
|
||||
Else
|
||||
Dim ObjPresupuestos As New ClsContratos
|
||||
If ObjPresupuestos.GetPresupuestosRep(-1, DdlTipoGasto.SelectedValue.ToEntero, DdlAgrupador.SelectedValue.ToEntero, TxtFiltrosFechaInicio.Text.ToDate, TxtFiltrosFechaFin.Text.ToDate, UsuarioActual.CveEmpresa, DdlProyecto.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveUsuario, DdlClasificacion.SelectedValue.ToEntero) Then
|
||||
GvDatos.DataSource = ObjPresupuestos.DtResultados
|
||||
DtPresupuestos = ObjPresupuestos.DtResultados
|
||||
End If
|
||||
ObjPresupuestos.Dispose()
|
||||
DivDatosMensual.Visible = False
|
||||
DivRepDatos.Visible = True
|
||||
GvDatos.DataBind()
|
||||
End If
|
||||
UpDatos.Update()
|
||||
UpDatosMensual.Update()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
Select Case e.Row.DBCampo("Tipo").ToEntero
|
||||
Case 0
|
||||
e.Row.CssClass = "Totales"
|
||||
Case 1
|
||||
e.Row.CssClass = "SubTotales"
|
||||
End Select
|
||||
If e.Row.DBCampo("Autorizado").ToDecimal = 0 Then
|
||||
e.Row.Cells(1).Text = "-"
|
||||
End If
|
||||
If e.Row.DBCampo("Ejercido").ToDecimal = 0 Then
|
||||
e.Row.Cells(2).Text = "-"
|
||||
End If
|
||||
If e.Row.DBCampo("EjercidoPorcentaje").ToDecimal = 0 Then
|
||||
e.Row.Cells(3).Text = "-"
|
||||
End If
|
||||
If e.Row.DBCampo("PorEjercer").ToDecimal = 0 Then
|
||||
e.Row.Cells(4).Text = "-"
|
||||
End If
|
||||
If e.Row.DBCampo("PorEjercerPorcentaje").ToDecimal = 0 Then
|
||||
e.Row.Cells(5).Text = "-"
|
||||
End If
|
||||
If e.Row.RowIndex > 0 Then
|
||||
Dim CveAgrupador = e.Row.DBCampo("CveAgrupador").ToEntero
|
||||
Dim EsProyecto = False
|
||||
Dim FechaFin = e.Row.DBCampo("FechaFFiltro").ToDate.ToShortDateString
|
||||
Dim FechaInicio = e.Row.DBCampo("FechaIFiltro").ToDate.ToShortDateString
|
||||
If Not CveAgrupador > 0 Then
|
||||
If DdlAgrupador.SelectedValue.ToEntero = 2 Then
|
||||
CveAgrupador = e.Row.DBCampo("CveProyecto").ToEntero
|
||||
Else
|
||||
CveAgrupador = e.Row.DBCampo("CveClasificacion").ToEntero
|
||||
End If
|
||||
EsProyecto = True
|
||||
End If
|
||||
Dim Css = "Texto"
|
||||
Dim Liga = $"/Contratos/RepPresupuestosDetalleCompras.aspx?&CveAgrupador={CveAgrupador}&CveClasificacion={e.Row.DBCampo("CveClasificacionFiltro")}&CveProyecto={e.Row.DBCampo("CveProyectoFiltro")}&CveSubProyecto={e.Row.DBCampo("CveSubProyectoFiltro")}&CveTipoGasto={e.Row.DBCampo("CveTipoGastoFiltro")}&Agrupador={e.Row.DBCampo("AgrupadorFiltro")}&Mensual={False}&EsProyecto={EsProyecto}&FechaFin={FechaFin}&FechaInicio={FechaInicio}"
|
||||
e.Row.Cells(0).Text = "<a class=" + "" + Css + "" + " href=" + "" + Liga + "" + ">" + e.Row.Cells(0).Text + "</a>"
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatosMensual_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
Select Case e.Row.DBCampo("Tipo").ToEntero
|
||||
Case 0
|
||||
e.Row.CssClass = "Totales"
|
||||
Case 1
|
||||
e.Row.CssClass = "SubTotales"
|
||||
End Select
|
||||
|
||||
If e.Row.DBCampo("EneroEjercido").ToDecimal = 0 Then
|
||||
e.Row.Cells(2).Text = "-"
|
||||
End If
|
||||
If e.Row.DBCampo("FebreroEjercido").ToDecimal = 0 Then
|
||||
e.Row.Cells(4).Text = "-"
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("MarzoEjercido").ToDecimal = 0 Then
|
||||
e.Row.Cells(6).Text = "-"
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("AbrilEjercido").ToDecimal = 0 Then
|
||||
e.Row.Cells(8).Text = "-"
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("MayoEjercido").ToDecimal = 0 Then
|
||||
e.Row.Cells(10).Text = "-"
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("JunioEjercido").ToDecimal = 0 Then
|
||||
e.Row.Cells(12).Text = "-"
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("JulioEjercido").ToDecimal = 0 Then
|
||||
e.Row.Cells(14).Text = "-"
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("AgostoEjercido").ToDecimal = 0 Then
|
||||
e.Row.Cells(16).Text = "-"
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("SeptiembreEjercido").ToDecimal = 0 Then
|
||||
e.Row.Cells(18).Text = "-"
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("OctubreEjercido").ToDecimal = 0 Then
|
||||
e.Row.Cells(20).Text = "-"
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("NoviembreEjercido").ToDecimal = 0 Then
|
||||
e.Row.Cells(22).Text = "-"
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("DiciembreEjercido").ToDecimal = 0 Then
|
||||
e.Row.Cells(24).Text = "-"
|
||||
End If
|
||||
|
||||
If e.Row.RowIndex > 0 Then
|
||||
Dim CveAgrupador = e.Row.DBCampo("CveAgrupador").ToEntero
|
||||
Dim EsProyecto = False
|
||||
Dim FechaFin = e.Row.DBCampo("FechaFFiltro").ToDate.ToShortDateString
|
||||
Dim FechaInicio = e.Row.DBCampo("FechaIFiltro").ToDate.ToShortDateString
|
||||
If Not CveAgrupador > 0 Then
|
||||
If DdlAgrupador.SelectedValue.ToEntero = 2 Then
|
||||
CveAgrupador = e.Row.DBCampo("CveProyecto").ToEntero
|
||||
Else
|
||||
CveAgrupador = e.Row.DBCampo("CveClasificacion").ToEntero
|
||||
End If
|
||||
EsProyecto = True
|
||||
End If
|
||||
Dim Css = "Texto"
|
||||
Dim Liga = $"/Contratos/RepPresupuestosDetalleCompras.aspx?&CveAgrupador={CveAgrupador}&CveClasificacion={e.Row.DBCampo("CveClasificacionFiltro")}&CveProyecto={e.Row.DBCampo("CveProyectoFiltro")}&CveSubProyecto={e.Row.DBCampo("CveSubProyectoFiltro")}&CveTipoGasto={e.Row.DBCampo("CveTipoGastoFiltro")}&Agrupador={e.Row.DBCampo("AgrupadorFiltro")}&Mensual={False}&EsProyecto={EsProyecto}&FechaFin={FechaFin}&FechaInicio={FechaInicio}"
|
||||
e.Row.Cells(0).Text = "<a class=" + "" + Css + "" + " href=" + "" + Liga + "" + ">" + e.Row.Cells(0).Text + "</a>"
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
CargaSubProyecto()
|
||||
End Sub
|
||||
|
||||
#Region " IMPRESION - NUEVO "
|
||||
Protected Sub ImgExcel_Click(sender As Object, e As System.EventArgs) Handles ImgExcel.Click
|
||||
GenerarPDF("EXCEL")
|
||||
End Sub
|
||||
|
||||
Private Sub ImgImprimir_Click(sender As Object, e As EventArgs) Handles ImgImprimir.Click
|
||||
GenerarPDF()
|
||||
End Sub
|
||||
|
||||
Private Sub GenerarPDF(Optional Formato As String = "PDF")
|
||||
Dim Agrupador = If(DdlAgrupador.SelectedValue = "-1", "", $" <b>Agrupador:</b> {DdlAgrupador.SelectedItem.Text}")
|
||||
Dim Proyecto = If(DdlProyecto.SelectedValue = "-1", "", $" <b>Proyecto:</b> {DdlProyecto.SelectedItem.Text}")
|
||||
Dim SubProyecto = If(DdlSubProyecto.SelectedValue = "-1", "", $" <b>SubProyecto:</b> {DdlSubProyecto.SelectedItem.Text}")
|
||||
Dim Clasificacion = If(DdlClasificacion.SelectedValue = "-1", "", $" <b>Clasificación:</b> {DdlClasificacion.SelectedItem.Text}")
|
||||
Dim TipoGasto = If(DdlTipoGasto.SelectedValue = "-1", "", $" <b>Tipo Gasto:</b> {DdlTipoGasto.SelectedItem.Text}")
|
||||
Dim FechaIn As String = $" <b>Fecha Inicio:</b> {TxtFiltrosFechaInicio.Text}"
|
||||
Dim FechaFn As String = $" <b>Fecha Fin:</b> {TxtFiltrosFechaFin.Text}"
|
||||
If TxtFiltrosFechaInicio.Text = "" Then FechaIn = ""
|
||||
If TxtFiltrosFechaFin.Text = "" Then FechaFn = ""
|
||||
|
||||
If DtPresupuestos.Rows.Count > 0 Then
|
||||
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("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
params.Add(New ReportParameter("AgrupadoPor", $"{FechaIn}{FechaFn}{Agrupador}{Proyecto}{SubProyecto}{Clasificacion}{TipoGasto}"))
|
||||
params.Add(New ReportParameter("Autorizado", DtPresupuestos.Rows(0)("Autorizado").ToString.FormatoNumero()))
|
||||
params.Add(New ReportParameter("Ejercido", DtPresupuestos.Rows(0)("Ejercido").ToString.FormatoNumero()))
|
||||
params.Add(New ReportParameter("PorEjercer", DtPresupuestos.Rows(0)("PorEjercer").ToString.FormatoNumero()))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepPresupuestoAnual.rdlc", DtPresupuestos, params, "Reporte de Presupuestos Anual", Formato)
|
||||
Else
|
||||
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
260
Contratos/RepPresupuestosDetalleCompras.aspx
Normal file
260
Contratos/RepPresupuestosDetalleCompras.aspx
Normal file
@@ -0,0 +1,260 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepPresupuestosDetalleCompras.aspx.vb" Inherits="Contratos_RepPresupuestosDetalleCompras" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
.dataTables_scrollHead {
|
||||
background-color: #95A5A6;
|
||||
color: white;
|
||||
}
|
||||
|
||||
@import url(https://fonts.googleapis.com/css?family=Droid+Sans:400,700|Droid+Serif:400,700);
|
||||
|
||||
#chartProyectos {
|
||||
height: 800px;
|
||||
width: 800px;
|
||||
}
|
||||
|
||||
.amcharts-chart-div a {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.contenedor {
|
||||
margin: 0 auto;
|
||||
text-align: left;
|
||||
color: #989A8F;
|
||||
width: 450px;
|
||||
height: 200px;
|
||||
}
|
||||
|
||||
.calificador {
|
||||
height: 270px;
|
||||
width: 75%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.toplistaVerde {
|
||||
background-color: #1BA39C;
|
||||
height: 33%;
|
||||
width: 300px;
|
||||
padding-top: 17%;
|
||||
}
|
||||
|
||||
.toplistaAmarillo {
|
||||
background-color: #c29d0b;
|
||||
height: 33%;
|
||||
width: 300px;
|
||||
padding-top: 17%;
|
||||
}
|
||||
|
||||
.toplistaRojo {
|
||||
background-color: #E43A45;
|
||||
height: 33%;
|
||||
width: 300px;
|
||||
padding-top: 17%;
|
||||
}
|
||||
|
||||
.toplistaAzul {
|
||||
background-color: #337ab7;
|
||||
height: 33%;
|
||||
width: 300px;
|
||||
padding-top: 17%;
|
||||
}
|
||||
|
||||
.bottomlista {
|
||||
margin-top: 25%;
|
||||
}
|
||||
|
||||
|
||||
.circuloVerde {
|
||||
width: 40%;
|
||||
height: 400%;
|
||||
border: 4px solid;
|
||||
border-radius: 50% !important;
|
||||
border-color: #1BA39C;
|
||||
font-size: 30px;
|
||||
color: #fff;
|
||||
line-height: 405%;
|
||||
text-align: center;
|
||||
background-color: #FFFFFF;
|
||||
margin-left: 30%;
|
||||
margin-top: -10%;
|
||||
}
|
||||
|
||||
.verde {
|
||||
color: #1BA39C;
|
||||
}
|
||||
|
||||
.circuloAmarillo {
|
||||
width: 40%;
|
||||
height: 400%;
|
||||
border: 4px solid;
|
||||
border-radius: 50% !important;
|
||||
border-color: #c29d0b;
|
||||
font-size: 30px;
|
||||
color: #fff;
|
||||
line-height: 405%;
|
||||
text-align: center;
|
||||
background-color: #FFFFFF;
|
||||
margin-left: 30%;
|
||||
margin-top: -10%;
|
||||
}
|
||||
|
||||
.amarillo {
|
||||
color: #c29d0b;
|
||||
}
|
||||
|
||||
.circuloRojo {
|
||||
width: 40%;
|
||||
height: 400%;
|
||||
border: 4px solid;
|
||||
border-radius: 50% !important;
|
||||
border-color: #E43A45;
|
||||
font-size: 30px;
|
||||
color: #fff;
|
||||
line-height: 405%;
|
||||
text-align: center;
|
||||
background-color: #FFFFFF;
|
||||
margin-left: 30%;
|
||||
margin-top: -10%;
|
||||
}
|
||||
|
||||
.rojo {
|
||||
color: #E43A45;
|
||||
}
|
||||
|
||||
.circuloAzul {
|
||||
width: 40%;
|
||||
height: 400%;
|
||||
border: 4px solid;
|
||||
border-radius: 50% !important;
|
||||
border-color: #337ab7;
|
||||
font-size: 30px;
|
||||
color: #fff;
|
||||
line-height: 405%;
|
||||
text-align: center;
|
||||
background-color: #FFFFFF;
|
||||
margin-left: 30%;
|
||||
margin-top: -10%;
|
||||
}
|
||||
|
||||
.azul {
|
||||
color: #337ab7;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte Detallado de Presupuestos
|
||||
</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">
|
||||
|
||||
|
||||
<asp:UpdatePanel ID="UpFiltros" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultarFiltros" OnClick="BtnConsultarFiltros_Click" runat="server" Text="Consultar" ValidationGroup="GrpFiltros" class="btn btn-primary" />
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption ">
|
||||
<div class="row">
|
||||
<div class="col-md-1" style="max-width: 90px">Fecha Inicio:</div>
|
||||
<div class="col-md-2" style="max-width: 130px">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 90px !important; padding: 0px;">
|
||||
<asp:TextBox ID="TxtFiltrosFechaInicio" CssClass="form-control input-sm ADSMaskDate" Style="width: 88px" runat="server"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="LnkFechaI" class="btn default " Text=" <i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEEFiltrosFechaInicio" runat="server" TargetControlID="TxtFiltrosFechaInicio" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CEFiltrosFechaInicio" TargetControlID="TxtFiltrosFechaInicio" PopupButtonID="LnkFechaI" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVFiltrosFechaInicio" runat="server" ControlToValidate="TxtFiltrosFechaInicio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpFiltros"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEFiltrosFechaInicio" runat="server" HighlightCssClass="vco" TargetControlID="RFVFiltrosFechaInicio"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1" style="max-width: 75px">Fecha Fin:</div>
|
||||
<div class="col-md-2" style="max-width: 130px">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 90px !important; padding: 0px;">
|
||||
<asp:TextBox ID="TxtFiltrosFechaFin" CssClass="form-control input-sm ADSMaskDate" Style="width: 88px" runat="server"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="LnkFechaF" class="btn default " Text=" <i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEEFiltrosFechaFin" runat="server" TargetControlID="TxtFiltrosFechaFin" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CEFiltrosFechaFin" TargetControlID="TxtFiltrosFechaFin" PopupButtonID="LnkFechaF" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVFiltrosFechaFin" runat="server" ControlToValidate="TxtFiltrosFechaFin" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpFiltros"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEFiltrosFechaFin" runat="server" HighlightCssClass="vco" TargetControlID="RFVFiltrosFechaFin"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1" style="max-width: 120px">Proyecto:</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlProyecto" DataTextField="Proyecto" AppendDataBoundItems="true" DataValueField="CveProyecto" AutoPostBack="true" OnSelectedIndexChanged="DdlProyecto_SelectedIndexChanged" Width="200px" runat="server" CssClass="form-control input-sm select2me">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1" style="max-width: 120px">SubProyecto:</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlSubProyecto" DataTextField="SubProyecto" AppendDataBoundItems="true" DataValueField="CveSubProyecto" Width="200px" runat="server" CssClass="form-control input-sm select2me">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<%-- <div class="col-md-1" style="max-width: 80px">Agrupador:</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlAgrupador" Width="150px" runat="server" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Text="Clasificacion" Value="1" />
|
||||
<asp:ListItem Text="Centro de Costo" Value="2" Selected="True" />
|
||||
</asp:DropDownList>
|
||||
</div>--%>
|
||||
<%-- <div class="col-md-1" style="max-width: 80px">Mensual:</div>
|
||||
<div class="col-md-2">
|
||||
<asp:CheckBox ID="ChkMensual" runat="server" CssClass="md-checksd2" />
|
||||
</div>--%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none;" id="idnecesaria2">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-1" style="max-width: 120px">Clasificacion:</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlClasificacion" DataTextField="Clasificacion" AppendDataBoundItems="true" DataValueField="CveClasificacion" Width="200px" runat="server" CssClass="form-control input-sm select2me">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1" style="max-width: 120px">Tipo Gasto:</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlTipoGasto" Width="200px" DataTextField="TipoGasto" DataValueField="CveTipoGasto" AppendDataBoundItems="true" runat="server" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Text="Todos" Value="-1" Selected="True" />
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" OnRowDataBound="GvDatos_RowDataBound" EmptyDataText="Sin resultados" ShowHeaderWhenEmpty="true" CssClass="table table-striped table-hover Widthall ScrollAD" GridLines="None" data-sort="true">
|
||||
<Columns>
|
||||
<asp:HyperLinkField HeaderText="Serie - Folio" DataTextField="SerieFolio" DataNavigateUrlFields="CveCompra" DataNavigateUrlFormatString="/Compras/Compras.aspx?CveCompra={0}" Target="_blank" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Proveedor" DataField="RazonSocial" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Importe" DataField="Total" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="Fecha" ItemStyle-Width="15%" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
127
Contratos/RepPresupuestosDetalleCompras.aspx.vb
Normal file
127
Contratos/RepPresupuestosDetalleCompras.aspx.vb
Normal file
@@ -0,0 +1,127 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Partial Class Contratos_RepPresupuestosDetalleCompras
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "P R O P I E D A D E S"
|
||||
|
||||
Public Property Gpo() As Integer
|
||||
Get
|
||||
Return DirectCast(ViewState("Gpo"), Integer)
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
ViewState("Gpo") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
|
||||
InicializaValores()
|
||||
CargaUrlParametros()
|
||||
CargaDatos()
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region " INICIALIZA VALORES "
|
||||
Private Sub InicializaValores()
|
||||
|
||||
TxtFiltrosFechaInicio.Text = $"01/09/{Now.Year - 1}"
|
||||
TxtFiltrosFechaFin.Text = $"31/08/{Now.Year}"
|
||||
|
||||
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
|
||||
DdlClasificacion.Items.Insert(0, New ListItem("Todas", "-1"))
|
||||
DdlClasificacion.DataBind()
|
||||
|
||||
DdlTipoGasto.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa)
|
||||
DdlTipoGasto.DataBind()
|
||||
|
||||
DdlProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1).FiltraParametros("", "", {"CveProyecto", "Proyecto"}), GlobalDTProyectos(UsuarioActual.CveEmpresa, -1).FiltraParametros("", "", {"CveProyecto", "Proyecto"}))
|
||||
DdlProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlProyecto.DataBind()
|
||||
|
||||
CargaSubProyecto()
|
||||
|
||||
UpFiltros.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaSubProyecto()
|
||||
DdlSubProyecto.Items.Clear()
|
||||
If DdlProyecto.SelectedValue.ToEntero > 0 Or UsuarioActual.Empresa.Tipo_CentroCosto = 1 Then
|
||||
DdlSubProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, DdlProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa, 1))
|
||||
End If
|
||||
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlSubProyecto.DataBind()
|
||||
End Sub
|
||||
Private Sub CargaUrlParametros()
|
||||
Dim CveClasificacion = IfNull(Request("CveClasificacion"), -1).ToString.ToEntero
|
||||
Dim FechaInicio = IfNull(Request("FechaInicio"), $"01/09/{Now.Year}").ToString
|
||||
Dim FechaFin = IfNull(Request("FechaFin"), $"31/08/{Now.Year + 1}").ToString
|
||||
Dim CveProyecto = IfNull(Request("CveProyecto"), -1).ToString.ToEntero
|
||||
Dim CveSubProyecto = IfNull(Request("CveSubProyecto"), -1).ToString.ToEntero
|
||||
Dim CveTipoGasto = IfNull(Request("CveTipoGasto"), -1).ToString.ToEntero
|
||||
Dim Agrupador = IfNull(Request("Agrupador"), -1).ToString.ToEntero
|
||||
Gpo = IfNull(Request("CveAgrupador"), -1).ToString.ToEntero
|
||||
Dim EsProyecto = CBool(IfNull(Request("EsProyecto"), False))
|
||||
If Agrupador = 1 Then Agrupador = 2 Else Agrupador = 1
|
||||
DdlClasificacion.SelectedValueExist(CveClasificacion)
|
||||
If Agrupador = 2 Then
|
||||
DdlClasificacion.SelectedValueExist(Gpo)
|
||||
DdlProyecto.SelectedValueExist(CveProyecto)
|
||||
CargaSubProyecto()
|
||||
DdlSubProyecto.SelectedValueExist(CveSubProyecto)
|
||||
ElseIf Agrupador = 1 Then
|
||||
If Not EsProyecto Then
|
||||
Dim Dr As DataRow = GlobalDTSubProyectos(-1, Gpo)(0)
|
||||
DdlProyecto.SelectedValueExist(Dr("CveProyecto"))
|
||||
CargaSubProyecto()
|
||||
DdlSubProyecto.SelectedValueExist(Gpo)
|
||||
Else
|
||||
DdlProyecto.SelectedValueExist(Gpo)
|
||||
CargaSubProyecto()
|
||||
DdlSubProyecto.SelectedValueExist(CveSubProyecto)
|
||||
End If
|
||||
End If
|
||||
DdlTipoGasto.SelectedValueExist(CveTipoGasto)
|
||||
TxtFiltrosFechaInicio.Text = FechaInicio
|
||||
TxtFiltrosFechaFin.Text = FechaFin
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " CARGA DATOS "
|
||||
Protected Sub BtnConsultarFiltros_Click(sender As Object, e As EventArgs)
|
||||
CargaDatos()
|
||||
End Sub
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjPresupuestos As New ClsContratos
|
||||
If ObjPresupuestos.GetPresupuestosRepDetalleCompras(DdlProyecto.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, DdlTipoGasto.SelectedValue.ToEntero, TxtFiltrosFechaInicio.Text.ToDate, TxtFiltrosFechaFin.Text.ToDate, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then
|
||||
GvDatos.DataSource = ObjPresupuestos.DtResultados
|
||||
End If
|
||||
ObjPresupuestos.Dispose()
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
CargaSubProyecto()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.CssClass = "Totales"
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user