This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2023-03-27 23:29:17 -07:00
parent 2623442ef8
commit b34283d9c6
4 changed files with 255 additions and 94 deletions

View File

@@ -29,6 +29,104 @@ Namespace Extensiones
#Region "E X T E N S I O N E S"
Public Module ModExtensiones
Public ReadOnly Property foreign_characters As Dictionary(Of String, String)
Get
Dim fgk As Dictionary(Of String, String) = New Dictionary(Of String, String) From {
{"äæǽ", "ae"},
{"öœ", "oe"},
{"ü", "ue"},
{"Ä", "Ae"},
{"Ü", "Ue"},
{"Ö", "Oe"},
{"ÀÁÂÃÄÅǺĀĂĄǍΑΆẢẠẦẪẨẬẰẮẴẲẶА", "A"},
{"àáâãåǻāăąǎªαάảạầấẫẩậằắẵẳặа", "a"},
{"Б", "B"},
{"б", "b"},
{"ÇĆĈĊČ", "C"},
{"çćĉċč", "c"},
{"Д", "D"},
{"д", "d"},
{"ÐĎĐΔ", "Dj"},
{"ðďđδ", "dj"},
{"ÈÉÊËĒĔĖĘĚΕΈẼẺẸỀẾỄỂỆЕЭ", "E"},
{"èéêëēĕėęěέεẽẻẹềếễểệеэ", "e"},
{"Ф", "F"},
{"ф", "f"},
{"ĜĞĠĢΓГҐ", "G"},
{"ĝğġģγгґ", "g"},
{"ĤĦ", "H"},
{"ĥħ", "h"},
{"ÌÍÎÏĨĪĬǏĮİΗΉΊΙΪỈỊИЫ", "I"},
{"ìíîïĩīĭǐįıηήίιϊỉịиыї", "i"},
{"Ĵ", "J"},
{"ĵ", "j"},
{"ĶΚК", "K"},
{"ķκк", "k"},
{"ĹĻĽĿŁΛЛ", "L"},
{"ĺļľŀłλл", "l"},
{"М", "M"},
{"м", "m"},
{"ÑŃŅŇΝН", "N"},
{"ñńņňʼnνн", "n"},
{"ÒÓÔÕŌŎǑŐƠØǾΟΌΩΏỎỌỒỐỖỔỘỜỚỠỞỢО", "O"},
{"òóôõōŏǒőơøǿºοόωώỏọồốỗổộờớỡởợо", "o"},
{"П", "P"},
{"п", "p"},
{"ŔŖŘΡР", "R"},
{"ŕŗřρр", "r"},
{"ŚŜŞȘŠΣС", "S"},
{"śŝşșšſσςс", "s"},
{"ȚŢŤŦτТ", "T"},
{"țţťŧт", "t"},
{"ÙÚÛŨŪŬŮŰŲƯǓǕǗǙǛŨỦỤỪỨỮỬỰУ", "U"},
{"ùúûũūŭůűųưǔǖǘǚǜυύϋủụừứữửựу", "u"},
{"ÝŸŶΥΎΫỲỸỶỴЙ", "Y"},
{"ýÿŷỳỹỷỵй", "y"},
{"В", "V"},
{"в", "v"},
{"Ŵ", "W"},
{"ŵ", "w"},
{"ŹŻŽΖЗ", "Z"},
{"źżžζз", "z"},
{"ÆǼ", "AE"},
{"ß", "ss"},
{"IJ", "IJ"},
{"ij", "ij"},
{"Œ", "OE"},
{"ƒ", "f"},
{"ξ", "ks"},
{"π", "p"},
{"β", "v"},
{"μ", "m"},
{"ψ", "ps"},
{"Ё", "Yo"},
{"ё", "yo"},
{"Є", "Ye"},
{"є", "ye"},
{"Ї", "Yi"},
{"Ж", "Zh"},
{"ж", "zh"},
{"Х", "Kh"},
{"х", "kh"},
{"Ц", "Ts"},
{"ц", "ts"},
{"Ч", "Ch"},
{"ч", "ch"},
{"Ш", "Sh"},
{"ш", "sh"},
{"Щ", "Shch"},
{"щ", "shch"},
{"ЪъЬь", ""},
{"Ю", "Yu"},
{"ю", "yu"},
{"Я", "Ya"},
{"я", "ya"}
}
Return fgk
End Get
End Property
Public ReadOnly Property DirectorioBaseEmpresas As String
Get
If IsNothing(System.Configuration.ConfigurationManager.AppSettings("DirectorioBaseEmpresas")) Then
@@ -3826,11 +3924,71 @@ Namespace Extensiones
Dim FechaF As DateTime = New DateTime(Year, 10, 1, 23, 59, 59).GetLastWeekdayOfMonth(DayOfWeek.Sunday) 'ULTIMO DOMINGO DE OCTUBRE
Return fecha >= FechaI AndAlso fecha <= FechaF
End Function
<Runtime.CompilerServices.Extension()>
Function RemoveDiacritics(ByVal c As Char) As Char
For Each entry As KeyValuePair(Of String, String) In foreign_characters
If entry.Key.IndexOf(c) <> -1 Then
Return entry.Value(0)
End If
Next
Return c
End Function
<Runtime.CompilerServices.Extension()>
Function RemoveDiacritics(ByVal s As String) As String
Dim text As String = ""
For Each c As Char In s
Dim len As Integer = text.Length
For Each entry As KeyValuePair(Of String, String) In foreign_characters
If entry.Key.IndexOf(c) <> -1 Then
text += entry.Value
Exit For
End If
Next
If len = text.Length Then
text += c
End If
Next
Return text
End Function
End Module
#End Region
#Region "C L A S E S"
#Region "C L A S E S"
Public Class TipoCambioActual
Public Fecha As Date
Public TipoCambio As Decimal
End Class
Public Class MenuModal
Public Sub New()
HeaderBar = New StringBuilder("<li><i class='fa fa-home'></i><a href='/Inicio.aspx'>Inicio</a></li>")
MenuHTML = New StringBuilder()
modpadres = New List(Of String)
End Sub
Property CveModuloSeleccionado As Integer
Property CveModuloSeleccionadoPadre As Integer
Property dt As DataTable
Property HeaderBar As StringBuilder
Property MenuHTML As StringBuilder
Property ScriptColorGrupoModulo As String
Property strdomain As String
Property modpadres As List(Of String)
End Class
Public Class Archivo
Public Sub New()
filename = ""

