487 lines
25 KiB
VB.net
487 lines
25 KiB
VB.net
Option Explicit On
|
|
Option Strict On
|
|
|
|
Imports System.Data
|
|
Imports Extensiones
|
|
|
|
Partial Class Bancos_NotificacionCheques
|
|
Inherits ClsPaginas
|
|
|
|
#Region "Propiedades"
|
|
Private Property DtPorNotificar As DataTable
|
|
Get
|
|
DtPorNotificar = DirectCast(ViewState("DtPorNotificar"), DataTable)
|
|
End Get
|
|
|
|
Set(ByVal value As DataTable)
|
|
ViewState("DtPorNotificar") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property DtPorEntregar As DataTable
|
|
Get
|
|
DtPorEntregar = DirectCast(ViewState("DtPorEntregar"), DataTable)
|
|
End Get
|
|
|
|
Set(ByVal value As DataTable)
|
|
ViewState("DtPorEntregar") = value
|
|
End Set
|
|
End Property
|
|
#End Region
|
|
|
|
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
|
If Not Page.IsPostBack Then
|
|
txtFechaI.Text = Now.AddMonths(-1).FirstDayOfMonth.ToShortDateString
|
|
txtFechaF.Text = Now.ToShortDateString
|
|
CargaTipoTransaccion("Egs")
|
|
CargaPorNotificar()
|
|
CargaPorEntregar()
|
|
End If
|
|
End Sub
|
|
Private Sub CargaTipoTransaccion(Tipo As String)
|
|
DdlTipoTransaccion.Items.Clear()
|
|
If Tipo <> "" And Tipo <> "-1" Then
|
|
DdlTipoTransaccion.DataSource = GlobalDTTipoTransacciones.FiltraParametros(String.Format("CveTipoTransaccion IN (1,2) AND Tipo = '{0}' ", Tipo))
|
|
DdlTipoTransaccion.DataBind()
|
|
Else
|
|
DdlTipoTransaccion.DataSource = GlobalDTTipoTransacciones
|
|
DdlTipoTransaccion.DataBind()
|
|
End If
|
|
DdlTipoTransaccion.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
End Sub
|
|
|
|
'Private Sub CreaDTPorNotificar()
|
|
' DtPorNotificar = New DataTable
|
|
' DtPorNotificar.Columns.Add("Folio", GetType(String))
|
|
' DtPorNotificar.Columns.Add("FechaDocumento", GetType(DateTime))
|
|
' DtPorNotificar.Columns.Add("Banco", GetType(String))
|
|
' DtPorNotificar.Columns.Add("PagueseA", GetType(String))
|
|
' DtPorNotificar.Columns.Add("ProvCorreo", GetType(String))
|
|
' DtPorNotificar.Columns.Add("ProvTelefono", GetType(String))
|
|
' DtPorNotificar.Columns.Add("RHCorreo", GetType(String))
|
|
' DtPorNotificar.Columns.Add("RHTelefono", GetType(String))
|
|
' DtPorNotificar.Columns.Add("Importe", GetType(Decimal))
|
|
|
|
' DtPorNotificar.Columns.Add("CveIE", GetType(Integer))
|
|
' DtPorNotificar.Columns.Add("CveProveedor", GetType(Integer))
|
|
' DtPorNotificar.Columns.Add("CvePersonal", GetType(Integer))
|
|
'End Sub
|
|
|
|
Protected Sub CargaPorNotificar()
|
|
Dim objIE As New ClsBancos
|
|
|
|
If objIE.GetBancosIENotificaciones(txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, -1, If(TxtPagueseA.Text.Trim <> "", TxtPagueseA.Text.Trim & "%", "-1"), DdlCorreo.SelectedValue.ToEntero, 0, UsuarioActual.CveEmpresa) Then
|
|
DtPorNotificar = objIE.DtResultados
|
|
End If
|
|
|
|
objIE.Dispose()
|
|
CargaGridPorNotificar()
|
|
End Sub
|
|
|
|
Protected Sub CargaGridPorNotificar()
|
|
GvPorNotificar.DataSource = DtPorNotificar
|
|
GvPorNotificar.DataBind()
|
|
uppPorNotificar.Update()
|
|
End Sub
|
|
|
|
Protected Sub CargaPorEntregar()
|
|
Dim objIE As New ClsBancos
|
|
|
|
If objIE.GetBancosIENotificaciones(txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, 1, If(TxtPagueseA.Text.Trim <> "", TxtPagueseA.Text.Trim & "%", "-1"), DdlCorreo.SelectedValue.ToEntero, 1, UsuarioActual.CveEmpresa) Then
|
|
DtPorEntregar = objIE.DtResultados
|
|
End If
|
|
|
|
objIE.Dispose()
|
|
CargaGridPorEntregar()
|
|
End Sub
|
|
|
|
Protected Sub CargaGridPorEntregar()
|
|
gvPorEntregar.DataSource = DtPorEntregar
|
|
gvPorEntregar.DataBind()
|
|
uppPorEntregar.Update()
|
|
End Sub
|
|
|
|
Protected Sub GvPorEntregar_RowCancelingEdit(sender As Object, e As GridViewCancelEditEventArgs) Handles gvPorEntregar.RowCancelingEdit
|
|
gvPorEntregar.EditIndex = -1
|
|
CargaGridPorEntregar()
|
|
End Sub
|
|
|
|
Protected Sub GvPorNotificar_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GvPorNotificar.RowEditing
|
|
GvPorNotificar.EditIndex = e.NewEditIndex
|
|
CargaGridPorNotificar()
|
|
End Sub
|
|
|
|
Protected Sub GvPorEntregar_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles gvPorEntregar.RowEditing
|
|
gvPorEntregar.EditIndex = e.NewEditIndex
|
|
CargaGridPorEntregar()
|
|
End Sub
|
|
|
|
Protected Sub GvPorNotificar_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvPorNotificar.RowUpdating
|
|
'ACTUALIZAR EL CORREO DEL PROVEEDOR o RH
|
|
Dim ActualizoA As String = ""
|
|
Dim Correo As String = GvPorNotificar.Rows(e.RowIndex).FCTextBox("txtCorreo").Text
|
|
|
|
If Not IsDBNull(GvPorNotificar.Rows(e.RowIndex).DataKey("CveProveedor")) AndAlso GvPorNotificar.Rows(e.RowIndex).DataKey("CveProveedor").ToEntero > 0 Then
|
|
'Actualizar a el Proveedor
|
|
ActualizoA = "PROV"
|
|
|
|
'Dim objProv As New ClsCompProveedores
|
|
|
|
'If objProv.UpdateProveedor(
|
|
|
|
'objProv.Dispose()
|
|
ElseIf Not IsDBNull(GvPorNotificar.Rows(e.RowIndex).DataKey("CvePersonal")) AndAlso GvPorNotificar.Rows(e.RowIndex).DataKey("CvePersonal").ToEntero > 0 Then
|
|
ActualizoA = "RH"
|
|
' e.Row.FCLiteral("ltlCorreo").Text = e.Row.DBCampo("RHCorreo").ToString
|
|
' e.Row.FCLiteral("ltlTelefono").Text = e.Row.DBCampo("RHTelefono").ToString
|
|
End If
|
|
|
|
Dim dr As DataRow() = DtPorNotificar.Select("CveIE = " & GvPorNotificar.Rows(e.RowIndex).DataKey("CveIE").ToString.ToEntero)
|
|
'Dim totalanterior As Double = dr(0)("Total").ToString.ToDouble
|
|
If ActualizoA = "PROV" Then
|
|
dr(0)("ProvCorreo") = Correo
|
|
Else
|
|
dr(0)("RHCorreo") = Correo
|
|
End If
|
|
|
|
DtPorNotificar.AcceptChanges()
|
|
GvPorNotificar.EditIndex = -1
|
|
CargaGridPorNotificar()
|
|
End Sub
|
|
|
|
Protected Sub GvPorNotificar_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvPorNotificar.RowDataBound
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
Dim ProvRH As String = ""
|
|
|
|
If Not IsDBNull(e.Row.DBCampo("CveProveedor")) AndAlso e.Row.DBCampo("CveProveedor").ToEntero > 0 Then
|
|
ProvRH = "PROV"
|
|
ElseIf Not IsDBNull(e.Row.DBCampo("CvePersonal")) AndAlso e.Row.DBCampo("CvePersonal").ToEntero > 0 Then
|
|
ProvRH = "RH"
|
|
Else
|
|
ProvRH = ""
|
|
End If
|
|
|
|
If ProvRH = "PROV" Then
|
|
e.Row.FCTextBox("txtCorreo").Text = e.Row.DBCampo("ProvCorreo").ToString
|
|
e.Row.FCLiteral("ltlTelefono").Text = e.Row.DBCampo("ProvTelefono").ToString
|
|
e.Row.FCHyperLink("HLPagueseA").NavigateUrl = String.Format("/Compras/Proveedores.aspx?CveProveedor={0}", e.Row.DBCampo("CveProveedor"))
|
|
ElseIf ProvRH = "RH" Then
|
|
e.Row.FCTextBox("txtCorreo").Text = e.Row.DBCampo("RHCorreo").ToString
|
|
e.Row.FCLiteral("ltlTelefono").Text = e.Row.DBCampo("RHTelefono").ToString
|
|
e.Row.FCHyperLink("HLPagueseA").NavigateUrl = String.Format("/RH/Personal.aspx?CvePersonal={0}", e.Row.DBCampo("CvePersonal"))
|
|
Else
|
|
e.Row.FCCheckBox("chkNotificar").Enabled = False
|
|
e.Row.FCHyperLink("HLPagueseA").Enabled = False
|
|
End If
|
|
|
|
If e.Row.DBCampo("Comprobante") <> "" Then
|
|
e.Row.FCHyperLink("HLComprobante").Visible = True
|
|
e.Row.FCHyperLink("HLComprobante").NavigateUrl = String.Format("\Empresas\{0}\IE\{1}", UsuarioActual.CveEmpresa, e.Row.DBCampo("Comprobante"))
|
|
End If
|
|
|
|
End If
|
|
End Sub
|
|
|
|
Protected Sub GvPorEntregar_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles gvPorEntregar.RowDataBound
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
|
|
If Not IsDBNull(e.Row.DBCampo("CveProveedor")) AndAlso e.Row.DBCampo("CveProveedor").ToEntero > 0 Then
|
|
e.Row.FCLiteral("ltlCorreo").Text = e.Row.DBCampo("ProvCorreo").ToString
|
|
e.Row.FCLiteral("ltlTelefono").Text = e.Row.DBCampo("ProvTelefono").ToString
|
|
ElseIf Not IsDBNull(e.Row.DBCampo("CvePersonal")) AndAlso e.Row.DBCampo("CvePersonal").ToEntero > 0 Then
|
|
e.Row.FCLiteral("ltlCorreo").Text = e.Row.DBCampo("RHCorreo").ToString
|
|
e.Row.FCLiteral("ltlTelefono").Text = e.Row.DBCampo("RHTelefono").ToString
|
|
Else
|
|
e.Row.FCImageButton("ibNotificarDeNuevo").Enabled = False
|
|
End If
|
|
End If
|
|
End Sub
|
|
|
|
Protected Sub btnPorNotificar_Click(sender As Object, e As EventArgs) Handles btnPorNotificar.Click
|
|
For Each Row As GridViewRow In GvPorNotificar.Rows
|
|
If Row.FCCheckBox("chkNotificar").Checked = True Then
|
|
Dim Param As New List(Of String)
|
|
|
|
Param.Add(Row.FCTextBox("txtCorreo").Text) 'Para
|
|
'Param.Add("jonaslopez@gmail.com") 'Para
|
|
Param.Add("Notificación de Pago") 'Asunto
|
|
Param.Add(GeneraCorreo(Row.DataKey("CveIE").ToEntero)) 'Body
|
|
Param.Add(Row.DataKey("CveIE").ToString) 'CveIE
|
|
Param.Add(Row.DataKey("CveTipoTransaccion").ToString) 'CveIE
|
|
Param.Add(If(Row.DataKey("Comprobante").ToString <> "", String.Format("{0}IE\{1}", UsuarioActual.Empresa.Ruta, Row.DataKey("Comprobante").ToString), "")) 'Archivo Adjunto
|
|
|
|
Dim Hilo As New Threading.Thread(AddressOf MandaCorreo)
|
|
Hilo.Start(Param)
|
|
End If
|
|
Next
|
|
|
|
Threading.Thread.Sleep(4000)
|
|
Alert("Se notificará a los beneficiarios seleccionados", TipoMensaje.MsgInformacion)
|
|
|
|
CargaPorNotificar()
|
|
CargaPorEntregar()
|
|
End Sub
|
|
|
|
Private Sub MandaCorreo(data As Object)
|
|
Dim Parametros As List(Of String) = DirectCast(data, List(Of String))
|
|
|
|
Dim Mail As New ClsSisMail()
|
|
Dim Para As String = Parametros(0)
|
|
Dim Asunto As String = Parametros(1)
|
|
Dim Body As String = Parametros(2)
|
|
Dim CveIE As Integer = Parametros(3).ToEntero
|
|
Dim CveTipoTransaccion As Integer = If(Parametros(4) IsNot Nothing, Parametros(4).ToEntero, 0)
|
|
'Dim Estatus As Integer = 1 If(CveTipoTransaccion = 2, 2, 1) ' cuando es transferencia, no lo pasa por entregar
|
|
|
|
|
|
'Dim ArrayAttachment As New List(Of String)
|
|
Dim ListaArchivos As New List(Of ClsSisMail.ArchivoMail)
|
|
If Parametros(5) IsNot Nothing AndAlso Parametros(5) <> "" Then
|
|
' ArrayAttachment.Add(Parametros(5).ToString)
|
|
ListaArchivos.Add(New ClsSisMail.ArchivoMail With {.Ruta = Parametros(5).ToString})
|
|
End If
|
|
|
|
If Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, Archivos:=ListaArchivos) Then
|
|
Dim objIE As New ClsBancos
|
|
objIE.UpdateBancos_IENotificaciones(1, "-1", "-1", CveIE)
|
|
objIE.Dispose()
|
|
End If
|
|
'If Mail.Mandacorreo(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, ArrayAttachment:=ArrayAttachment) Then
|
|
' Dim objIE As New ClsBancos
|
|
' objIE.UpdateBancos_IENotificaciones(1, "-1", "-1", CveIE)
|
|
' objIE.Dispose()
|
|
'End If
|
|
|
|
|
|
End Sub
|
|
|
|
Private Function GeneraCorreo(CveIE As Integer) As String
|
|
Dim strBody As New StringBuilder
|
|
Dim objIE As New ClsBancos
|
|
|
|
If objIE.GetBancosIE(CveIE, UsuarioActual.CveEmpresa) Then
|
|
strBody.Append("<html xmlns=""http://www.w3.org/1999/xhtml""> ")
|
|
strBody.Append("<head> ")
|
|
strBody.Append(" <style type=""text/css""> ")
|
|
strBody.Append(" body ")
|
|
strBody.Append(" { ")
|
|
strBody.Append(" margin:0px; ")
|
|
strBody.Append(" padding:0px 0px 0px 0px; ")
|
|
strBody.Append(" font-family: Verdana, Arial, Helvetica, sans-serif; ")
|
|
strBody.Append(" font-size: 10px; ")
|
|
strBody.Append(" background-color:#F0F0F0; ")
|
|
strBody.Append(" } ")
|
|
strBody.Append(" a.Texto ")
|
|
strBody.Append(" { ")
|
|
strBody.Append(" font-size:11px; ")
|
|
strBody.Append(" background-color:#F7F6F3; ")
|
|
strBody.Append(" text-decoration:none; ")
|
|
strBody.Append(" font-weight:bold; ")
|
|
strBody.Append(" } ")
|
|
strBody.Append(" .Texto ")
|
|
strBody.Append(" { ")
|
|
strBody.Append(" background-color:#F7F6F3; color:Black; font-family:Verdana; font-size:10px; text-align:center; vertical-align:middle; height:20px;")
|
|
strBody.Append(" } ")
|
|
strBody.Append(" .TextoAlterno ")
|
|
strBody.Append(" { ")
|
|
strBody.Append(" background-color:White; color:Black; font-family:Verdana; font-size:10px; text-align:center; ")
|
|
strBody.Append(" vertical-align:middle; height:20px;")
|
|
strBody.Append(" } ")
|
|
strBody.Append(" .BarraIdentidad ")
|
|
strBody.Append(" { ")
|
|
strBody.Append(" color:#FFFFFF; ")
|
|
strBody.Append(" background:#F0F0F0; ")
|
|
strBody.Append(" font-weight:bold; ")
|
|
strBody.Append(" font-size:19px; ")
|
|
strBody.Append(" font-style:oblique; ")
|
|
strBody.Append(" } ")
|
|
strBody.Append(" .Titulos ")
|
|
strBody.Append(" { ")
|
|
strBody.Append(" background-color: Gray;")
|
|
strBody.Append(" color:White; ")
|
|
strBody.Append(" font-family:Verdana; font-size:12px; text-align:center; ")
|
|
strBody.Append(" vertical-align:middle; font-weight:bold; height:30px; ")
|
|
strBody.Append(" text-decoration:none; ")
|
|
strBody.Append(" } ")
|
|
strBody.Append(" .Verde {color: #00CC00;} ")
|
|
strBody.Append(" .Negro {color: #000000;} ")
|
|
strBody.Append(" .Rojo {color: #FF0000;} ")
|
|
strBody.Append(" </style> ")
|
|
strBody.Append("</head> ")
|
|
strBody.Append("<body> ")
|
|
strBody.AppendFormat("<div id='C_div' style='width: 600px'>")
|
|
strBody.AppendFormat(" <fieldset>")
|
|
strBody.AppendFormat(" <legend><b>{0}</b></legend>", UsuarioActual.Empresa.Empresa)
|
|
strBody.AppendFormat(" <table class='TextoG' border='0' cellpadding='0' cellspacing='0' width='100%'>")
|
|
strBody.AppendFormat(" <tr>")
|
|
strBody.AppendFormat(" <td style='width:100px'>{0}</td>", UsuarioActual.Empresa.Direccion)
|
|
strBody.AppendFormat(" </tr>")
|
|
strBody.AppendFormat(" <tr>")
|
|
strBody.AppendFormat(" <td>Col. {0}</td>", UsuarioActual.Empresa.Colonia)
|
|
strBody.AppendFormat(" </tr>")
|
|
strBody.AppendFormat(" <tr>")
|
|
strBody.AppendFormat(" <td>{0}, {1}, C.P.{2}</td>", UsuarioActual.Empresa.Ciudad, UsuarioActual.Empresa.Estado, UsuarioActual.Empresa.CP)
|
|
strBody.AppendFormat(" </tr>")
|
|
strBody.AppendFormat(" <tr>")
|
|
strBody.AppendFormat(" <td>RFC {0}</td>", UsuarioActual.Empresa.RFC)
|
|
strBody.AppendFormat(" </tr>")
|
|
strBody.AppendFormat(" </table>")
|
|
strBody.AppendFormat(" </fieldset>")
|
|
strBody.AppendFormat("</div><br/><br/>")
|
|
|
|
strBody.AppendFormat("<div style='width: 600px'>")
|
|
strBody.AppendFormat(" <fieldset>")
|
|
strBody.AppendFormat(" <legend><b> </b></legend>")
|
|
strBody.AppendFormat(" <table class='TextoG' style='width:100%'>")
|
|
|
|
If objIE.CveTipoTransaccion = 1 Then ' cuando es cheque
|
|
strBody.Append(" <tr style=""height: 22px""> ")
|
|
strBody.Append(" <td>Usted puede pasar a recoger el cheque en las oficinas administrativas.</td> ")
|
|
strBody.Append(" </tr> ")
|
|
End If
|
|
|
|
If objIE.CveTipoTransaccion = 2 Then ' cuando es transf
|
|
strBody.Append(" <tr style=""height: 22px""> ")
|
|
strBody.Append(" <td>Se notifica el envío de transferencia de pago.</td> ")
|
|
strBody.Append(" </tr> ")
|
|
End If
|
|
|
|
strBody.Append(" <tr style=""height: 22px""> ")
|
|
strBody.AppendFormat(" <td> </td> ")
|
|
strBody.Append(" </tr> ")
|
|
strBody.Append(" </table> ")
|
|
strBody.Append(" </div> ")
|
|
|
|
|
|
strBody.AppendFormat("<div style='width: 600px'>")
|
|
strBody.AppendFormat(" <table style='width:100%'>")
|
|
strBody.AppendFormat(" <tr>")
|
|
strBody.AppendFormat(" <td style='vertical-align: top'>")
|
|
strBody.AppendFormat(" <fieldset>")
|
|
strBody.AppendFormat(" <legend>Beneficiario:<b>{0}</b> </legend>", objIE.PagueseA)
|
|
strBody.AppendFormat(" <table width='100%'>")
|
|
strBody.AppendFormat(" <tr style='background-color: gray; color: White; font-family: Verdana; font-size: 10px; text-align: center; vertical-align: middle; font-weight: bold; height: 20px; text-decoration: none;'>")
|
|
strBody.AppendFormat(" <th scope='col' style='width: 50%'></th>")
|
|
strBody.AppendFormat(" <th scope='col' style='width: 50%'></th>")
|
|
strBody.AppendFormat(" </tr>")
|
|
strBody.AppendFormat(" <tr class='Texto'>")
|
|
strBody.AppendFormat(" <td>Movimiento:</td>")
|
|
strBody.AppendFormat(" <td style='text-align: left'>{0}</td>", objIE.TipoTransaccion)
|
|
strBody.AppendFormat(" </tr>")
|
|
strBody.AppendFormat(" <tr class='Texto'>")
|
|
strBody.AppendFormat(" <td>Banco:</td>")
|
|
strBody.AppendFormat(" <td style='text-align: left'>{0}</td>", objIE.Banco)
|
|
strBody.AppendFormat(" </tr>")
|
|
strBody.AppendFormat(" <tr class='Texto'>")
|
|
strBody.AppendFormat(" <td>Fecha:</td>")
|
|
strBody.AppendFormat(" <td style='text-align: left'>{0}</td>", objIE.FechaDocumento.ToString("dd/MM/yyyy"))
|
|
strBody.AppendFormat(" </tr>")
|
|
strBody.AppendFormat(" <tr class='Texto'>")
|
|
strBody.AppendFormat(" <td>Importe:</td>")
|
|
strBody.AppendFormat(" <td style='text-align: left'>$ {0} {1}</td>", objIE.Importe.FormatoNumero, objIE.Moneda)
|
|
strBody.AppendFormat(" </tr>")
|
|
strBody.AppendFormat(" <tr class='Texto'>")
|
|
strBody.AppendFormat(" <td>Observaciones:</td>")
|
|
strBody.AppendFormat(" <td style='text-align: left'>{0}</td>", objIE.Observaciones)
|
|
strBody.AppendFormat(" </tr>")
|
|
strBody.AppendFormat(" <tr class='Texto'>")
|
|
strBody.AppendFormat(" <td colspan='2'>")
|
|
strBody.AppendFormat(" <hr />")
|
|
strBody.AppendFormat(" </td>")
|
|
strBody.AppendFormat(" </tr>")
|
|
strBody.AppendFormat(" </table>")
|
|
strBody.AppendFormat(" </fieldset>")
|
|
strBody.AppendFormat(" </td>")
|
|
strBody.AppendFormat(" </tr>")
|
|
strBody.AppendFormat(" </table>")
|
|
strBody.AppendFormat("</div>")
|
|
|
|
|
|
'MOVIMIENTOS CHEQUE
|
|
If objIE.GetBancosIEMovimientos(CveIE, UsuarioActual.CveEmpresa) Then
|
|
|
|
strBody.AppendFormat("<div style='width: 600px'>")
|
|
strBody.AppendFormat(" <table style='width:600px'>")
|
|
strBody.AppendFormat(" <tr>")
|
|
strBody.AppendFormat(" <td style='vertical-align: top'>")
|
|
strBody.AppendFormat(" <fieldset>")
|
|
strBody.AppendFormat(" <legend><b>Facturas Pagadas</b> </legend>")
|
|
strBody.AppendFormat(" <table width='600px'>")
|
|
strBody.AppendFormat(" <tr style='background-color: gray; color: White; font-family: Verdana; font-size: 10px; text-align: center; vertical-align: middle; font-weight: bold; height: 20px; text-decoration: none;'>")
|
|
strBody.AppendFormat(" <th scope='col' style='width: 33%'>Fecha</th>")
|
|
strBody.AppendFormat(" <th scope='col' style='width: 33%'>Factura</th>")
|
|
strBody.AppendFormat(" <th scope='col' style='width: 33%'>Importe ($)</th>")
|
|
strBody.AppendFormat(" </tr>")
|
|
|
|
|
|
For Each dr As DataRow In objIE.DtResultados.FiltraParametros("CveConceptoContable IN (17) AND CveCompra > 0").Rows
|
|
strBody.AppendFormat(" <tr class='Texto'>")
|
|
strBody.AppendFormat(" <td>{0}</td>", dr("Fecha").ToString.ToDate.ToShortDateString())
|
|
strBody.AppendFormat(" <td>{0}</td>", dr("SerieFolio").ToString)
|
|
strBody.AppendFormat(" <td style='text-align: right'>$ {0}</td>", dr("Importe").ToString.FormatoNumero)
|
|
strBody.AppendFormat(" </tr>")
|
|
Next
|
|
|
|
|
|
strBody.AppendFormat(" <tr class='Texto'>")
|
|
strBody.AppendFormat(" <td colspan='3'>")
|
|
strBody.AppendFormat(" <hr />")
|
|
strBody.AppendFormat(" </td>")
|
|
strBody.AppendFormat(" </tr>")
|
|
strBody.AppendFormat(" </table>")
|
|
strBody.AppendFormat(" </fieldset>")
|
|
strBody.AppendFormat(" </td>")
|
|
strBody.AppendFormat(" </tr>")
|
|
strBody.AppendFormat(" </table>")
|
|
strBody.AppendFormat("</div>")
|
|
End If
|
|
|
|
strBody.Append(" <div> Favor de no responder a este correo. </div> ")
|
|
|
|
strBody.Append("</body></html>")
|
|
End If
|
|
|
|
objIE.Dispose()
|
|
Return strBody.ToString
|
|
End Function
|
|
|
|
Protected Sub ibNotificarDeNuevo_Click(sender As Object, e As ImageClickEventArgs)
|
|
Dim ibtn As ImageButton = DirectCast(sender, ImageButton)
|
|
Dim gvr As GridViewRow = DirectCast(ibtn.NamingContainer, GridViewRow)
|
|
|
|
|
|
Dim Param As New List(Of String)
|
|
|
|
Param.Add(gvr.FCLiteral("LtlCorreo").Text) 'Para
|
|
'Param.Add("jonaslopez@gmail.com") 'Para
|
|
Param.Add("Notificaciones de pago") 'Asunto
|
|
Param.Add(GeneraCorreo(gvr.DataKey("CveIE").ToEntero)) 'Body
|
|
Param.Add(gvr.DataKey("CveIE").ToString) 'CveIE
|
|
|
|
Dim Hilo As New Threading.Thread(AddressOf MandaCorreo)
|
|
Hilo.Start(Param)
|
|
|
|
' Alert(String.Format("Se Notificara a el correo {0}", Param(0)))
|
|
End Sub
|
|
|
|
Protected Sub ibEntregar_Click(sender As Object, e As ImageClickEventArgs)
|
|
Dim ibtn As ImageButton = DirectCast(sender, ImageButton)
|
|
Dim gvr As GridViewRow = DirectCast(ibtn.NamingContainer, GridViewRow)
|
|
|
|
Dim objIE As New ClsBancos
|
|
|
|
If objIE.UpdateBancos_IENotificaciones(2, Now.ToString("dd/MM/yyyy"), gvr.FCTextBox("txtObservacionEntrega").Text, gvr.DataKey("CveIE").ToEntero) Then
|
|
Alert("Cheque marcado como Entregado")
|
|
End If
|
|
|
|
objIE.Dispose()
|
|
gvPorEntregar.EditIndex = -1
|
|
CargaPorEntregar()
|
|
End Sub
|
|
|
|
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
|
CargaPorNotificar()
|
|
CargaPorEntregar()
|
|
End Sub
|
|
End Class
|