175 lines
9.8 KiB
VB.net
175 lines
9.8 KiB
VB.net
Option Strict On
|
|
Option Explicit On
|
|
|
|
Imports Extensiones
|
|
|
|
Partial Class Sistemas_RegistroEmpresa
|
|
Inherits Page
|
|
|
|
#Region "PROPIEDADES"
|
|
Private Property Nombre As String
|
|
Get
|
|
Nombre = ViewState("Nombre").ToString
|
|
End Get
|
|
Set(value As String)
|
|
ViewState("Nombre") = value
|
|
End Set
|
|
End Property
|
|
Private Property RFC As String
|
|
Get
|
|
RFC = ViewState("RFC").ToString
|
|
End Get
|
|
Set(value As String)
|
|
ViewState("RFC") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property Email As String
|
|
Get
|
|
Email = ViewState("Email").ToString
|
|
End Get
|
|
Set(value As String)
|
|
ViewState("Email") = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property MetodoPago As String
|
|
Get
|
|
MetodoPago = ViewState("MetodoPago").ToString
|
|
End Get
|
|
Set(value As String)
|
|
ViewState("MetodoPago") = value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
Private Property Liga As String
|
|
Get
|
|
Liga = ViewState("Liga").ToString
|
|
End Get
|
|
Set(value As String)
|
|
ViewState("Liga") = value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
|
|
#End Region
|
|
|
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
|
If Not IsPostBack Then
|
|
|
|
Dim thisURL As String = Request.Url.Segments(Request.Url.Segments.Count - 1)
|
|
RegistraScript("$('#mBody').addClass('page-sidebar-closed')")
|
|
RegistraScript("$('#divMenu').css('display','none')")
|
|
|
|
End If
|
|
End Sub
|
|
|
|
#Region " GUARDAR "
|
|
|
|
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
|
|
Nombre = txtNombre.Text.ToUpper()
|
|
RFC = TxtRFC.Text.ToUpper()
|
|
Email = TxtEmail.Text
|
|
MetodoPago = DdlMetodoPago.SelectedValue
|
|
|
|
Dim objEmpresa As New ClsSisEmpresas()
|
|
Try
|
|
If objEmpresa.AddEmpresa(-1, Nombre, "", "", "", "", "", "", RFC, 0, "", "", Email, "CFDi", "", "", "", "", "", "", "", 100, False, False, False, "", False, "", "", "", 0, False,
|
|
False, False, False, False, False, False, False, False, False, "", "", "", "", "", "", 0, False, "", "", "", "", "", 0, False, "", "", "", 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, 0, "", "", -1,
|
|
0.0D, "", 0, False, 0.0D, "", "", 0, False, 0, 0, False, 0, 0, False, 0, CveMetodoPago:=MetodoPago.ToEntero) Then
|
|
Alert("Su solicitud ha sido procesada correctamente, en breve recibira un correo para completar el registro.", TipoMensaje.MsgInformacion)
|
|
Liga = String.Format("sig.adsistemas.mx/Sistemas/WizardRegistro.aspx?P={0}", Encripta(String.Format("CveEmpresa={0}", objEmpresa.CveEmpresa)))
|
|
EnviaCorreo()
|
|
RegistraScript("$('#C_DivRegistro').css('display', 'none')")
|
|
RegistraScript("$('#C_DvFinalizado').css('display', '')")
|
|
UpRegistro.Update()
|
|
Else
|
|
Alert("OCurrió un error al guardar la empresa", TipoMensaje.MsgError)
|
|
End If
|
|
Catch ex As Exception
|
|
OnError("Ocurrió un error al guardar la emrpresa desde registro basico.", ex)
|
|
Finally
|
|
objEmpresa.Dispose()
|
|
End Try
|
|
|
|
End Sub
|
|
#End Region
|
|
|
|
#Region " ENVIAR CORREO "
|
|
Protected Sub REVContactoEmail_Load(sender As Object, e As EventArgs)
|
|
RegistraScript("$('#FirstEmail').addClass('has-error');$('#helpMail').css('color', 'red')")
|
|
End Sub
|
|
Protected Sub EnviaCorreo()
|
|
Dim objMail As New ClsSisMail()
|
|
Dim body = GeneraCorreo(Nombre)
|
|
objMail.SendMail(ClsPaginas.EmpresaNotificaciones, Email, "Activación de empresa", body, "")
|
|
End Sub
|
|
Private Function GeneraCorreo(Nombre As String) As String
|
|
Dim strBody As New StringBuilder
|
|
strBody.Append("<!DOCTYPE html>")
|
|
strBody.Append("<html lang=""en""> ")
|
|
strBody.Append("<body class=""page-header-fixed page-quick-sidebar-over-content "">")
|
|
strBody.Append("<style>")
|
|
strBody.Append(".portlet {margin-top: 0px;margin-bottom: 25px;padding: 0px;-webkit-border-radius: 4px;-moz-border-radius: 4px;-ms-border-radius: 4px;-o-border-radius: 4px;border-radius: 4px;padding: 0px !important;border: 1px solid #d78184;border-top: 0;background-color: #cb5a5e;}")
|
|
strBody.Append(".portlet > div {font-family: Helvetica, sans-serif;}")
|
|
strBody.Append(".portlet > .portlet-title {border-bottom: 0px solid #eee;padding: 0 10px;margin-bottom: 0px;min-height: 41px;-webkit-border-radius: 4px 4px 0 0;-moz-border-radius: 4px 4px 0 0;-ms-border-radius: 4px 4px 0 0;-o-border-radius: 4px 4px 0 0;border-radius: 4px 4px 0 0;color: #fff;}")
|
|
strBody.Append(".portlet > .portlet-title {background-color: #cb5a5e;}")
|
|
strBody.Append(".portlet > .portlet-title > div {padding: 11px 0 9px 0;}")
|
|
strBody.Append(".portlet > .portlet-title > div {float: left;display: inline-block;font-size: 24px;line-height: 18px;padding: 10px 0;}")
|
|
strBody.Append(".portlet > .portlet-body {background-color: #fff;padding: 10px;} ")
|
|
strBody.Append(".portlet > .portlet-body {clear: both;-webkit-border-radius: 0 0 4px 4px;-moz-border-radius: 0 0 4px 4px;-ms-border-radius: 0 0 4px 4px;-o-border-radius: 0 0 4px 4px;border-radius: 0 0 4px 4px;}")
|
|
strBody.Append(".mitablita td:nth-child(1){width: 100px; font-weight:700;}")
|
|
strBody.Append("a{ color: #666;padding: 3px 9px; line-height: 1.5;background-color: #fff;border: 1px solid #ccc; text-decoration: none;}a:hover{background-color: #ededed;}")
|
|
strBody.Append(".mitablita tr:nth-child(5) td{ text-align: right;}td{min-width:100px; }")
|
|
strBody.Append("</style>")
|
|
strBody.Append(" <div style=""Width:100%;"">")
|
|
strBody.Append("<div style='text-align:center; font-family: Helvetica, sans-serif;'><table><tr><td style='text-align:center'> <h1> <img src='http://sig.adsistemas.mx/Imagenes/LogoSinFondo.png' width='46' height='61'/> AD Sistemas Soluciones en TI</h1> </td></tr></table> </div> ")
|
|
strBody.Append(" <div class=""portlet box red "" style=""margin-top: 0px;margin-bottom: 25px;padding: 0px;-webkit-border-radius: 4px;-moz-border-radius: 4px;-ms-border-radius: 4px;-o-border-radius: 4px;border-radius: 4px;padding: 0px !important;border: 1px solid #d78184;border-top: 0;background-color: #cb5a5e;"">")
|
|
strBody.Append(" <div class=""portlet-title"" style="" font-family: Helvetica, sans-serif; background-color: #cb5a5e;border-bottom: 0px solid #eee;padding: 0 10px;margin-bottom: 0px;min-height: 41px;-webkit-border-radius: 4px 4px 0 0;-moz-border-radius: 4px 4px 0 0;-ms-border-radius: 4px 4px 0 0;-o-border-radius: 4px 4px 0 0;border-radius: 4px 4px 0 0;color: #fff;"">")
|
|
strBody.Append(" <div class=""caption"" style=""padding: 11px 0 9px 0;float: left;display: inline-block;font-size: 24px;line-height: 18px;padding: 10px 0;"">")
|
|
strBody.Append(" <i class=""fa fa-cart-plus""></i>Completar Registro")
|
|
strBody.Append(" </div>")
|
|
strBody.Append(" </div>")
|
|
strBody.Append(" <div class=""portlet-body "" style=""font-family: Helvetica, sans-serif; clear: both;-webkit-border-radius: 0 0 4px 4px;-moz-border-radius: 0 0 4px 4px;-ms-border-radius: 0 0 4px 4px;-o-border-radius: 0 0 4px 4px;border-radius: 0 0 4px 4px;background-color: #fff;padding: 10px;"" >")
|
|
strBody.Append(" <table class=""mitablita"" style=""font-family: Helvetica, sans-serif;"">")
|
|
strBody.Append(" <tr>")
|
|
strBody.Append(" <td>Fecha: ")
|
|
strBody.Append(DateTime.Now.ToString("dd/MM/yy"))
|
|
strBody.Append(" </td> <td>")
|
|
strBody.Append("</td> </tr>")
|
|
strBody.Append(" <tr>")
|
|
strBody.AppendFormat(" <td><b>{0}<br/></b> <br/> </td>", Nombre)
|
|
strBody.Append(" <td>")
|
|
strBody.Append("</td> </tr>")
|
|
strBody.Append(" <tr></tr> ")
|
|
strBody.Append(" <tr>")
|
|
strBody.Append(" <td>Para continuar con el proceso de registro y activación, por favor haga click en la siguiente liga: </td>")
|
|
strBody.Append("<tr><td colspan=""4"" >")
|
|
strBody.AppendFormat("<a href='{0}'>Continuar </a> <br/> <br/> </td></tr>", Liga)
|
|
strBody.Append("<tr> <td> Le recomendamos tener la siguiente información a la mano: </td> </tr>")
|
|
strBody.Append("<tr> <td> ")
|
|
strBody.Append("<ul>")
|
|
strBody.Append("<li>Datos Fiscales (Direccion, Contacto, Regimen, Certificados digitales, etc. ) </li> ")
|
|
strBody.Append("<li> Roles/Puestos, Permisos y Usuarios que usaran el SIG )</li> ")
|
|
strBody.Append("<li>Correos para envío de notificaciones y Para recepción de facturas (si no cuenta con un correo, se le proporcionará uno)</li> ")
|
|
strBody.Append("<li>Formatos de factura, plantillas de correo y logo </li> ")
|
|
strBody.Append("<li>Clasificaciones contables, Productos / Servicios y las unidades de medida de éstos</li> ")
|
|
strBody.Append("<li>Almacenes que se utilizand, y el método de salida de inventario</li> ")
|
|
strBody.Append("<li>Proveedores, clientes y proyectos de la empresa</li> ")
|
|
strBody.Append("</ul>")
|
|
strBody.Append(" </td> </tr>")
|
|
strBody.Append(" </table>")
|
|
strBody.Append(" </div>")
|
|
strBody.Append(" </div>")
|
|
strBody.Append(" </div>")
|
|
strBody.Append(" </div>")
|
|
strBody.Append("</body>")
|
|
strBody.Append("</html>")
|
|
Return strBody.ToString
|
|
End Function
|
|
#End Region
|
|
|
|
End Class
|