-- limpieza código comentado
This commit is contained in:
@@ -569,41 +569,30 @@ Namespace Extensiones
|
||||
Select Case pOpcion
|
||||
Case TipoMensaje.MsgInformacion
|
||||
Titulo = "Información"
|
||||
Img = "I"
|
||||
'Img = "<img src=""/Imagenes/Mensajes/Information.jpg"" width=""50px"" style=""float:left;"" alt="""" />"
|
||||
'Botones = String.Format("<input id=""_CmdAceptar"" type=""button"" value=""Aceptar"" onclick=""OcultaAlert();{1}"" />", Plus, JSBtnAceptar)
|
||||
Img = "I"
|
||||
Botones = "1"
|
||||
Case TipoMensaje.MsgConfirmacion
|
||||
Titulo = "Confirmación"
|
||||
Img = "C"
|
||||
'Img = "<img src=""/Imagenes/Mensajes/Interrogation.jpg"" width=""50px"" style=""float:left;"" alt="""" />"
|
||||
'Botones = String.Format("<input id=""_CmdAceptar"" type=""button"" value=""Aceptar"" onclick=""OcultaAlert();{1} return true;""><input type=""Button"" value=""Cancelar"" onclick=""OcultaAlert(\""{0}\""); return false;"">", Plus, JSBtnAceptar)
|
||||
Botones = "2"
|
||||
Case TipoMensaje.MsgAdvertencia
|
||||
Titulo = "Advertencia"
|
||||
Img = "A"
|
||||
'Img = "<img src=""/Imagenes/Mensajes/Exclamation.jpg"" width=""50px"" style=""float:left;"" alt="""" />"
|
||||
'Botones = String.Format("<input id=""_CmdAceptar"" type=""button"" value=""Aceptar"" onclick=""OcultaAlert();{1}"" />", Plus, JSBtnAceptar)
|
||||
Botones = "1"
|
||||
Case Else
|
||||
Titulo = "Error"
|
||||
Img = "E"
|
||||
'Img = "<img src=""/Imagenes/Mensajes/Error.jpg"" width=""50px"" style=""float:left;"" alt="""" />"
|
||||
'Botones = String.Format("<input id=""_CmdAceptar"" type=""button"" value=""Aceptar"" onclick=""OcultaAlert();"" />", Plus, JSBtnAceptar)
|
||||
Botones = "1"
|
||||
End Select
|
||||
|
||||
Try
|
||||
|
||||
|
||||
Dim Pag As Page = DirectCast(System.Web.HttpContext.Current.CurrentHandler, Page)
|
||||
'ScriptManager.RegisterStartupScript(Pag, Pag.GetType(), (DateTime.Now.Ticks + 1).ToString(), "MuestraAlert('" & Alerta.ToString() & "', '" & Plus & "');", True)
|
||||
ScriptManager.RegisterStartupScript(Pag, Pag.GetType(), (DateTime.Now.Ticks + 1).ToString(), String.Format("MuestraAlerta('{0}','{1}','{2}','{3}','{4}');", Titulo, Mensaje, Img, Botones, JSBtnAceptar), True)
|
||||
Pag = Nothing
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
'Alerta = Nothing
|
||||
End Try
|
||||
End If
|
||||
|
||||
End Sub
|
||||
@@ -629,29 +618,6 @@ Namespace Extensiones
|
||||
If Fecha <> "" Then Time = String.Format("<span class=""time"">{0}</span>", Fecha)
|
||||
Return String.Format("<li><a href=""{4}"" {5}>{0}<span class=""details""><span class=""label label-sm label-icon label-{1}""><i class=""{2}""></i></span>{3}</span></a></li>", Time, Tipo, Ico, Mensaje, Link, If(tonewpage, "target=""_blank""", ""))
|
||||
End Function
|
||||
'<Runtime.CompilerServices.Extension()>
|
||||
'Public Function addindicador(Obj As Object, color As String, icono As String, titulo As String, comentario As String, link As String) As String
|
||||
' Try
|
||||
' Dim htmlobj = DirectCast(Obj, HtmlGenericControl)
|
||||
' color = color.Replace("'", "\'")
|
||||
' icono = icono.Replace("'", "\'")
|
||||
' titulo = titulo.Replace("'", "\'")
|
||||
' comentario = comentario.Replace("'", "\'")
|
||||
' link = link.Replace("'", "\'")
|
||||
' Dim script As String = " addindicadortext('" & color & "','" & icono & "','" & titulo & "','" & comentario & "','" & link & "',$('#" & htmlobj.ClientID.ToString & "')); "
|
||||
' Return script
|
||||
|
||||
' Catch ex As Exception
|
||||
' Return ""
|
||||
' End Try
|
||||
'End Function
|
||||
|
||||
'<Runtime.CompilerServices.Extension()>
|
||||
'Public Sub updateindicador(Obj As Object, script As String)
|
||||
' Dim Pag As Page = DirectCast(System.Web.HttpContext.Current.CurrentHandler, Page)
|
||||
' ScriptManager.RegisterStartupScript(Pag, Pag.GetType(), (DateTime.Now.Ticks + 1).ToString(), script, True)
|
||||
' Pag = Nothing
|
||||
'End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
@@ -1813,21 +1779,17 @@ Namespace Extensiones
|
||||
#End Region
|
||||
|
||||
#Region "Excel PDF"
|
||||
Public Sub GeneraChequePDF(pCveIE As Integer, tEmpresa As Empresa, Optional IDPoliza As Integer = -1, Optional MuestraAlert As Boolean = True)
|
||||
|
||||
Dim missing As Object = System.Reflection.Missing.Value
|
||||
Public Sub GeneraChequePDF(pCveIE As Integer, tEmpresa As Empresa, Optional IDPoliza As Integer = -1, Optional MuestraAlert As Boolean = True)
|
||||
|
||||
Dim Folio, Observacion, UsuarioRegistro, TextoImporte, PagueseA, Ruta, Banco, NumCuenta, AbonoCuenta, SubProyecto, NotificarA, RefCrediproveedor As String
|
||||
Dim FechaExpedicion As Date = Now
|
||||
Dim Importe As Double
|
||||
Dim FormatoCheque As String = ""
|
||||
Dim Importe As Double
|
||||
Dim tCveEmpresa As Integer = tEmpresa.CveEmpresa
|
||||
Dim CveTipoTransaccion, CveProveedor, CvePersonal, CveCuentaDeposito As Integer
|
||||
Dim CveTipoTransaccion, CveProveedor, CvePersonal As Integer
|
||||
Dim ObjIE As New ClsBancos()
|
||||
Dim tIdPoliza As Integer
|
||||
Dim DtMovimientosPoliza As DataTable = Nothing
|
||||
Folio = ""
|
||||
TextoImporte = "" : Observacion = "" : PagueseA = "" : UsuarioRegistro = "" : Banco = "" : NumCuenta = "" : AbonoCuenta = "" : SubProyecto = "" : NotificarA = "" : RefCrediproveedor = ""
|
||||
CveProveedor = -1 : CvePersonal = -1 : CveCuentaDeposito = 0
|
||||
Dim tIdPoliza As Integer
|
||||
|
||||
Folio = ""
|
||||
Ruta = tEmpresa.Ruta
|
||||
|
||||
If ObjIE.GetBancosIE(pCveIE, tCveEmpresa) Then
|
||||
@@ -1838,9 +1800,8 @@ Namespace Extensiones
|
||||
Importe = ObjIE.Importe
|
||||
CveTipoTransaccion = ObjIE.CveTipoTransaccion
|
||||
Banco = ObjIE.Banco
|
||||
NumCuenta = ObjIE.NumCuenta
|
||||
FormatoCheque = String.Format("Cheques\{0}.xlsm", ObjIE.CveCuenta)
|
||||
|
||||
NumCuenta = ObjIE.NumCuenta
|
||||
|
||||
TextoImporte = String.Format("--- {0} ---", Importe.Texto2Letras(ObjIE.CveMoneda))
|
||||
FechaExpedicion = ObjIE.FechaDocumento
|
||||
Observacion = ObjIE.Observaciones
|
||||
@@ -1849,12 +1810,9 @@ Namespace Extensiones
|
||||
AbonoCuenta = If(ObjIE.EsAbonoEnCuenta, "PARA ABONO EN CUENTA DEL BENEFICIARIO", "")
|
||||
NotificarA = ObjIE.NotificarA
|
||||
tIdPoliza = ObjIE.IDPoliza
|
||||
|
||||
If ObjIE.Bancos_IEImpreso(True, pCveIE) Then
|
||||
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -1888,42 +1846,25 @@ Namespace Extensiones
|
||||
|
||||
IVA = PreP.DtResultados.SUM("Importe", "CveConceptoContable = 19") ' concepto de IVA
|
||||
|
||||
If CveProveedor > 0 Then
|
||||
'Dim CveUsuarioResponsable As Integer = 0
|
||||
|
||||
If CveProveedor > 0 Then
|
||||
|
||||
Dim Prov As New ClsCompProveedores
|
||||
If Prov.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, CveProveedor, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, tCveEmpresa) Then
|
||||
If Prov.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
RFC = Prov.DtResultados.Rows(0)("RFC").ToString
|
||||
Correo = Prov.DtResultados.Rows(0)("ContactoMail").ToString
|
||||
' CveUsuarioResponsable = Prov.DtResultados.Rows(0)("CveUsuarioResponsable").ToString.ToEntero
|
||||
|
||||
|
||||
'Banco = Prov.DtResultados.Rows(0)("BancNombre").ToString
|
||||
'NumCuenta = Prov.DtResultados.Rows(0)("BancCuenta").ToString
|
||||
'If NumCuenta = "" Then NumCuenta = Prov.DtResultados.Rows(0)("BancCIE").ToString
|
||||
'CLABE = Prov.DtResultados.Rows(0)("BancCLABE").ToString
|
||||
'If CLABE = "" Then CLABE = Prov.DtResultados.Rows(0)("BancReferencia").ToString
|
||||
'NoSucursal = Prov.DtResultados.Rows(0)("BancSucursal").ToString
|
||||
|
||||
' UsuarioResponsable = Prov.DtResultados.Rows(0)("NotificarA").ToString
|
||||
|
||||
'If CveUsuarioResponsable > 0 Then
|
||||
' Dim Usr As New ClsSisUsuarios
|
||||
|
||||
' If Usr.GetUsuarios(CveUsuarioResponsable) Then
|
||||
' UsuarioResponsable = Usr.DtResultados.FiltroPrimero(String.Format("CveUsuario = {0}", CveUsuarioResponsable))("Correo").ToString
|
||||
' End If
|
||||
|
||||
' Usr.Dispose()
|
||||
|
||||
'End If
|
||||
Correo = Prov.DtResultados.Rows(0)("ContactoMail").ToString
|
||||
'Banco = Prov.DtResultados.Rows(0)("BancNombre").ToString
|
||||
'NumCuenta = Prov.DtResultados.Rows(0)("BancCuenta").ToString
|
||||
'If NumCuenta = "" Then NumCuenta = Prov.DtResultados.Rows(0)("BancCIE").ToString
|
||||
'CLABE = Prov.DtResultados.Rows(0)("BancCLABE").ToString
|
||||
'If CLABE = "" Then CLABE = Prov.DtResultados.Rows(0)("BancReferencia").ToString
|
||||
'NoSucursal = Prov.DtResultados.Rows(0)("BancSucursal").ToString
|
||||
|
||||
' UsuarioResponsable = Prov.DtResultados.Rows(0)("NotificarA").ToString
|
||||
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
|
||||
Prov.Dispose()
|
||||
End If
|
||||
|
||||
@@ -1936,135 +1877,16 @@ Namespace Extensiones
|
||||
NumCuenta = RH.DtResultados.Rows(0)("BancoNumCuenta").ToString
|
||||
CLABE = RH.DtResultados.Rows(0)("CLABE").ToString
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
|
||||
RH.Dispose()
|
||||
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
PreP.Dispose()
|
||||
|
||||
'Try
|
||||
' 'cuando es transferencia
|
||||
' Dim Excel As msExcel.Application = New msExcel.Application()
|
||||
' Dim VB_Module As VBComponent = Nothing
|
||||
' Excel.Visible = True
|
||||
' Excel.ScreenUpdating = True
|
||||
' Excel.DisplayAlerts = True
|
||||
' FormatoCheque = String.Format("Cheques\Transferencia-{0}.xlsm", ObjIE.CveCuenta)
|
||||
|
||||
' If Not IO.File.Exists(String.Format("{0}Cheques\", Ruta)) Then IO.Directory.CreateDirectory(String.Format("{0}Cheques\", Ruta))
|
||||
|
||||
' If Not IO.File.Exists(String.Format("{0}{1}", Ruta, FormatoCheque)) Then
|
||||
' IO.File.Copy(String.Format("{0}Empresas\Grales\Transferencia.xlsm", ModExtensiones.DirectorioBaseEmpresas), String.Format("{0}{1}", Ruta, FormatoCheque), False)
|
||||
' End If
|
||||
|
||||
' Dim ArchivoBase As New System.IO.FileInfo(String.Format("{0}{1}", Ruta, FormatoCheque))
|
||||
' If Not IO.Directory.Exists(String.Format("{0}Formatos\", Ruta)) Then IO.Directory.CreateDirectory(String.Format("{0}Formatos\", Ruta))
|
||||
' ArchivoBase.CopyTo(String.Format("{0}Formatos\Transferencia-{1}.xlsm", Ruta, pCveIE), True)
|
||||
' Dim ArchivoTemp As New System.IO.FileInfo(String.Format("{0}Formatos\Transferencia-{1}.xlsm", Ruta, pCveIE))
|
||||
|
||||
|
||||
' Dim Libro As msExcel.Workbook = Excel.Workbooks.Open(ArchivoTemp.FullName, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing)
|
||||
' Libro.Activate()
|
||||
|
||||
' Dim Hoja As msExcel.Worksheet = CType(Libro.Worksheets(1), Microsoft.Office.Interop.Excel.Worksheet)
|
||||
' Hoja.Visible = Microsoft.Office.Interop.Excel.XlSheetVisibility.xlSheetVisible
|
||||
' Hoja.Activate()
|
||||
' Try
|
||||
|
||||
' If CveTipoTransaccion = 9 Then Hoja.Range("B1:B1").Value = String.Format("{0}{1}Pago Layout ", Hoja.Range("B1:B1").Value, vbLf)
|
||||
' Hoja.Range("G3:G3").Value = String.Format("Folio: {0}", Folio)
|
||||
' Hoja.Range("G3:G3").HorizontalAlignment = -4152 'xlRight
|
||||
' Hoja.Range("A3:A3").Value = FechaExpedicion.ToString("yyyy-MM-dd")
|
||||
' Hoja.Range("A5:A5").Value = PagueseA
|
||||
' Hoja.Range("A8:A8").Value = Importe.ToString("N2")
|
||||
' Hoja.Range("C8:C8").Value = TextoImporte.ToUpper
|
||||
' Hoja.Range("A10:A10").Value = Banco
|
||||
' 'Crediproveedor
|
||||
' If RefCrediproveedor <> "" Then
|
||||
' Hoja.Range("F10:F10").Value = RefCrediproveedor
|
||||
' Hoja.Range("F11:F11").Value = "Crediproveedor"
|
||||
' End If
|
||||
' Hoja.Range("A12:A12").Value = NumCuenta
|
||||
' Hoja.Range("D12:D12").Value = NoSucursal
|
||||
' Hoja.Range("F12:F12").Value = CLABE
|
||||
' Hoja.Range("A15:A15").Value = Observacion
|
||||
' Hoja.Range("A19:A19").Value = RFC
|
||||
' Hoja.Range("D19:D19").Value = IVA.FormatoNumero
|
||||
' Hoja.Range("A21:A21").Value = Correo
|
||||
' Hoja.Range("F21:F21").Value = Telefono
|
||||
' Hoja.Range("B24:B24").Value = NotificarA
|
||||
' Hoja.Range("A26:A26").Value = SubProyecto
|
||||
' Hoja.Range("A30:A30").Value = UsuarioRegistro
|
||||
|
||||
' 'Exportar PDF
|
||||
' Dim pdfFileOut As String = String.Format("{0}PDF\Transf-{1}.pdf", Ruta, pCveIE)
|
||||
' Dim outputFileName As Object = pdfFileOut
|
||||
' Dim fileFormat As msExcel.XlFixedFormatType = msExcel.XlFixedFormatType.xlTypePDF
|
||||
' Libro.ExportAsFixedFormat(fileFormat, outputFileName, missing, missing, missing, missing, missing, missing, missing)
|
||||
' Catch ex As Exception
|
||||
' Dim Msgerr As String = ""
|
||||
' Msgerr.Alert(String.Format("Ocurrió un error {0}", ex.Message), TipoMensaje.MsgError)
|
||||
' End Try
|
||||
' System.Runtime.InteropServices.Marshal.ReleaseComObject(Hoja)
|
||||
' Hoja = Nothing
|
||||
' Dim saveChanges As Object = msExcel.XlSaveAction.xlDoNotSaveChanges
|
||||
' CType(Libro, msExcel._Workbook).Close(saveChanges, missing, missing)
|
||||
' System.Runtime.InteropServices.Marshal.ReleaseComObject(Libro)
|
||||
' Libro = Nothing
|
||||
' Excel.Quit()
|
||||
' System.Runtime.InteropServices.Marshal.ReleaseComObject(Excel)
|
||||
' Excel = Nothing
|
||||
' GC.Collect()
|
||||
' GC.WaitForPendingFinalizers()
|
||||
|
||||
' ArchivoTemp.Delete()
|
||||
|
||||
|
||||
' If MuestraAlert Then
|
||||
' Dim Descargas As New StringBuilder()
|
||||
' Descargas.AppendFormat("<li><a class=""Texto"" target='_blank' href=""/Empresas/{0}/PDF/Transf-{1}.pdf?{2}"">Transferencia</a></li>", tCveEmpresa, pCveIE, Now.Ticks)
|
||||
' Descargas.AppendFormat("<li><a class=""Texto"" target='_blank' href=""/Bancos/Reportes.aspx?Opcion=ImprimeMov&CveIE={0}"">Listado</a></li>", pCveIE)
|
||||
' If IDPoliza > 0 Then Descargas.AppendFormat("<li><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Póliza</a></li>", IDPoliza)
|
||||
' Dim Msg As String = String.Format("<br />El Documento se generó correctamente.<br /><br /><br />Descargas:<ul>{0}</ul>", Descargas.ToString) 'TipoMensaje.MsgInformacion
|
||||
|
||||
' Msg.Alert(Msg, TipoMensaje.MsgInformacion, String.Format("document.location.href=""{0}""", HttpContext.Current.Request.Url.AbsoluteUri))
|
||||
' End If
|
||||
|
||||
|
||||
|
||||
'Catch ex As Exception
|
||||
' Dim Msg As String = "No se pudo generar el documento."
|
||||
' Msg.OnError(Msg, ex, "CveIE=" & pCveIE)
|
||||
'End Try
|
||||
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
'End If
|
||||
|
||||
|
||||
' RegistraScript("AbrirVentana('/Ventas/PopUpImprimir.aspx?CveVenta=" & If(EsVistaPrevia, UsuarioActual.CveUsuario.ToString, Folio) & "&Ext=PDF', 700, 400, 'N', 'ImpVenta')")
|
||||
|
||||
|
||||
End Sub
|
||||
Private Function GetMacro() As String
|
||||
Dim SB As New StringBuilder
|
||||
SB.Append(" Sub AddRow(Row As String) " & vbLf)
|
||||
SB.Append(" Rows(Row & "":"" & Row).Select " & vbLf)
|
||||
SB.Append(" Selection.Copy " & vbLf)
|
||||
SB.Append(" Selection.Insert Shift:=xlDown " & vbLf)
|
||||
SB.Append(" End Sub ")
|
||||
Return SB.ToString
|
||||
End Function
|
||||
|
||||
|
||||
PreP.Dispose()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
<Runtime.CompilerServices.Extension()>
|
||||
Public Sub ExportToExcel2(GridView As GridView, NombreArchivoXLSX As String)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user