703 lines
32 KiB
VB.net
703 lines
32 KiB
VB.net
Imports System.Data
|
|
Imports Extensiones
|
|
|
|
Partial Class AIMMGM_Registro
|
|
Inherits Page
|
|
|
|
|
|
Private Property TmpDT As DataTable
|
|
Get
|
|
Return CType(ViewState("TmpDT"), DataTable)
|
|
End Get
|
|
Set(value As DataTable)
|
|
ViewState("TmpDT") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property DTPS As DataTable
|
|
Get
|
|
Return CType(ViewState("DTPS"), DataTable)
|
|
End Get
|
|
Set(value As DataTable)
|
|
ViewState("DTPS") = value
|
|
End Set
|
|
End Property
|
|
|
|
Property CveCliente() As Integer
|
|
Get
|
|
CveCliente = DirectCast(ViewState("CveCliente"), Integer)
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("CveCliente") = value
|
|
End Set
|
|
End Property
|
|
|
|
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
|
If Not Page.IsPostBack Then
|
|
|
|
'CType(Me.Master, BaseMasterPage).EsPopup = True
|
|
'CType(Me.Master, BaseMasterPage).PopupWidth = 1000
|
|
If Request("CveCliente") Is Nothing Then
|
|
PnlRegistro.Visible = False
|
|
Else
|
|
CveCliente = IfNull(Request("CveCliente"), "0").ToString.ToEntero
|
|
|
|
If CveCliente <= 0 Then
|
|
PnlRegistro.Visible = False
|
|
End If
|
|
End If
|
|
|
|
|
|
Dim ObjPS As New ClsProductosServicios()
|
|
If ObjPS.GetPS(-1, -1, 43) Then
|
|
'ViewState("DTPS") = ObjPS.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa & " AND Estado = 'Activo'", "PS")
|
|
ViewState("DTPS") = ObjPS.DtResultados.FiltraParametros("CveEmpresa = 43 AND Estado = 'Activo'", "PS")
|
|
|
|
End If
|
|
ObjPS.Dispose()
|
|
|
|
CreaTabla()
|
|
|
|
CargaRegistros("")
|
|
|
|
GvDias.DataSource = DTPS.FiltraParametros("Clasificacion = 'RegistroParcial' ")
|
|
GvDias.DataBind()
|
|
|
|
GvExtras.DataSource = DTPS.FiltraParametros("Clasificacion = 'Extras' ")
|
|
GvExtras.DataBind()
|
|
|
|
'verifico el total de ventas y si es mayor igual a 20 y lo oculto el producto
|
|
Dim dtExcursiones As DataTable = DTPS.FiltraParametros("Clasificacion = 'Excursiones' ")
|
|
Dim Contador As Integer = 0
|
|
For Each dr As DataRow In dtExcursiones.Rows
|
|
Dim AIM As New ClsAIMMGM
|
|
|
|
If AIM.RepVentasPS(1, -1, -1, -1, "01/01/2014".ToDate, NowADS(), 43) Then
|
|
Contador = AIM.DtResultados.COUNT("CvePS", "CvePS = " & dr("CvePS").ToString)
|
|
If Contador >= 20 Then
|
|
dr("CvePS") = 0
|
|
End If
|
|
End If
|
|
AIM.Dispose()
|
|
Next
|
|
|
|
GVExcursiones.DataSource = dtExcursiones.FiltraParametros("CvePS > 0")
|
|
GVExcursiones.DataBind()
|
|
|
|
GvCursos.DataSource = DTPS.FiltraParametros("Clasificacion = 'Cursos' ")
|
|
GvCursos.DataBind()
|
|
|
|
GvEventos.DataSource = DTPS.FiltraParametros("Clasificacion = 'Eventos Sociales' ")
|
|
GvEventos.DataBind()
|
|
|
|
'' set the transparency of the main map image to display other layers over the satellite map
|
|
|
|
End If
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub CargaRegistros(Opcion As String)
|
|
|
|
Dim dt As DataTable = DTPS.FiltraParametros("Clasificacion = 'Registro' ", "CvePS")
|
|
|
|
If Opcion = "Sonora" Then
|
|
dt = dt.FiltraParametros("CvePS IN (36972,36975,36976)")
|
|
ElseIf Opcion = "Otro" Then
|
|
dt = dt.FiltraParametros("CvePS IN (36973,31975,36976)")
|
|
Else
|
|
dt = dt.FiltraParametros("CvePS IN (36974,31975,36976)")
|
|
End If
|
|
Dim dr As DataRow = dt.NewRow
|
|
dr("CvePS") = 0
|
|
dr("PS") = "Visitante por día"
|
|
dr("Precio") = 0
|
|
dt.Rows.Add(dr)
|
|
dt.AcceptChanges()
|
|
GvRegistro.DataSource = dt
|
|
GvRegistro.DataBind()
|
|
End Sub
|
|
|
|
Private Sub CreaTabla()
|
|
TmpDT = New DataTable
|
|
TmpDT.Columns.Add("Consec", GetType(Integer))
|
|
TmpDT.Columns.Add("Cantidad", GetType(Double))
|
|
TmpDT.Columns.Add("Codigo", GetType(String))
|
|
TmpDT.Columns.Add("CveUM", GetType(Integer))
|
|
TmpDT.Columns.Add("UM", GetType(String))
|
|
TmpDT.Columns.Add("CveClasificacion", GetType(Integer))
|
|
TmpDT.Columns.Add("Clasificacion", GetType(String))
|
|
TmpDT.Columns.Add("CvePS", GetType(Integer))
|
|
TmpDT.Columns.Add("PS", GetType(String))
|
|
TmpDT.Columns.Add("Obs", GetType(String))
|
|
TmpDT.Columns.Add("PU", GetType(Double))
|
|
TmpDT.Columns.Add("IVA", GetType(Double))
|
|
TmpDT.Columns.Add("RetIVA", GetType(Double))
|
|
TmpDT.Columns.Add("Descuento", GetType(Double))
|
|
TmpDT.Columns.Add("TipoDescuento", GetType(Integer))
|
|
TmpDT.Columns.Add("Total", GetType(Double))
|
|
'Para uso del módulo contable
|
|
TmpDT.Columns.Add("AsientoContableVentas", GetType(Integer))
|
|
TmpDT.Columns.Add("AplicaParaConcepto", GetType(Boolean))
|
|
TmpDT.Columns.Add("CveProyecto", GetType(Integer))
|
|
TmpDT.Columns.Add("Proyecto", GetType(String))
|
|
TmpDT.Columns.Add("CveSubProyecto", GetType(Integer))
|
|
TmpDT.Columns.Add("SubProyecto", GetType(String))
|
|
TmpDT.Columns.Add("CveMoneda", GetType(Integer))
|
|
TmpDT.Columns.Add("Abreviatura", GetType(String))
|
|
'TipoDescuento: 1 = Descuento * PU; 2 = Descuento por Total del concepto
|
|
End Sub
|
|
|
|
Protected Sub BtnRegistro_Click(sender As Object, e As EventArgs) Handles BtnRegistro.Click
|
|
|
|
TmpDT.Clear()
|
|
Dim SeleccionarVisitante As Integer = 0
|
|
|
|
For Each gvr As GridViewRow In GvRegistro.Rows
|
|
If gvr.FCCheckBox("RBL").Checked Then
|
|
|
|
If gvr.DataKey("CvePS").ToEntero > 0 Then
|
|
Dim dr As DataRow = TmpDT.NewRow
|
|
dr("CvePS") = gvr.DataKey("CvePS")
|
|
dr("PS") = gvr.DataKey("PS")
|
|
dr("Total") = gvr.DataKey("Precio")
|
|
dr("CveMoneda") = gvr.DataKey("CveMoneda")
|
|
dr("Abreviatura") = gvr.DataKey("Abreviatura")
|
|
TmpDT.Rows.Add(dr)
|
|
Else
|
|
SeleccionarVisitante = 1
|
|
End If
|
|
|
|
End If
|
|
Next
|
|
|
|
|
|
'If Seleccionar = 0 Then
|
|
' Alert("Seleccione un registro", TipoMensaje.MsgAdvertencia)
|
|
' Exit Sub
|
|
'End If
|
|
Dim Contador As Integer = 0
|
|
For Each gvr As GridViewRow In GvDias.Rows
|
|
If gvr.FCCheckBox("RBL").Checked Then
|
|
Contador += 1
|
|
Dim dr As DataRow = TmpDT.NewRow
|
|
dr("CvePS") = gvr.DataKey("CvePS")
|
|
dr("PS") = gvr.DataKey("PS")
|
|
dr("Total") = gvr.DataKey("Precio")
|
|
dr("CveMoneda") = gvr.DataKey("CveMoneda")
|
|
dr("Abreviatura") = gvr.DataKey("Abreviatura")
|
|
TmpDT.Rows.Add(dr)
|
|
End If
|
|
Next
|
|
|
|
If SeleccionarVisitante = 1 AndAlso Contador = 0 Then
|
|
Alert("Seleccione una opción de visitante por día", TipoMensaje.MsgAdvertencia)
|
|
RegistraScript("$get('GvDias').style.display='';")
|
|
Exit Sub
|
|
End If
|
|
|
|
|
|
For Each gvr As GridViewRow In GvExtras.Rows
|
|
If gvr.FCCheckBox("RBL").Checked Then
|
|
|
|
Dim dr As DataRow = TmpDT.NewRow
|
|
dr("CvePS") = gvr.DataKey("CvePS")
|
|
dr("PS") = gvr.DataKey("PS")
|
|
dr("Total") = gvr.DataKey("Precio")
|
|
dr("CveMoneda") = gvr.DataKey("CveMoneda")
|
|
dr("Abreviatura") = gvr.DataKey("Abreviatura")
|
|
dr("Obs") = gvr.FCTextBox("TxtNombre").Text.Trim
|
|
TmpDT.Rows.Add(dr)
|
|
End If
|
|
Next
|
|
|
|
For Each gvr As GridViewRow In GVExcursiones.Rows
|
|
If gvr.FCCheckBox("RBL").Checked Then
|
|
|
|
Dim dr As DataRow = TmpDT.NewRow
|
|
dr("CvePS") = gvr.DataKey("CvePS")
|
|
dr("PS") = gvr.DataKey("PS")
|
|
dr("Total") = gvr.DataKey("Precio")
|
|
dr("CveMoneda") = gvr.DataKey("CveMoneda")
|
|
dr("Abreviatura") = gvr.DataKey("Abreviatura")
|
|
TmpDT.Rows.Add(dr)
|
|
If TxtProfesion.Text.Trim = "" Then
|
|
Alert("Ingrese por favor la profesión", TipoMensaje.MsgAdvertencia)
|
|
RegistraScript("$get('divprofesion').style.display='';")
|
|
Exit Sub
|
|
End If
|
|
End If
|
|
Next
|
|
|
|
For Each gvr As GridViewRow In GvCursos.Rows
|
|
If gvr.FCCheckBox("RBL").Checked Then
|
|
|
|
Dim dr As DataRow = TmpDT.NewRow
|
|
dr("CvePS") = gvr.DataKey("CvePS")
|
|
dr("PS") = gvr.DataKey("PS")
|
|
dr("Total") = gvr.DataKey("Precio")
|
|
dr("CveMoneda") = gvr.DataKey("CveMoneda")
|
|
dr("Abreviatura") = gvr.DataKey("Abreviatura")
|
|
TmpDT.Rows.Add(dr)
|
|
End If
|
|
Next
|
|
|
|
For Each gvr As GridViewRow In GvEventos.Rows
|
|
If gvr.FCCheckBox("RBL").Checked Then
|
|
|
|
Dim dr As DataRow = TmpDT.NewRow
|
|
dr("CvePS") = gvr.DataKey("CvePS")
|
|
dr("PS") = gvr.DataKey("PS")
|
|
dr("Total") = gvr.DataKey("Precio")
|
|
dr("CveMoneda") = gvr.DataKey("CveMoneda")
|
|
dr("Abreviatura") = gvr.DataKey("Abreviatura")
|
|
TmpDT.Rows.Add(dr)
|
|
End If
|
|
Next
|
|
|
|
PnlEventos.Visible = False
|
|
PnlPagar.Visible = True
|
|
|
|
GvCompras.DataSource = TmpDT
|
|
GvCompras.DataBind()
|
|
End Sub
|
|
|
|
Protected Sub GvCompras_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvCompras.RowDataBound
|
|
If e.Row.RowType = DataControlRowType.Footer Then
|
|
e.Row.FCLabel("LblTotal").Text = TmpDT.SUM("Total").ToString("N2") & " MXN"
|
|
End If
|
|
End Sub
|
|
|
|
Protected Sub BtnSiguiente_Click(sender As Object, e As EventArgs) Handles BtnSiguiente.Click
|
|
|
|
If TxtNombres.Text = "" Then
|
|
Alert("El campo <b>Nombre</b> es necesario, por favor ingréselo.", TipoMensaje.MsgAdvertencia)
|
|
Exit Sub
|
|
End If
|
|
If TxtAPaterno.Text = "" Then
|
|
Alert("El campo <b>Apellido Paterno</b> es necesario, por favor ingréselo.", TipoMensaje.MsgAdvertencia)
|
|
Exit Sub
|
|
End If
|
|
'If TxtEmail.Text = "" Then
|
|
' Alert("El campo <b>Correo</b> es necesario, por favor ingréselo.", TipoMensaje.MsgAdvertencia)
|
|
' Exit Sub
|
|
'End If
|
|
|
|
'If TxtTelefono.Text = "" Then
|
|
' Alert("El campo <b>Teléfono</b> es necesario, por favor ingréselo.", TipoMensaje.MsgAdvertencia)
|
|
' Exit Sub
|
|
'End If
|
|
|
|
PnlEventos.Visible = True
|
|
PnlRegistro.Visible = False
|
|
End Sub
|
|
|
|
|
|
Public Sub Alert(Mensaje As String, pOpcion As TipoMensaje, Optional JSBtnAceptar As String = "")
|
|
|
|
If System.Web.HttpContext.Current IsNot Nothing AndAlso System.Web.HttpContext.Current.Handler IsNot Nothing Then
|
|
Dim Img, Botones As String
|
|
Dim Titulo As String
|
|
Dim Plus As String = NowADS().Ticks.ToString
|
|
|
|
Mensaje = Mensaje.Replace("'"c, "\'")
|
|
JSBtnAceptar = JSBtnAceptar.Replace("'"c, "\'")
|
|
|
|
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)
|
|
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.Handler, Page)
|
|
'ScriptManager.RegisterStartupScript(Pag, Pag.GetType(), (NowADS().Ticks + 1).ToString(), "MuestraAlert('" & Alerta.ToString() & "', '" & Plus & "');", True)
|
|
ScriptManager.RegisterStartupScript(Pag, Pag.GetType(), (NowADS().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 If
|
|
|
|
End Sub
|
|
|
|
|
|
Protected Sub BtnRegresar1_Click(sender As Object, e As EventArgs) Handles BtnRegresar1.Click
|
|
PnlRegistro.Visible = True
|
|
PnlEventos.Visible = False
|
|
End Sub
|
|
Protected Sub BtnRegresar2_Click(sender As Object, e As EventArgs) Handles BtnRegresar2.Click
|
|
PnlEventos.Visible = True
|
|
PnlPagar.Visible = False
|
|
End Sub
|
|
|
|
|
|
Protected Sub BtnSocio_Click(sender As Object, e As EventArgs) Handles BtnSocio.Click
|
|
|
|
If TxtFolioSocio.Text.ToEntero = 0 Then
|
|
TxtAPaterno.Text = ""
|
|
TxtAMaterno.Text = ""
|
|
TxtNombres.Text = ""
|
|
TxtNombres.Enabled = True
|
|
HdnSocioDistrito.Value = ""
|
|
Else
|
|
|
|
Dim Prosp As New ClsProspectos
|
|
|
|
If Prosp.GetProspectos(-1, "-1", "-1", -1, -1, -1, -1, -1, TxtFolioSocio.Text.ToEntero, 43) Then
|
|
If Prosp.DtResultados.Rows.Count > 0 Then
|
|
Dim dr As DataRow = Prosp.DtResultados.Rows(0)
|
|
TxtAPaterno.Text = dr("ApellidoPaterno").ToString
|
|
TxtAMaterno.Text = dr("ApellidoMaterno").ToString
|
|
TxtNombres.Text = dr("Nombres").ToString
|
|
|
|
TxtNombres.Enabled = False
|
|
|
|
If dr("CveProspectoClasificacion").ToString.ToEntero = 61 Then
|
|
HdnSocioDistrito.Value = "Sonora"
|
|
Else
|
|
HdnSocioDistrito.Value = "Otro"
|
|
End If
|
|
Else
|
|
TxtAPaterno.Text = ""
|
|
TxtAMaterno.Text = ""
|
|
TxtNombres.Text = ""
|
|
TxtNombres.Enabled = True
|
|
HdnSocioDistrito.Value = ""
|
|
End If
|
|
|
|
End If
|
|
Prosp.Dispose()
|
|
End If
|
|
|
|
CargaRegistros(HdnSocioDistrito.Value)
|
|
End Sub
|
|
|
|
Protected Sub BtnRegistraCompra_Click(sender As Object, e As EventArgs) Handles BtnRegistraCompra.Click
|
|
|
|
|
|
Dim Nombre As String = TxtNombres.Text.Trim & " " & TxtAPaterno.Text.Trim & " " & TxtAMaterno.Text.Trim
|
|
Dim CveMetodoPago As Integer = 0
|
|
|
|
Dim Cliente As New ClsClientes
|
|
If Cliente.GetClientes(-1, Nombre, "-1", "-1", "-1", "-1", "-1", -1, 43, -1) Then
|
|
|
|
If Cliente.DtResultados.Rows.Count > 0 Then
|
|
CveMetodoPago = Cliente.CveMetodoPago
|
|
End If
|
|
|
|
End If
|
|
Cliente.Dispose()
|
|
|
|
Dim Errorr As Boolean = False
|
|
Dim Venta As New ClsVentas
|
|
Venta.IniciaTransacSQL()
|
|
Dim tnombre As String
|
|
Dim TieneExcursion As Boolean = False
|
|
'DdlFiscalMetodoPago.SelectedValue.ToEntero1,
|
|
If Venta.AddVenta("Rem", 0, CveCliente, 2069, TmpDT.SUM("Total"), 0, 0, 0, 0, 0, TmpDT.SUM("Total"), 1, 0, CveMetodoPago, 0, 0, NowADS(), "", "", 0, NowADS(), -1, -1, "", "", "", 0, 0, 0, 0, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, -1, -1, 0, 1, 0, 2069, 43) Then
|
|
Dim CveVenta As Integer = Venta.CveVenta
|
|
For Each dr As DataRow In TmpDT.Rows
|
|
Dim CveUnidadMedida As Integer
|
|
|
|
Dim PS As New ClsProductosServicios
|
|
|
|
If PS.GetPS(dr("CvePS").ToString.ToEntero, -1, 43) Then
|
|
If PS.DtResultados.Rows.Count > 0 Then
|
|
CveUnidadMedida = PS.DtResultados.Rows(0)("CveUnidadMedida").ToString.ToEntero
|
|
If PS.DtResultados.Rows(0)("Clasificacion").ToString = "Excursiones" Then
|
|
TieneExcursion = True
|
|
End If
|
|
End If
|
|
End If
|
|
PS.Dispose()
|
|
|
|
If dr("CvePS").ToString.ToEntero = 36977 Then 'cuando es acompa;ante pongo el nombre del acompa;ante
|
|
tnombre = dr("Obs").ToString
|
|
Else
|
|
tnombre = Nombre
|
|
End If
|
|
|
|
If Not Venta.AddVentaDetalle(CveVenta, dr("CvePS").ToString.ToEntero, 1, CveUnidadMedida, dr("Total").ToString.ToDouble, 0, dr("Total").ToString.ToDouble, tnombre, 0, 0, -1, -1) Then
|
|
Errorr = True
|
|
Exit Sub
|
|
End If
|
|
Next
|
|
Else
|
|
Errorr = True
|
|
End If
|
|
|
|
If Not Errorr Then
|
|
Venta.Commit()
|
|
|
|
Alert("<br>Su Registro se ha realizado correctamente.<br><br> Se le estará enviando al correo proporcionado la información necesaria para el acceso de su portal.<br><br>", TipoMensaje.MsgInformacion, "tb_remove();")
|
|
|
|
If TieneExcursion Then
|
|
EnviaNotificacion(TmpDT, "ppadilla@imdex-cascabel.com")
|
|
End If
|
|
'ActivaPortal(CveCliente, TxtEmail.Text.Trim) '"rene.molina@adsistemas.mx") '
|
|
'envio de correo a la persona que controla el area, Aristeo,.. .
|
|
'se activa su portal del cliente
|
|
BtnRegistraCompra.Enabled = False
|
|
LblMensaje.Text = "Su Registro se ha realizado correctamente"
|
|
Else
|
|
Alert("No se pudo realizar la compra, Favor de intentarlo mas tarde", TipoMensaje.MsgAdvertencia)
|
|
Venta.RollBack()
|
|
End If
|
|
|
|
Venta.Dispose()
|
|
|
|
|
|
|
|
'Dim Prosp As New ClsProspectos
|
|
|
|
'Dim Cve As Integer
|
|
|
|
'Cve = Prosp.AddProspectos(-1, TxtAPaterno.Text, TxtAMaterno.Text, TxtNombres.Text, "01/01/1900".ToDate, "", "", "", 1, "", "", "", "", "", "", -1, -1, TxtTelefono.Text, "", "", "",
|
|
' TxtEmail.Text, "", "", "", -1, -1, -1, "", "", "", "", "", "", "", "", "", "", "", "", "", "", False,
|
|
' TxtFiscalRazon.Text, TxtFiscalCalle.Text, TxtFiscalColonia.Text, TxtFiscalCP.Text, -1, TxtFiscalRFC.Text,
|
|
' -1, -1, -1, "", -1, -1, -1, False, "", -1, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
|
|
|
''registrar la venta
|
|
|
|
|
|
|
|
'Prosp.Dispose()
|
|
|
|
End Sub
|
|
|
|
Private Sub EnviaNotificacion(dtt As DataTable, Correo As String)
|
|
|
|
'Dim ObjMail As New ClsSisMail()
|
|
Dim Body As New StringBuilder
|
|
Body.AppendFormat("Se ha realizado el registro de: {0} {1} {2}<br><br>El detalle de lo registrado es:", TxtAPaterno.Text, TxtAMaterno.Text, TxtNombres.Text)
|
|
Body.AppendFormat("<table width='500px'>")
|
|
For Each dr As DataRow In TmpDT.Rows
|
|
Body.AppendFormat("<tr><td style='width:400px'>{0}</td><td style='width:100px'>{1} {2}</td></tr>", dr("PS"), dr("Total"), dr("Abreviatura"))
|
|
Next
|
|
Body.AppendFormat("</table>")
|
|
Dim Emp As New Empresa
|
|
Dim ObjEmp As New ClsSisEmpresas
|
|
|
|
If ObjEmp.GetEmpresas(43, "-1", "-1", "-1", "-1") Then
|
|
Emp = ObjEmp.Empresa
|
|
End If
|
|
ObjEmp.Dispose()
|
|
|
|
'If ObjMail.Mandacorreo(Emp, Correo, "Notificación de compra", "", "", {""}, Body.ToString) Then
|
|
|
|
|
|
'End If
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
Private Sub ActivaPortal(CveCliente As Integer, Correo As String)
|
|
'guarda el nuevo usuario
|
|
|
|
Dim Usr As New ClsSisUsuarios
|
|
Dim CveUsr As Integer
|
|
Dim ContraseñaPredeterminada As String = "-acceso-"
|
|
Dim Activa As Boolean = True
|
|
|
|
If Usr.GetUsuariosPortal(-1, CveCliente, -1) Then
|
|
If Usr.DtResultados.Rows.Count = 0 Then
|
|
|
|
'lo ingreso
|
|
CveUsr = Usr.AddUsuarioPortal("Admin", "-acceso-", "Administrador", "", CveCliente, -1, True, True, True, True, True, True, True, True, True, True, 1, 0)
|
|
'lo desactivo para que me pida la nueva contrase;a en el portal
|
|
If CveUsr > 0 Then
|
|
Usr.UpdateUsuarioPortal("Admin", "Administrador", "", True, True, True, True, True, True, True, True, True, True, False, ContraseñaPredeterminada, CveCliente, 0, CveUsr)
|
|
End If
|
|
Activa = True
|
|
Else
|
|
CveUsr = Usr.DtResultados.Rows(0)("CveUsuarioPortal").ToString.ToEntero
|
|
If Usr.DtResultados.Rows(0)("Estatus").ToString = "0" Then
|
|
Activa = True 'sino esta activada la cuenta, sigue mandando la liga para activar
|
|
Else
|
|
Activa = False
|
|
End If
|
|
|
|
End If
|
|
End If
|
|
|
|
|
|
Usr.Dispose()
|
|
If CveUsr > 0 Then
|
|
|
|
|
|
Dim Liga As String = "http://aimmgm.adsistemas.mx/AIMMGM/Portal.aspx"
|
|
|
|
|
|
Dim LigaActivar As String = Liga & "?p=" & Encripta("CveU=" & CveUsr & "&Clave=" & CveCliente & "&Opcion=Activar&Hora=" & NowADS().Ticks)
|
|
|
|
Dim strSQL As New StringBuilder
|
|
strSQL.Append(" <html> ")
|
|
strSQL.Append(" <head></head> ")
|
|
strSQL.Append(" <body> ")
|
|
strSQL.Append(" <img src='http://expominson2014.com/CorreoEncabezado.jpg'><br /> ")
|
|
strSQL.Append(" ")
|
|
strSQL.Append(" <p class=MsoNormal style='margin-top:15.0pt;margin-right:0cm;margin-bottom: ")
|
|
strSQL.Append(" 7.5pt;margin-left:0cm;line-height:normal;mso-outline-level:3'><b><span ")
|
|
strSQL.Append(" style='font-size:14.5pt;font-family:""Century Gothic"",""sans-serif"";mso-fareast-font-family: ")
|
|
strSQL.Append(" ""Times New Roman"";mso-bidi-font-family:""Times New Roman"";color:#2A4A7E; ")
|
|
strSQL.Append(" mso-fareast-language:ES-MX'>SONORA 2014: Minería Moderna, Ejemplo de Industria ")
|
|
strSQL.Append(" Responsable</span></b><b><span style='font-size:14.5pt;font-family:""Century Gothic"",""sans-serif""; ")
|
|
strSQL.Append(" mso-fareast-font-family:""Times New Roman"";mso-bidi-font-family:""Times New Roman""; ")
|
|
strSQL.Append(" color:#89BCDC;mso-fareast-language:ES-MX'><o:p></o:p></span></b></p> ")
|
|
strSQL.Append(" <br> ")
|
|
strSQL.Append(" <br> ")
|
|
strSQL.Append(" <p class=MsoNormal style='margin-top:9.0pt;margin-right:0cm;margin-bottom:9.0pt; ")
|
|
strSQL.Append(" margin-left:0cm;text-align:justify;line-height:normal'><span style='font-size: ")
|
|
strSQL.Append(" 12.0pt;font-family:""Century Gothic"",""sans-serif"";mso-fareast-font-family:""Times New Roman""; ")
|
|
strSQL.Append(" mso-bidi-font-family:""Times New Roman"";color:#2C2C25;mso-fareast-language:ES-MX'>Estimado ")
|
|
strSQL.Append(" Socio y Amigo, Gracias por su asistencia, le brindamos la dirección al portal. ")
|
|
strSQL.Append(" ")
|
|
strSQL.Append(" ")
|
|
strSQL.Append(" <br><br> ")
|
|
If Activa Then strSQL.AppendFormat("<br>Haga click para activar su cuenta <a href='{0}' target='_blank'>Activar</a>", LigaActivar)
|
|
strSQL.Append(" <br><br> ")
|
|
strSQL.AppendFormat(" Dirección de acceso al Portal: <a href='{0}' target='_blank'>Portal AIMMGM</a> ", Liga)
|
|
strSQL.Append(" <br><br> ")
|
|
strSQL.Append(" Datos de acceso: ")
|
|
strSQL.Append(" <br><br> ")
|
|
strSQL.AppendFormat(" Clave Cliente: {0}", CveCliente)
|
|
strSQL.Append(" <br><br> ")
|
|
strSQL.Append(" Dentro del Portal usted tendrá acceso a visualizar el detalle de sus compras, subir la comprobación de sus pagos. ")
|
|
strSQL.Append(" <br><br><table id=""TrPagoss"" width=""994px"" style='font-size:14.5pt;font-family:""Century Gothic"",""sans-serif"";mso-fareast-font-family: ")
|
|
strSQL.Append(" ""Times New Roman"";mso-bidi-font-family:""Times New Roman"";color:#2A4A7E; ")
|
|
strSQL.Append(" mso-fareast-language:ES-MX'> ")
|
|
strSQL.Append(" <tr> ")
|
|
strSQL.Append(" <td colspan=""2"" style=""background-color:#5D7B9D; text-align: center; height: 20px;""> ")
|
|
strSQL.Append(" Pagos-Transferencias Nacionales ")
|
|
strSQL.Append(" <b></b> ")
|
|
strSQL.Append(" </td> ")
|
|
strSQL.Append(" </tr> ")
|
|
strSQL.Append(" <tr> ")
|
|
strSQL.Append(" <td style=""width:275px;"">Banco:</td><td><b>Inbursa</b></td> ")
|
|
strSQL.Append(" </tr> ")
|
|
strSQL.Append(" <tr> ")
|
|
strSQL.Append(" <td>Sucursal:</td><td><b>Nápoles 021</b></td> ")
|
|
strSQL.Append(" </tr> ")
|
|
strSQL.Append(" <tr> ")
|
|
strSQL.Append(" <td>Cuenta:</td><td><b>50019145334</b></td> ")
|
|
strSQL.Append(" </tr> ")
|
|
strSQL.Append(" <tr> ")
|
|
strSQL.Append(" <td>CLABE:</td><td><b>036180500191453345</b></td> ")
|
|
strSQL.Append(" </tr> ")
|
|
strSQL.Append(" <tr> ")
|
|
strSQL.Append(" <td>Nombre del Beneficiario:</td><td><b>Asociación de Ingenieros de Minas, Metalurgistas y Geólogos de México A.C.</b></td> ")
|
|
strSQL.Append(" </tr> ")
|
|
strSQL.Append(" ")
|
|
strSQL.Append(" </table> ")
|
|
strSQL.Append(" <br/> ")
|
|
strSQL.Append(" <table id=""TrPagoss2"" width=""994px""style='font-size:14.5pt;font-family:""Century Gothic"",""sans-serif"";mso-fareast-font-family: ")
|
|
strSQL.Append(" ""Times New Roman"";mso-bidi-font-family:""Times New Roman"";color:#2A4A7E; ")
|
|
strSQL.Append(" mso-fareast-language:ES-MX'> ")
|
|
strSQL.Append(" <tr> ")
|
|
strSQL.Append(" <td colspan=""2"" style=""background-color:#5D7B9D; text-align: center; height: 20px;""> ")
|
|
strSQL.Append(" Pagos-Transferencias Internacionales ")
|
|
strSQL.Append(" <b></b> ")
|
|
strSQL.Append(" </td> ")
|
|
strSQL.Append(" </tr> ")
|
|
strSQL.Append(" <tr> ")
|
|
strSQL.Append(" <td style=""width:275px;"">Moneda:</td><td><b>Dólares Americanos</b></td> ")
|
|
strSQL.Append(" </tr> ")
|
|
strSQL.Append(" <tr> ")
|
|
strSQL.Append(" <td>Banco:</td><td><b>JPMorgan Chase Bank New York NY USA</b></td> ")
|
|
strSQL.Append(" </tr> ")
|
|
strSQL.Append(" <tr> ")
|
|
strSQL.Append(" <td>Código Swift:</td><td><b>CHASUS33</b></td> ")
|
|
strSQL.Append(" </tr> ")
|
|
strSQL.Append(" <tr> ")
|
|
strSQL.Append(" <td>Ruta Banco Receptor (ABA):</td><td><b>021 000 021</b></td> ")
|
|
strSQL.Append(" </tr> ")
|
|
strSQL.Append(" <tr> ")
|
|
strSQL.Append(" <td>Nombre del Beneficiario:</td><td><b>Asociación de Ingenieros de Minas, Metalurgistas y Geólogos de México A.C. </b></td> ")
|
|
strSQL.Append(" </tr> ")
|
|
strSQL.Append(" <tr> ")
|
|
strSQL.Append(" <td>Cuenta del Beneficiario:</td><td><b>50019145334</b></td> ")
|
|
strSQL.Append(" </tr> ")
|
|
strSQL.Append(" <tr> ")
|
|
strSQL.Append(" <td>CLABE:</td><td><b>036180500191453345</b></td> ")
|
|
strSQL.Append(" </tr> ")
|
|
strSQL.Append(" <tr> ")
|
|
strSQL.Append(" <td>Banco Beneficiario:</td><td><b>Banco Inbursa, S.A. México, D.F.</b></td> ")
|
|
strSQL.Append(" </tr> ")
|
|
strSQL.Append(" <tr> ")
|
|
strSQL.Append(" <td>Nuestro Código Swift:</td><td><b>INBUMXMM</b></td> ")
|
|
strSQL.Append(" </tr> ")
|
|
strSQL.Append(" ")
|
|
strSQL.Append(" </table> ")
|
|
|
|
strSQL.Append(" </span></p> ")
|
|
strSQL.Append(" </body> ")
|
|
|
|
|
|
|
|
'Dim ObjMail As New ClsSisMail()
|
|
Dim Emp As New Empresa
|
|
Dim ObjEmp As New ClsSisEmpresas
|
|
|
|
If ObjEmp.GetEmpresas(43, "-1", "-1", "-1", "-1") Then
|
|
Emp = ObjEmp.Empresa
|
|
End If
|
|
ObjEmp.Dispose()
|
|
|
|
'If ObjMail.Mandacorreo(Emp, Correo, If(Activa, "Activación de cuenta ExpominSon 2014", "Registro de Compra ExpominSon 2014"), "", "", {""}, strSQL.ToString) Then
|
|
|
|
|
|
'End If
|
|
End If
|
|
|
|
|
|
End Sub
|
|
|
|
Protected Sub GvRegistro_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvRegistro.RowDataBound
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
If e.Row.DBCampo("CvePS").ToEntero > 0 Then
|
|
e.Row.FCRadioButton("RBL").Attributes.Add("onclick", "$get('GvDias').style.display='none'; ChkGrid();")
|
|
Else
|
|
e.Row.FCLabel("Label1").Visible = False
|
|
e.Row.FCLabel("Label2").Visible = False
|
|
e.Row.FCRadioButton("RBL").Attributes.Add("onclick", "$get('GvDias').style.display='';")
|
|
End If
|
|
End If
|
|
End Sub
|
|
|
|
|
|
Protected Sub GVExcursiones_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GVExcursiones.RowDataBound
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
|
|
e.Row.FCRadioButton("RBL").Attributes.Add("onclick", "$get('divprofesion').style.display='';")
|
|
|
|
End If
|
|
End Sub
|
|
End Class
|