View File

@@ -12,7 +12,9 @@
.table-hover > tbody > tr:hover {
background-color: #e5e5e5;
}
.page-sidebar-menu .dnone {
display: none;
}
.table-striped > tbody > tr:nth-of-type(odd).ADSRow,
table > tbody > tr.ADSRow > td, table.table > tbody > tr.ADSRow > td,
table > tr.ADSRow > td, table.table > tr.ADSRow > td,

View File

@@ -13,6 +13,11 @@
<meta content="" name="description" />
<meta content="" name="author" />
<!-- BEGIN STYLES -->
<style>
.page-sidebar-menu .dnone {
display: none;
}
</style>
<%: Scripts.Render("~/bundles/modernizr") %>
<%: Styles.Render("~/Content/AjaxControlToolkit/Styles/Bundle") %>
<link rel="preconnect" href="https://fonts.googleapis.com">
@@ -149,7 +154,7 @@
<i aria-hidden="true" class="icon-magnifier"></i>
</a>
<ul class="dropdown-menu">
<ul class="dropdown-menu">
<li id="tdCliente" runat="server" visible="false">
<a onclick="javascript:AbrirVentana('/Ventas/PopUpBuscarClientes.aspx');">
<i class="fa fa-users"></i>
@@ -179,7 +184,7 @@
<i class="fa fa-truck"></i>
Buscar Proveedor
</a>
</li>
</li>
<li id="tdCheques" runat="server" visible="false">
<a onclick="javascript:AbrirVentana('/Bancos/PopUpBuscarIE.aspx');">
<i class="fa fa-university"></i>
@@ -248,7 +253,7 @@
Buscar Producto Servicios
</a>
</li>
<li id="TdBuscaActivoFijo" runat="server" visible="False">
<li id="TdBuscaActivoFijo" runat="server" visible="False">
<a onclick="javascript:AbrirVentana('/AF/PopUpBuscarAF.aspx',800,600,'N');">
<i class="fa fa-building"></i>
Buscar Activo Fijo
@@ -260,7 +265,7 @@
Buscar Cuentas Proveedor
</a>
</li>
<li id="tdBuscarMilitante" runat="server" visible="false">
<li id="tdBuscarMilitante" runat="server" visible="false">
<a onclick="javascript:AbrirVentana('/ZDG/PopUpBuscarMilitante.aspx',1250);">
<i class="fa fa-male"></i>
Buscar Militante
@@ -284,7 +289,8 @@
<li runat="server" id="DivPerfil" visible="false">
<a runat="server" id="A1" href="/RH/MiPerfil.aspx" style="cursor: pointer;"><i class="fa fa-user"></i>Mi Perfil</a>
</li>
<li><asp:LinkButton ID="LnkDescargarManual" runat="server" Text="<i class='fa fa-download'></i> Descargar Manual SIG" OnClick="LnkDescargarManual_Click"></asp:LinkButton></li>
<li>
<asp:LinkButton ID="LnkDescargarManual" runat="server" Text="<i class='fa fa-download'></i> Descargar Manual SIG" OnClick="LnkDescargarManual_Click"></asp:LinkButton></li>
<li><a onclick="javascript:AbrirVentana('/Sistemas/CatContrasenia.aspx');"><i class="fa fa-exchange"></i>Cambiar Contraseña</a></li>
<li runat="server" id="DivConfiguracionEmpresa" visible="false"><a runat="server" id="BtnConfiguracionEmpresa" style="cursor: pointer;"><i class="fa fa-cog"></i>Configuración Empresa</a></li>
<li><a runat="server" id="BtnCerrarSesion"><i class="fa fa-key"></i>Cerrar Sesión</a></li>
@@ -388,15 +394,15 @@
<div class="col-sm-2">
<asp:TextBox ID="TxtTit" BorderStyle="None" CssClass="form-control input-sm" runat="server" Visible="false" Width="100%"></asp:TextBox>
</div>
<div class="col-sm-3 text-right" style="padding-top: 8px; white-space: nowrap; direction: rtl;">
<div class="col-sm-3 text-right" style="padding-top: 8px; white-space: nowrap; direction: rtl;">
<div style="direction: ltr">
<i class="icon-calendar"></i>
<asp:UpdatePanel ID="UPGP" runat="server" RenderMode="Inline">
<ContentTemplate>
<asp:Label ID="lblFecha" CssClass="thin uppercase hidden-xs" runat="server"></asp:Label>
<asp:Label ID="lblFecha" CssClass="thin uppercase hidden-xs" runat="server"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
<asp:Label ID="lblTipoCambio" CssClass="thin uppercase hidden-xs" runat="server"></asp:Label>
</div>
</div>
@@ -432,7 +438,7 @@
</div>
<div class="ContentPlaceHolderc">
<asp:ContentPlaceHolder ID="C" runat="server">
</asp:ContentPlaceHolder>
</asp:ContentPlaceHolder>
</div>
</div>
</div>
@@ -682,63 +688,63 @@
<!-- END FOOTER -->
<!-- END JAVASCRIPTS -->
<asp:panel runat="server" id="pnlNotificacionSAT" Visible="false" CssClass="modal ADS fade" role="dialog">
<asp:UpdatePanel ID="UpNotificacionesFoliosSAT" class="modal-dialog" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content rowpadding">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" runat="server" style="text-align: left">Folios descargados</h4>
</div>
<div class="modal-body" style="min-width:1000px;">
<asp:TextBox ID="TxtCveNotisat" CssClass="hidden" runat="server"></asp:TextBox><asp:Button ID="btnoknotisat" OnClick="btnoknotisat_Click" CssClass="hidden" runat="server" Text="Button" />
<asp:GridView ID="GVnotiFoliosSAT" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall GVFoliosSAT" AutoGenerateColumns="False"
DataKeyNames="UUID" data-sort="2">
<Columns>
<asp:TemplateField HeaderText="Folio Fiscal ">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("UUID")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo Comprobante">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("TipoComprobante")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="RFC">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("RFCDe")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Serie - Folio ">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("SerieFolio")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("FechaFactura","{0: dd/MM/yyyy}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("Total","{0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:Panel runat="server" ID="pnlNotificacionSAT" Visible="false" CssClass="modal ADS fade" role="dialog">
<asp:UpdatePanel ID="UpNotificacionesFoliosSAT" class="modal-dialog" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content rowpadding">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" runat="server" style="text-align: left">Folios descargados</h4>
</div>
<div class="modal-body" style="min-width: 1000px;">
<asp:TextBox ID="TxtCveNotisat" CssClass="hidden" runat="server"></asp:TextBox><asp:Button ID="btnoknotisat" OnClick="btnoknotisat_Click" CssClass="hidden" runat="server" Text="Button" />
<asp:GridView ID="GVnotiFoliosSAT" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall GVFoliosSAT" AutoGenerateColumns="False"
DataKeyNames="UUID" data-sort="2">
<Columns>
<asp:TemplateField HeaderText="Folio Fiscal ">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("UUID")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo Comprobante">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("TipoComprobante")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="RFC">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("RFCDe")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Serie - Folio ">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("SerieFolio")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("FechaFactura","{0: dd/MM/yyyy}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("Total","{0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:panel>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
<div id="pogresspostback" class="hidden" style="z-index: 10000;" runat="server">
<div style="width: 200px; position: absolute; margin: 0 0 0 -100px; top: 50%; left: 50%; background-color: transparent;">
<div class="loading-spinner" style="width: 300px;">

View File

@@ -1,12 +1,14 @@
Option Explicit On
Option Strict On
Imports System.Activities.Statements
Imports System.Data
Imports System.IO
Imports System.Security.Cryptography.X509Certificates
Imports ADSNetLibrary.SIGAPI.Services.SAT.DescargaCFDI
Imports DocumentFormat.OpenXml.Math
Imports DocumentFormat.OpenXml.Packaging
Imports DocumentFormat.OpenXml.Spreadsheet
Imports Extensiones
'Imports Microsoft.AspNet.SignalR.Client
'Imports ChatHub
@@ -305,22 +307,6 @@ Partial Class Site
' dt.ReadXml(String.Format("{0}\Menu\ERP\{1}_Conf.xml", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveUsuario))
'End Sub
Public Class MenuModal
Public Sub New()
HeaderBar = New StringBuilder("<li><i class='fa fa-home'></i><a href='/Inicio.aspx'>Inicio</a></li>")
MenuHTML = New StringBuilder()
End Sub
Property CveModuloSeleccionado As Integer
Property CveModuloSeleccionadoPadre As Integer
Property dt As DataTable
Property HeaderBar As StringBuilder
Property MenuHTML As StringBuilder
Property ScriptColorGrupoModulo As String
End Class
Private Function ArmarMenu(CveModulo As Integer, ByRef menuobj As MenuModal) As MenuModal
Dim listaModulos As EnumerableRowCollection(Of DataRow) = From i In menuobj.dt.AsEnumerable Where i!CvePadre.Equals(CveModulo) Order By i!Orden
Dim cveModuloActual As Integer
@@ -329,7 +315,8 @@ Partial Class Site
Dim estilo As String
For Each drP As DataRow In listaModulos
cveModuloActual = drP("CveModulo").ToString().ToEntero()
liga = If(drP("PopUp").ToString() = "S", String.Format("javascript:AbrirVentana('{0}',{1},{2},'N');", drP("LIGA"), drP("ANCHO"), drP("ALTO")), drP("LIGA").ToString())
liga = If(drP("PopUp").ToString() = "S", String.Format("javascript:AbrirVentana('{0}',{1},{2},'N');", drP("LIGA"), drP("ANCHO"), drP("ALTO")), If(drP("IsAngular").ToString() = "1", String.Format("{1}:84{0}", drP("LIGA"), menuobj.strdomain), drP("LIGA").ToString()))
modulo = drP("Modulo").ToString()
estilo = If(drP("Estilo").ToString() <> "", String.Format("<i class='{0}'></i>", drP("Estilo")), "")
@@ -340,11 +327,15 @@ Partial Class Site
End If
menuobj.MenuHTML.AppendFormat("<li><a id='m{0}' href=""{1}"">{2}<span class='title'>{3}</span>", cveModuloActual, liga, estilo, modulo)
drP.Delete()
menuobj.dt.AcceptChanges()
If menuobj.dt.COUNT("CveModulo", String.Format("CvePadre ={0}", cveModuloActual)) > 0 Then
menuobj.MenuHTML.AppendFormat("<span id='j{0}'></span><span class='arrow '></span></a><ul class='sub-menu'>", cveModuloActual)
menuobj.modpadres.Add(modulo.RemoveDiacritics())
menuobj = ArmarMenu(cveModuloActual, menuobj)
menuobj.modpadres.RemoveAt(menuobj.modpadres.Count - 1)
If menuobj.CveModuloSeleccionadoPadre = cveModuloActual Then
@@ -358,11 +349,19 @@ Partial Class Site
menuobj.HeaderBar.AppendFormat("<li><i class='fa fa-angle-right'></i><a href='{0}'>{1}</a></li>", liga, modulo)
menuobj.CveModuloSeleccionadoPadre = CveModulo
End If
menuobj.MenuHTML.AppendFormat("</ul>")
menuobj.MenuHTML.Append("</ul>")
Else
menuobj.MenuHTML.AppendFormat("</a>")
menuobj.MenuHTML.Append("</a>")
End If
menuobj.MenuHTML.AppendFormat("</li>")
menuobj.MenuHTML.AppendFormat("<a class='dnone'>{0}", modulo.RemoveDiacritics())
For Each items As String In menuobj.modpadres
menuobj.MenuHTML.Append("-")
menuobj.MenuHTML.AppendFormat("{0}", items)
Next
menuobj.MenuHTML.Append("</a>")
menuobj.MenuHTML.Append("</li>")
Next
Return menuobj
@@ -393,13 +392,13 @@ Partial Class Site
Dim menuobj = New MenuModal()
menuobj.dt = dt
menuobj.CveModuloSeleccionado = CveModulomasterpage.Text.ToEntero()
menuobj.strdomain = Request.Url.AbsoluteUri.Replace(Request.Url.PathAndQuery, "").Replace("https://", "http://")
If Request.Url.Port <> 80 Then
menuobj.strdomain = menuobj.strdomain.Replace(String.Format(":{0}", Request.Url.Port), "")
End If
Dim newmenuobj As MenuModal = ArmarMenu(0, menuobj)
Dim strdomain = Request.Url.AbsoluteUri.Replace(Request.Url.PathAndQuery, "").Replace("https://", "http://")
If Request.Url.Port <> 80 Then
strdomain = strdomain.Replace(String.Format(":{0}", Request.Url.Port), "")
End If
'Dim MenuHTML As New StringBuilder
'For Each drP As DataRow In Inicio
' CveModuloPadre = drP("CveModulo").ToString().ToEntero()
@@ -702,8 +701,4 @@ Partial Class Site
Catch ex As Exception
End Try
End Sub
End Class
Public Class TipoCambioActual
Public Fecha As Date
Public TipoCambio As Decimal
End Class