1122 lines
51 KiB
VB.net
1122 lines
51 KiB
VB.net
Imports System.Data
|
|
Imports Extensiones
|
|
Imports System.IO
|
|
|
|
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 GlobalDTGralEstados(CvePais As Integer) As DataTable
|
|
Get
|
|
GlobalDTGralEstados = DirectCast(Application("GlobalDTGralEstados"), DataTable).FiltraParametros(String.Format("CvePais ={0}", CvePais))
|
|
End Get
|
|
Set(value As DataTable)
|
|
Application("GlobalDTGralEstados") = value
|
|
End Set
|
|
End Property
|
|
|
|
Property GlobalDTGralPaises() As DataTable
|
|
Get
|
|
GlobalDTGralPaises = DirectCast(Application("GlobalDTGralPaises"), DataTable)
|
|
End Get
|
|
Set(value As DataTable)
|
|
Application("GlobalDTGralPaises") = 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("CP") IsNot Nothing AndAlso Request("CP").ToString <> "" AndAlso Request("C") IsNot Nothing AndAlso Request("C").ToString.ToEntero > 0 Then
|
|
|
|
HdnCveCliente.Value = Request("C").ToString
|
|
CargaReCompra(Request("CP").ToString, Request("C").ToString.ToEntero)
|
|
|
|
Exit Sub
|
|
|
|
End If
|
|
|
|
'If Request("PL") IsNot Nothing Then
|
|
' RBLPago.Items(1).Enabled = True
|
|
'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()
|
|
|
|
DdlFiscalMetodoPago.DataSource = DirectCast(Application("GlobalDTMetodosPago"), DataTable).FiltraParametros("CveMetodoPago IN (1,2,3,4,5)")
|
|
DdlFiscalMetodoPago.DataBind()
|
|
|
|
DdlPais.DataSource = GlobalDTGralPaises : DdlPais.DataBind()
|
|
DdlPais.SelectedValue = "1"
|
|
DdlFiscalPais.DataSource = GlobalDTGralPaises : DdlFiscalPais.DataBind()
|
|
DdlFiscalPais.SelectedValue = "1"
|
|
DdlFiscalEstado.DataSource = GlobalDTGralEstados(DdlFiscalPais.SelectedValue.ToEntero) : DdlFiscalEstado.DataBind()
|
|
DdlEmpresaEstado.DataSource = GlobalDTGralEstados(DdlPais.SelectedValue.ToEntero) : DdlEmpresaEstado.DataBind()
|
|
|
|
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, Now, 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 CargaReCompra(ClavePago As String, CveCliente As Integer)
|
|
|
|
Dim tmp As New DataTable
|
|
Dim Carpeta As String = String.Format("{0}AIMMGM/ePagos", AppDomain.CurrentDomain.BaseDirectory)
|
|
Dim Archivo As String = String.Format("{0}/{1}.xml", Carpeta, ClavePago)
|
|
Dim Archivo2 As String = String.Format("{0}/C{1}.xml", Carpeta, ClavePago)
|
|
|
|
If File.Exists(Archivo) Then
|
|
|
|
tmp.ReadXml(Archivo)
|
|
TmpDT = tmp
|
|
|
|
PnlPagar.Visible = True
|
|
GvCompras.DataSource = tmp
|
|
GvCompras.DataBind()
|
|
PnlPagar.Visible = True
|
|
PnlRegistro.Visible = False
|
|
|
|
'Dim CveCliente As Integer = tmp.MAX("CveCliente").ToString.ToEntero
|
|
'Dim Nombre As String = ""
|
|
'Dim CveMetodoPago As Integer = 0
|
|
|
|
Dim Cliente As New ClsClientes
|
|
If Cliente.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, 43, -1) Then
|
|
|
|
If Cliente.DtResultados.Rows.Count > 0 Then
|
|
DdlFiscalMetodoPago.SelectedValue = Cliente.CveMetodoPago.ToString
|
|
HdnNombre.Value = Cliente.Nombre
|
|
TxtEmail.Text = Cliente.Mail
|
|
End If
|
|
|
|
End If
|
|
Cliente.Dispose()
|
|
|
|
If tmp.SUM("Total") > 0 Then
|
|
BtnRegistraCompra.Visible = True
|
|
BtnRegresar2.Visible = True
|
|
Else
|
|
BtnRegistraCompra.Visible = False
|
|
BtnRegresar2.Visible = False
|
|
End If
|
|
|
|
|
|
Else
|
|
LblMensaje.Text = "Pago ya registrado"
|
|
|
|
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("IdCtaContVentas", 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))
|
|
TmpDT.Columns.Add("CveCliente", GetType(Integer))
|
|
TmpDT.TableName = "Venta"
|
|
'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
|
|
|
|
If DdlFactura.SelectedValue = "1" AndAlso TxtFiscalRFC.Text.Trim = "" Then
|
|
Alert("El campo <b>RFC</b> es necesario, por favor ingréselo.", TipoMensaje.MsgAdvertencia)
|
|
Exit Sub
|
|
End If
|
|
|
|
|
|
If PnlFacturacion.Visible AndAlso TxtNombreComercial.Text.Trim = "" Then
|
|
Alert("El campo <b>Nombre Comercial</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 = DateTime.Now.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(), (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 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 DdlFactura_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlFactura.SelectedIndexChanged
|
|
If DdlFactura.SelectedValue = "1" Then
|
|
PnlFacturacion.Visible = True
|
|
ChkFactura.Visible = True
|
|
Else
|
|
PnlFacturacion.Visible = False
|
|
ChkFactura.Visible = False
|
|
End If
|
|
End Sub
|
|
|
|
Protected Sub DdlPais_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPais.SelectedIndexChanged
|
|
DdlEmpresaEstado.DataSource = GlobalDTGralEstados(DdlPais.SelectedValue.ToEntero) : DdlEmpresaEstado.DataBind()
|
|
End Sub
|
|
|
|
Protected Sub DdlFiscalPais_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlFiscalPais.SelectedIndexChanged
|
|
DdlFiscalEstado.DataSource = GlobalDTGralEstados(DdlFiscalPais.SelectedValue.ToEntero) : DdlFiscalEstado.DataBind()
|
|
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 ChkFactura_CheckedChanged(sender As Object, e As EventArgs) Handles ChkFactura.CheckedChanged
|
|
If ChkFactura.Checked Then
|
|
TxtFiscalRazon.Text = String.Format("{0} {1} {2}", TxtAPaterno.Text, TxtAMaterno.Text, TxtNombres.Text)
|
|
TxtFiscalCalle.Text = TxtEmpresaCalle.Text
|
|
TxtFiscalNumero.Text = TxtEmpresaNumero.Text
|
|
TxtFiscalNumeroInterior.Text = TxtEmpresaNumeroInterior.Text
|
|
TxtFiscalColonia.Text = TxtEmpresaColonia.Text
|
|
TxtFiscalCiudad.Text = TxtEmpresaCiudad.Text
|
|
TxtFiscalCP.Text = TxtEmpresaCP.Text
|
|
DdlFiscalPais.SelectedValue = DdlPais.SelectedValue
|
|
DdlFiscalEstado.DataSource = GlobalDTGralEstados(DdlFiscalPais.SelectedValue.ToEntero) : DdlFiscalEstado.DataBind()
|
|
DdlFiscalEstado.SelectedValue = DdlEmpresaEstado.SelectedValue
|
|
End If
|
|
End Sub
|
|
|
|
|
|
Protected Sub BtnRegistraCompra_Click(sender As Object, e As EventArgs) Handles BtnRegistraCompra.Click
|
|
|
|
|
|
Select Case RBLPago.SelectedValue
|
|
Case "2"
|
|
PagoEnlinea()
|
|
Case "1"
|
|
PagoTransferencia()
|
|
Case "3"
|
|
PagoTerminal()
|
|
Case Else
|
|
Alert("Seleccione un método de pago", TipoMensaje.MsgAdvertencia)
|
|
End Select
|
|
|
|
End Sub
|
|
|
|
Private Sub PagoTransferencia()
|
|
Dim CveCliente As Integer = -1
|
|
|
|
Dim Nombre As String = TxtNombres.Text.Trim & " " & TxtAPaterno.Text.Trim & " " & TxtAMaterno.Text.Trim
|
|
If HdnNombre.Value <> "" Then
|
|
Nombre = HdnNombre.Value
|
|
End If
|
|
|
|
If HdnCveCliente.Value <> "" Then
|
|
CveCliente = HdnCveCliente.Value.ToEntero
|
|
End If
|
|
|
|
'Exit Sub
|
|
|
|
If CveCliente <= 0 Then
|
|
|
|
|
|
Dim Cliente As New ClsClientes
|
|
'sin facturar
|
|
If DdlFactura.SelectedValue = "0" Then
|
|
|
|
If Cliente.GetClientes(-1, Nombre, "-1", "-1", "-1", "-1", "-1", -1, 43, -1) Then
|
|
|
|
If Cliente.DtResultados.Rows.Count = 0 Then
|
|
'If Cliente.AddCliente(TxtAPaterno.Text.Trim & " " & TxtAMaterno.Text.Trim & " " & TxtNombres.Text.Trim, TxtNombreComercial.Text.Trim, TxtEmpresaCalle.Text.Trim, "", "", TxtEmpresaColonia.Text.Trim, "", TxtEmpresaCiudad.Text.Trim, DdlEmpresaEstado.SelectedItem.Text, "", TxtEmpresaCP.Text.Trim, TxtTelefono.Text.Trim, "", TxtEmail.Text.Trim, "-1", "", "", False,
|
|
' 1, -1, -1, -1, False, 0, 43, "", "", 0, "", "", "", "", -1, -1, -1, -1, TxtProfesion.Text.Trim, "", "", 0, "", 1, False, "", "", "", False, "", "", "", "", "", False, "") Then
|
|
|
|
|
|
'End If
|
|
End If
|
|
CveCliente = Cliente.CveCliente
|
|
End If
|
|
|
|
|
|
Else
|
|
'con facturacion
|
|
|
|
If Cliente.GetClientes(-1, "-1", "-1", "-1", TxtFiscalRFC.Text.Trim.Replace("-", ""), "-1", "-1", -1, 43, -1) Then
|
|
|
|
If Cliente.DtResultados.Rows.Count = 0 Then
|
|
|
|
'If Cliente.AddCliente(TxtFiscalRazon.Text.Trim, TxtNombreComercial.Text.Trim, TxtFiscalCalle.Text.Trim, TxtFiscalNumero.Text.Trim, TxtFiscalNumeroInterior.Text.Trim, TxtFiscalColonia.Text.Trim, TxtLocalidad.Text.Trim, TxtFiscalCiudad.Text.Trim, DdlFiscalEstado.SelectedItem.Text, TxtFiscalRFC.Text.Trim.Replace("-", ""), TxtFiscalCP.Text.Trim, TxtTelefono.Text.Trim, Nombre, TxtEmail.Text.Trim, "-1", "", "", False,
|
|
' 1, -1, -1, -1, False, 0, 43, "", "", 0, "", "", "", "", -1, -1, -1, -1, TxtProfesion.Text.Trim, "", "", 0, TxtFiscalNumCtaPago.Text, DdlFiscalMetodoPago.SelectedValue.ToEntero, False, "", "", "", False, "", "", "", "", "", False, "") Then
|
|
|
|
|
|
'End If
|
|
End If
|
|
CveCliente = Cliente.CveCliente
|
|
End If
|
|
|
|
|
|
|
|
End If
|
|
Cliente.Dispose()
|
|
End If
|
|
|
|
Dim Errorr As Boolean = False
|
|
Dim Venta As New ClsVentas
|
|
Venta.IniciaTransacSQL()
|
|
Dim tnombre As String
|
|
Dim TieneExcursion As Boolean = False
|
|
|
|
If Venta.AddVenta("Rem", 0, CveCliente, 2069, TmpDT.SUM("Total"), 0, 0, 0, 0, 0, TmpDT.SUM("Total"), 1, 0, DdlFiscalMetodoPago.SelectedValue.ToEntero, 0, 0, Now, "", "", 0, Now, -1, -1, "", "", "", 0, 0, 0, 0, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, -1, -1, 0, 0, 1, 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 For
|
|
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, "window.top.location.href = 'http://www.expominson2014.com/'")
|
|
EnviaNotificacion(TmpDT, "nunezothon@yahoo.com.mx") '"rene.molina@adsistemas.mx") '
|
|
If TieneExcursion Then
|
|
EnviaNotificacion(TmpDT, "ppadilla@imdex-cascabel.com") '"rene.molina@adsistemas.mx") '
|
|
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()
|
|
|
|
End Sub
|
|
|
|
Private Sub PagoTerminal()
|
|
If TxtNumeroAsesor.Text.Trim.Contiene("3745", "1588", "1323", "1941", "6614", "1485", "7565", "6589", "7521", "9654") Then
|
|
Dim CveCliente As Integer = -1
|
|
|
|
Dim Nombre As String = TxtNombres.Text.Trim & " " & TxtAPaterno.Text.Trim & " " & TxtAMaterno.Text.Trim
|
|
If HdnNombre.Value <> "" Then
|
|
Nombre = HdnNombre.Value
|
|
End If
|
|
|
|
If HdnCveCliente.Value <> "" Then
|
|
CveCliente = HdnCveCliente.Value.ToEntero
|
|
End If
|
|
|
|
'Exit .Sub
|
|
|
|
If CveCliente <= 0 Then
|
|
|
|
|
|
Dim Cliente As New ClsClientes
|
|
'sin facturar
|
|
If DdlFactura.SelectedValue = "0" Then
|
|
|
|
If Cliente.GetClientes(-1, Nombre, "-1", "-1", "-1", "-1", "-1", -1, 43, -1) Then
|
|
|
|
If Cliente.DtResultados.Rows.Count = 0 Then
|
|
'If Cliente.AddCliente(TxtAPaterno.Text.Trim & " " & TxtAMaterno.Text.Trim & " " & TxtNombres.Text.Trim, TxtNombreComercial.Text.Trim, TxtEmpresaCalle.Text.Trim, "", "", TxtEmpresaColonia.Text.Trim, "", TxtEmpresaCiudad.Text.Trim, DdlEmpresaEstado.SelectedItem.Text, "", TxtEmpresaCP.Text.Trim, TxtTelefono.Text.Trim, "", TxtEmail.Text.Trim, "", "", "", False,
|
|
' 1, -1, -1, -1, False, 0, 43, "", "", 0, "", "", "", "", -1, -1, -1, -1, TxtProfesion.Text.Trim, "", "", 0, "", 1, False, "", "", "", False, "", "", "", "", "", False, "") Then
|
|
|
|
|
|
'End If
|
|
End If
|
|
CveCliente = Cliente.CveCliente
|
|
End If
|
|
|
|
|
|
Else
|
|
'con facturacion
|
|
|
|
If Cliente.GetClientes(-1, "-1", "-1", "-1", TxtFiscalRFC.Text.Trim.Replace("-", ""), "-1", "-1", -1, 43, -1) Then
|
|
|
|
If Cliente.DtResultados.Rows.Count = 0 Then
|
|
|
|
'If Cliente.AddCliente(TxtFiscalRazon.Text.Trim, TxtNombreComercial.Text.Trim, TxtFiscalCalle.Text.Trim, TxtFiscalNumero.Text.Trim, TxtFiscalNumeroInterior.Text.Trim, TxtFiscalColonia.Text.Trim, TxtLocalidad.Text.Trim, TxtFiscalCiudad.Text.Trim, DdlFiscalEstado.SelectedItem.Text, TxtFiscalRFC.Text.Trim.Replace("-", ""), TxtFiscalCP.Text.Trim, TxtTelefono.Text.Trim, Nombre, TxtEmail.Text.Trim, "", "", "", False,
|
|
' 1, -1, -1, -1, False, 0, 43, "", "", 0, "", "", "", "", -1, -1, -1, -1, TxtProfesion.Text.Trim, "", "", 0, TxtFiscalNumCtaPago.Text, DdlFiscalMetodoPago.SelectedValue.ToEntero, False, "", "", "", "", "", -1, "", "", "", False, "", "", "", "", "") Then
|
|
|
|
|
|
'End If
|
|
End If
|
|
CveCliente = Cliente.CveCliente
|
|
End If
|
|
|
|
|
|
|
|
End If
|
|
Cliente.Dispose()
|
|
End If
|
|
|
|
Dim Errorr As Boolean = False
|
|
Dim Venta As New ClsVentas
|
|
Venta.IniciaTransacSQL()
|
|
Dim AIM As New ClsAIMMGM(Venta.IniciaTransacSQL)
|
|
Dim tnombre As String
|
|
Dim TieneExcursion As Boolean = False
|
|
|
|
If Venta.AddVenta("Rem", 0, CveCliente, 2069, TmpDT.SUM("Total"), 0, 0, 0, 0, 0, TmpDT.SUM("Total"), 1, 0, DdlFiscalMetodoPago.SelectedValue.ToEntero, 0, 0, Now, "", "", 0, Now, -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, 0) Then
|
|
Errorr = True
|
|
Exit For
|
|
End If
|
|
|
|
If Not Errorr Then
|
|
|
|
If AIM.AddPago(CveCliente, Venta.CveVentaDetalle, dr("Total").ToString.ToDouble, 1, Now, "", "Pago en terminal", TxtNumeroAsesor.Text.Trim.ToEntero, TxtNumeroAprobacion.Text.Trim.ToEntero) <= 0 Then
|
|
Errorr = True
|
|
End If
|
|
|
|
If Not Errorr Then
|
|
If Not AIM.AddUpdVentaDetallePagado(Venta.CveVentaDetalle, True) Then
|
|
Errorr = True
|
|
End If
|
|
End If
|
|
|
|
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, "window.top.location.href = 'http://aimmgm.adsistemas.mx/AIMMGM/Registro.aspx'")
|
|
' EnviaNotificacion(TmpDT, "nunezothon@yahoo.com.mx") '"rene.molina@adsistemas.mx") '
|
|
If TieneExcursion Then
|
|
EnviaNotificacion(TmpDT, "ppadilla@imdex-cascabel.com") '"rene.molina@adsistemas.mx") '
|
|
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()
|
|
AIM.Dispose()
|
|
Else
|
|
Alert("El código de Asesor es incorrecto", TipoMensaje.MsgAdvertencia)
|
|
End If
|
|
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=" & DateTime.Now.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
|
|
|
|
|
|
Private Sub PagoEnlinea()
|
|
Dim uriString As String = "http://www.prosepago.com/tvirtual/tvsv.aspx?t=721&ppost=1"
|
|
|
|
Dim myNameValueCollection As New NameValueCollection()
|
|
|
|
Dim Carpeta As String = String.Format("{0}/AIMMGM/ePagos", AppDomain.CurrentDomain.BaseDirectory)
|
|
'registro el cliente y vinculo la clave del cliente en la tabla
|
|
Dim CveCliente As Integer = -1
|
|
Dim Nombre As String = TxtNombres.Text.Trim & " " & TxtAPaterno.Text.Trim & " " & TxtAMaterno.Text.Trim
|
|
|
|
If HdnNombre.Value <> "" Then
|
|
Nombre = HdnNombre.Value
|
|
End If
|
|
|
|
If Not Directory.Exists(Carpeta) Then
|
|
Directory.CreateDirectory(Carpeta)
|
|
End If
|
|
|
|
If HdnCveCliente.Value <> "" Then
|
|
CveCliente = HdnCveCliente.Value.ToEntero
|
|
End If
|
|
|
|
'Exit Sub
|
|
|
|
If CveCliente <= 0 Then
|
|
|
|
Dim Cliente As New ClsClientes
|
|
'sin facturar
|
|
If DdlFactura.SelectedValue = "0" Then
|
|
|
|
If Cliente.GetClientes(-1, Nombre, "-1", "-1", "-1", "-1", "-1", -1, 43, -1) Then
|
|
|
|
If Cliente.DtResultados.Rows.Count = 0 Then
|
|
'If Cliente.AddCliente(TxtAPaterno.Text.Trim & " " & TxtAMaterno.Text.Trim & " " & TxtNombres.Text.Trim, TxtNombreComercial.Text.Trim, TxtEmpresaCalle.Text.Trim, "", "", TxtEmpresaColonia.Text.Trim, "", TxtEmpresaCiudad.Text.Trim, DdlEmpresaEstado.SelectedItem.Text, "", TxtEmpresaCP.Text.Trim, TxtTelefono.Text.Trim, "", TxtEmail.Text.Trim, "-1", "", "", False,
|
|
' 1, -1, -1, -1, False, 0, 43, "", "", 0, "", "", "", "", -1, -1, -1, -1, TxtProfesion.Text.Trim, "", "", 0, "", 1, False, "", "", "", False, "", "", "", "", "", False, "") Then
|
|
|
|
|
|
'End If
|
|
End If
|
|
CveCliente = Cliente.CveCliente
|
|
End If
|
|
|
|
|
|
Else
|
|
'con facturacion
|
|
|
|
If Cliente.GetClientes(-1, "-1", "-1", "-1", TxtFiscalRFC.Text.Trim.Replace("-", ""), "-1", "-1", -1, 43, -1) Then
|
|
|
|
If Cliente.DtResultados.Rows.Count = 0 Then
|
|
|
|
'If Cliente.AddCliente(TxtFiscalRazon.Text.Trim, TxtNombreComercial.Text.Trim, TxtFiscalCalle.Text.Trim, TxtFiscalNumero.Text.Trim, TxtFiscalNumeroInterior.Text.Trim, TxtFiscalColonia.Text.Trim, TxtLocalidad.Text.Trim, TxtFiscalCiudad.Text.Trim, DdlFiscalEstado.SelectedItem.Text, TxtFiscalRFC.Text.Trim.Replace("-", ""), TxtFiscalCP.Text.Trim, TxtTelefono.Text.Trim, Nombre, TxtEmail.Text.Trim, "-1", "", "", False,
|
|
' 1, -1, -1, -1, False, 0, 43, "", "", 0, "", "", "", "", -1, -1, -1, -1, TxtProfesion.Text.Trim, "", "", 0, TxtFiscalNumCtaPago.Text, DdlFiscalMetodoPago.SelectedValue.ToEntero, False, "", "", "", False, "", "", "", "", "", False, "") Then
|
|
|
|
|
|
'End If
|
|
End If
|
|
CveCliente = Cliente.CveCliente
|
|
End If
|
|
|
|
End If
|
|
Cliente.Dispose()
|
|
End If
|
|
|
|
Dim ClavePago As String = String.Format("{0}-{1}", CveCliente, Now.Ticks)
|
|
|
|
'actualizo la clavedel cliente en todos los registros
|
|
|
|
For Each dr As DataRow In TmpDT.Rows
|
|
dr("CveCliente") = CveCliente
|
|
Next
|
|
|
|
TmpDT.WriteXml(String.Format("{0}/{1}.xml", Carpeta, ClavePago), XmlWriteMode.WriteSchema)
|
|
|
|
|
|
|
|
myNameValueCollection.Add("nom", Nombre)
|
|
myNameValueCollection.Add("con", "ExpominSon 2014")
|
|
myNameValueCollection.Add("ref", CveCliente.ToString)
|
|
myNameValueCollection.Add("imp", TmpDT.SUM("Total").ToString) '".01"
|
|
myNameValueCollection.Add("ema", TxtEmail.Text.Trim)
|
|
myNameValueCollection.Add("urlOk", String.Format("http://aimmgm.adsistemas.mx/AIMMGM/ePagos.aspx?p={0}", Encripta(String.Format("Cve={0}&F={1}&CveCliente={2}&P=1", ClavePago, Now, CveCliente))))
|
|
myNameValueCollection.Add("urlKo", String.Format("http://aimmgm.adsistemas.mx/AIMMGM/ePagos.aspx?p={0}", Encripta(String.Format("Cve={0}&F={1}&CveCliente={2}&NP=1", ClavePago, Now, CveCliente))))
|
|
myNameValueCollection.Add("autoBack", "1")
|
|
myNameValueCollection.Add("datbloq", "1")
|
|
|
|
Response.RedirectWithData(uriString, myNameValueCollection)
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
#Region "Viewstate"
|
|
Protected Overrides Sub SavePageStateToPersistenceMedium(pviewState As Object)
|
|
|
|
'If Request.Form("__VIEWSTATE_KEY") IsNot Nothing Then Cache.Remove(Request.Form("__VIEWSTATE_KEY")) 'elimino la cachado anteriormente
|
|
|
|
|
|
Dim VSKey As String = String.Format("VIEWSTATE_{0}_{1}_{2}", Session.SessionID, Request.Path, Date.Now.Ticks)
|
|
Cache.Add(VSKey, pviewState, Nothing, Date.Now.AddMinutes(60), Cache.NoSlidingExpiration, CacheItemPriority.Default, Nothing) 'Store the ViewState on Cache
|
|
ClientScript.RegisterHiddenField("__VIEWSTATE_KEY", VSKey)
|
|
|
|
End Sub
|
|
|
|
Protected Overrides Function LoadPageStateFromPersistenceMedium() As Object
|
|
|
|
Dim VSKey As String = Request.Form("__VIEWSTATE_KEY")
|
|
If Not VSKey.StartsWith("VIEWSTATE_") Then 'Request the Key from the page and validade it.
|
|
Throw New Exception("Invalid VIEWSTATE Key: " & VSKey)
|
|
End If
|
|
If Cache(VSKey) Is Nothing Then 'si por algún motivo, el caché expiró, le dice a la página que se recargue y obtenga los datos de nuevo, y así evitar errores al obtener el viewstate vacío
|
|
Response.Redirect(Request.RawUrl)
|
|
Return Nothing
|
|
Else
|
|
Return Cache(VSKey)
|
|
End If
|
|
|
|
End Function
|
|
#End Region
|
|
End Class
|