public ActionResult Actualizar(int IdRepresentanteLegal) { try { CatUsuarios Usuario = (CatUsuarios)Session["Usuario"]; if (Usuario == null && Usuario.U_IdTipoUsuario == 2) { TempData["notice"] = "La sesión ha expirado."; return(RedirectToAction("Logout", "Home")); } ViewBag.ActaConstitutiva = @"C:\inetpub\RepositorioVER\" + IdRepresentanteLegal.ToString() + "-ActaConstitutiva.pdf"; ViewBag.CedulaRFC = @"C:\inetpub\RepositorioVER\" + IdRepresentanteLegal.ToString() + "-CedulaRFC.pdf"; ViewBag.Identificacion = @"C:\inetpub\RepositorioVER\" + IdRepresentanteLegal.ToString() + "-Identificacion.pdf"; ViewBag.PoderNotarial = @"C:\inetpub\RepositorioVER\" + IdRepresentanteLegal.ToString() + "-PoderNotarial.pdf"; CatRepresentantesLegales RepresentanteLegal = new CatRepresentantesLegales(); RepresentanteLegal = LogicaRepresentanteLegal.L_DetallesRepresentanteLegal(IdRepresentanteLegal); //Cambio de código postal if (RepresentanteLegal.RL_CodigoPostal == "00000") { RepresentanteLegal.RL_CodigoPostal = ""; } CargarListasDesplegables(RepresentanteLegal.RL_CodigoPostal, RepresentanteLegal.RL_IdEntidadFederativa, RepresentanteLegal.RL_IdMunicipio, RepresentanteLegal.RL_IdLocalidad); ViewBag.RFCRepresentante = Usuario.U_RFCRepresentanteAsociado; return(View(RepresentanteLegal)); } catch (Exception ex) { TempData["notice"] = ConfigurationManager.AppSettings["MensajeError"].ToString(); Session["TipoAlerta"] = "Error"; MetodoGeneral.RegistroDeError(ex.Message, "RepresentantesLegales: Actualizar"); return(RedirectToAction("Index")); } }
public ActionResult DatosUsuario(CatRepresentantesLegales Representante) { try { if (Session["Registrando"] == null) { TempData["notice"] = "La sesión ha expirado."; return(RedirectToAction("Logout", "Home")); } Usuario = (CatUsuarios)Session["NuevoAcceso_Usuario"]; Session.Add("NuevoAcceso_Representante", Representante); if (Usuario == null) { return(View()); } else { return(View("DatosUsuario", Usuario)); } } catch (Exception ex) { TempData["notice"] = ConfigurationManager.AppSettings["MensajeError"].ToString(); Session["TipoAlerta"] = "Error"; MetodoGeneral.RegistroDeError(ex.Message, "Registro de inversionista: Tercer Paso"); return(View("Index", "Home")); } }
public ActionResult Eliminar(int IdRepresentanteLegal) { try { CatUsuarios Usuario = (CatUsuarios)Session["Usuario"]; if (Usuario == null || Usuario.U_IdTipoUsuario != 2) { TempData["notice"] = "La sesión ha expirado."; return(RedirectToAction("Logout", "Home")); } CatRepresentantesLegales Representante = new CatRepresentantesLegales(); Representante = LogicaRepresentanteLegal.L_DetallesRepresentanteLegal(IdRepresentanteLegal); if (Representante.RL_CodigoPostal == "00000") { Representante.RL_CodigoPostal = ""; } ViewBag.RFCRepresentante = Usuario.U_RFCRepresentanteAsociado; ViewBag.NombreRepresentanteEliminar = Representante.RL_Nombre + " " + Representante.RL_PrimerApellido + " " + Representante.RL_SegundoApellido; return(View(Representante)); } catch (Exception ex) { TempData["notice"] = ConfigurationManager.AppSettings["MensajeError"].ToString(); Session["TipoAlerta"] = "Error"; MetodoGeneral.RegistroDeError(ex.Message, "RepresentantesLegales: Eliminar"); return(RedirectToAction("Index")); } }
public ActionResult Detalles(int IdRepresentanteLegal) { try { CatUsuarios Usuario = (CatUsuarios)Session["Usuario"]; if (Usuario == null || Usuario.U_IdTipoUsuario != 2) { TempData["notice"] = "La sesión ha expirado."; return(RedirectToAction("Logout", "Home")); } CatRepresentantesLegales RepresentanteLegal = new CatRepresentantesLegales(); RepresentanteLegal = LogicaRepresentanteLegal.L_DetallesRepresentanteLegal(IdRepresentanteLegal); //RepresentanteLegal.RL_CodigoPostal = null; //if (RepresentanteLegal.RL_CodigoPostal == "00000") { RepresentanteLegal.RL_CodigoPostal = ""; } return(View(RepresentanteLegal)); } catch (Exception ex) { TempData["notice"] = ConfigurationManager.AppSettings["MensajeError"].ToString(); Session["TipoAlerta"] = "Error"; MetodoGeneral.RegistroDeError(ex.Message, "RepresentantesLegales: Detalles"); return(RedirectToAction("Index")); } }
//COMUNICACIÓN: Pasando a Datos de acreditación sin haber cargado datos de un usuario operativo public ActionResult DatosAcreditacionB() { try { if (Session["Registrando"] == null) { TempData["notice"] = "La sesión ha expirado."; return(RedirectToAction("Logout", "Home")); } Session["NuevoAcceso_Usuario"] = null; Session["NuevoAcceso_Usuario"] = null; Representante = (CatRepresentantesLegales)Session["NuevoAcceso_Representante"]; ViewBag.RFCRepresentante = Representante.RL_RFC; Empresa = (CatEmpresas)Session["NuevoAcceso_Empresa"]; if (Empresa.E_RFC.Length == 12) { ViewBag.MostrarDocumento = true; } else { ViewBag.MostrarDocumento = false; } return(View("DatosAcreditacion")); } catch (Exception ex) { TempData["notice"] = ConfigurationManager.AppSettings["MensajeError"].ToString(); Session["TipoAlerta"] = "Error"; MetodoGeneral.RegistroDeError(ex.Message, "Registro de inversionista: Cuarto Paso B"); return(View("Index", "Home")); } }
public ActionResult DatosAcreditacion(CatUsuarios UsuarioOperativo) { try { if (Session["Registrando"] == null) { TempData["notice"] = "La sesión ha expirado."; return(RedirectToAction("Logout", "Home")); } if (UsuarioOperativo.U_Password == UsuarioOperativo.U_ConfirmarPassword) { LogicaUsuarios LogicaUsuario = new LogicaUsuarios(); CatUsuarios UsuarioExistente = LogicaUsuario.L_DetallesUsuarioPorNombreUnicamente(UsuarioOperativo.U_Nombre); if (UsuarioExistente.U_IdUsuario > 0) { TempData["notice"] = "Ya existe un usuario con el mismo nombre, por favor elige otro."; Session["TipoAlerta"] = "Error"; return(View("DatosUsuario", UsuarioOperativo)); } else { Representante = (CatRepresentantesLegales)Session["NuevoAcceso_Representante"]; Session.Add("NuevoAcceso_Usuario", UsuarioOperativo); ViewBag.RFCRepresentante = Representante.RL_RFC; Empresa = (CatEmpresas)Session["NuevoAcceso_Empresa"]; if (Empresa.E_RFC.Length == 12) { ViewBag.MostrarDocumento = true; } else { ViewBag.MostrarDocumento = false; } return(View()); } } else { TempData["notice"] = "Las contraseñas no coinciden."; Session["TipoAlerta"] = "Error"; return(View("DatosUsuario", UsuarioOperativo)); } } catch (Exception ex) { TempData["notice"] = ConfigurationManager.AppSettings["MensajeError"].ToString(); Session["TipoAlerta"] = "Error"; MetodoGeneral.RegistroDeError(ex.Message, "Registro de inversionista: Cuarto Paso A"); return(View("Index", "Home")); } }
public ActionResult DatosRepresentante(CatEmpresas Empresa) { try { if (Session["Registrando"] == null) { TempData["notice"] = "La sesión ha expirado."; return(RedirectToAction("Logout", "Home")); } Representante = (CatRepresentantesLegales)Session["NuevoAcceso_Representante"]; Session.Add("NuevoAcceso_Empresa", Empresa); LogicaEmpresas LogicaEmpresa = new LogicaEmpresas(); CatEmpresas EmpresaExistente = LogicaEmpresa.L_DetallesEmpresaPorRFC(Empresa.E_RFC); if (EmpresaExistente.E_RFC == null) { if (Representante == null) { CargarListasDesplegables(null, null, null, null); return(View()); } else { //Cambio de Código Póstal //if (Empresa.E_CodigoPostal == 0 || Empresa.E_CodigoPostal == null) { Empresa.E_CodigoPostal = null; } CargarListasDesplegables(Representante.RL_CodigoPostal, Representante.RL_IdEntidadFederativa, Representante.RL_IdMunicipio, Representante.RL_IdLocalidad); return(View("DatosRepresentante", Representante)); } } else { TempData["notice"] = "Ya existe una empresa con el mismo RFC en la base de datos."; Session["TipoAlerta"] = "Error"; CargarListasDesplegables(Empresa.E_CodigoPostal, Empresa.E_IdEntidadFederativa, Empresa.E_IdMunicipio, Empresa.E_IdLocalidad); return(View("Index", Empresa)); } } catch (Exception ex) { TempData["notice"] = ConfigurationManager.AppSettings["MensajeError"].ToString(); Session["TipoAlerta"] = "Error"; MetodoGeneral.RegistroDeError(ex.Message, "Registro de inversionista: Segundo Paso"); return(View("Index", "Home")); } }
public void L_ValidarRegistro(CatRepresentantesLegales Representante, string Contrasenia, string ContraseniaReal) { DatosRepresentantesLegales DatosAuxiliar = new DatosRepresentantesLegales(); Representante.RL_IdEstatusSolicitudRepresentante = 3; Representante.RL_Activo = true; DatosAuxiliar.D_ActualizarRepresentanteLegal(Representante); DatosUsuarios DatosAuxiliar2 = new DatosUsuarios(); DatosAuxiliar2.D_ActivarUsuariosPorRepresentante(Representante.RL_IdRepresentanteLegal, Contrasenia, ContraseniaReal); MetodosGenerales MetodoGeneral = new MetodosGenerales(); LogicaUsuarios LogicaUsuario = new LogicaUsuarios(); //CatUsuarios UsuarioDigitalizacion = LogicaUsuario.L_DetallesUsuarioPorRepresentante(Representante.RL_IdRepresentanteLegal); //MetodoGeneral.RegistrarUsuario(UsuarioDigitalizacion.U_Nombre, ContraseniaReal, UsuarioDigitalizacion.U_CorreoElectronico); }
public ActionResult RegresarDatosRepresentante(CatUsuarios Usuario) { try { if (Session["Registrando"] == null) { TempData["notice"] = "La sesión ha expirado."; return(RedirectToAction("Logout", "Home")); } Session["NuevoAcceso_Usuario"] = Usuario; Representante = (CatRepresentantesLegales)Session["NuevoAcceso_Representante"]; CargarListasDesplegables(Representante.RL_CodigoPostal, Representante.RL_IdEntidadFederativa, Representante.RL_IdMunicipio, Representante.RL_IdLocalidad); return(View("DatosRepresentante", Representante)); } catch (Exception ex) { TempData["notice"] = ConfigurationManager.AppSettings["MensajeError"].ToString(); Session["TipoAlerta"] = "Error"; MetodoGeneral.RegistroDeError(ex.Message, "Registro de inversionista: Regreso a Representante"); return(View("Index", "Home")); } }
public ActionResult EliminarRepresentanteLegal(CatRepresentantesLegales Representante, string Accion, IEnumerable <HttpPostedFileBase> files) { CatEmpresas Empresa = new CatEmpresas(); MetodosGenerales MetodoGeneral = new MetodosGenerales(); CatUsuarios Usuario = (CatUsuarios)Session["Usuario"]; if (Usuario == null || Usuario.U_IdTipoUsuario != 2) { TempData["notice"] = "La sesión ha expirado."; return(RedirectToAction("Logout", "Home")); } try { LogicaEmpresas LogicaEmpresa = new LogicaEmpresas(); Empresa = LogicaEmpresa.L_DetallesEmpresa(Usuario.U_IdEmpresa); string Validacion = ""; string RFCAsociado = ""; RFCAsociado = Session["RFCAsociado"].ToString(); Validacion = MetodoGeneral.ValidarFIEL(files, Representante.RL_ClavePrivada, RFCAsociado); if (Validacion == "Validación exitosa") { if (LogicaRepresentanteLegal.L_EliminarRepresentanteLegal(Representante.RL_IdRepresentanteLegal)) { CatUsuarios UsuarioDelRepresentante = new CatUsuarios(); LogicaUsuarios LogicaUsuario = new LogicaUsuarios(); UsuarioDelRepresentante = LogicaUsuario.L_DetallesUsuarioPorRepresentante(Representante.RL_IdRepresentanteLegal); if (Usuario.U_IdUsuario == UsuarioDelRepresentante.U_IdUsuario) { TempData["notice"] = "El representante ha sido eliminado de manera existosa."; Session["TipoAlerta"] = "Correcto"; return(RedirectToAction("Logout", "Home")); } else { TempData["notice"] = "Se ha deshabilitado un representante legal para esta empresa."; Session["TipoAlerta"] = "Correcto"; Usuario = (CatUsuarios)Session["Usuario"]; if (Usuario == null || Usuario.U_IdTipoUsuario != 2) { TempData["notice"] = "La sesión ha expirado."; return(RedirectToAction("Logout", "Home")); } else { List <CatRepresentantesLegales> ListaRepresentantesLegales = new List <CatRepresentantesLegales>(); ListaRepresentantesLegales = LogicaRepresentanteLegal.L_SeleccionarRepresentantesLegalesPorEmpresa(Usuario.U_IdEmpresa); ViewBag.CantidadRL = ListaRepresentantesLegales.Count(); return(View("Index", ListaRepresentantesLegales)); } } } else { TempData["notice"] = "Operación no concluida, favor de comunicarse con un administrador de SENER."; Session["TipoAlerta"] = "Error"; return(View("Eliminar", Representante)); } } else { TempData["notice"] = Validacion; Session["TipoAlerta"] = "Error"; return(View("Eliminar", Representante)); } } catch (Exception ex) { TempData["notice"] = ConfigurationManager.AppSettings["MensajeError"].ToString(); Session["TipoAlerta"] = "Error"; MetodoGeneral.RegistroDeError(ex.Message, "RepresentantesLegales: EliminarRepresentanteLegal"); return(View("Eliminar", Representante)); } }
private void CrearAcuseRegistroInversionista(string GUID, string target, CatEmpresas Empresa, CatRepresentantesLegales Representante) { string Fecha = DateTime.Now.ToString(); #region CrearCódigo QR string EmpresaNumeroInterior = "SN"; string RepresentanteNumeroInterior = "SN"; string RepresentanteExtensionTelefonica = "SN"; if (Empresa.E_NumeroInterior != null) { EmpresaNumeroInterior = Empresa.E_NumeroInterior; } if (Representante.RL_ExtensionTelefonica != null) { RepresentanteExtensionTelefonica = Representante.RL_ExtensionTelefonica.ToString(); } if (Representante.RL_NumeroInterior != null) { RepresentanteNumeroInterior = Representante.RL_NumeroInterior; } string CadenaDatos = "Nombre Comercial: " + Empresa.E_NombreComercial + "//" + "RFC Empresa: " + Empresa.E_RFC + "//" + "Contacto: " + "(" + Empresa.E_Lada.ToString() + ") " + Empresa.E_TelefonoFijo.ToString() + "//" + "Calle: " + Empresa.E_Calle + "//" + "Número Exterior: " + Empresa.E_NumeroExterior + "//" + "Número Interior: " + EmpresaNumeroInterior + "//" + "Colonia: " + Empresa.E_Colonia + "//" + "C.P.: " + Empresa.E_CodigoPostal + "//" + "Municipio: " + Empresa.E_Municipio + "//" + "Entidad Federativa: " + Empresa.E_EntidadFederativa + "//" + "Nombre: " + Representante.RL_Nombre + " " + Representante.RL_PrimerApellido + " " + Representante.RL_SegundoApellido + "//" + "RFC Representante: " + Representante.RL_RFC + "//" + "Contacto: " + "(" + Representante.RL_Lada.ToString() + ") " + Representante.RL_TelefonoFijo.ToString() + " Ext. " + RepresentanteExtensionTelefonica + "//" + "Teléfono Móvil: " + Representante.RL_TelefonoCelular + "//" + "Calle: " + Representante.RL_Calle + "//" + "Número Exterior: " + Representante.RL_NumeroExterior + "//" + "Número Interior: " + Representante.RL_NumeroInterior + "//" + "Colonia: " + Representante.RL_Colonia + "//" + "C.P.: " + Representante.RL_CodigoPostal + "//" + "Municipio: " + Representante.RL_Municipio + "//" + "Entidad Federativa: " + Representante.RL_EntidadFederativa + "//" + "Fecha: " + Fecha; string CadenaDatosEncriptada = MetodoGeneral.EncriptarPassword(CadenaDatos + GUID + "ClaveSENER" + Fecha); string UrlImagen = @"C:\inetpub\RepositorioVER\Representantes\" + Representante.RL_IdRepresentanteLegal + "\\" + "qrcodeAcuseRegistroRepresentante_PNG_A.png"; var qrEncoder = new QrEncoder(ErrorCorrectionLevel.H); var qrCode = qrEncoder.Encode(CadenaDatos + "//" + CadenaDatosEncriptada); var renderer = new GraphicsRenderer(new FixedModuleSize(3, QuietZoneModules.Two), Brushes.Black, Brushes.White); using (var stream = new FileStream(UrlImagen, FileMode.Create)) renderer.WriteToStream(qrCode.Matrix, ImageFormat.Png, stream); #endregion #region Documento string sourcePath = ConfigurationManager.AppSettings["Oficio_RecepcionSolicitudRegistro"].ToString() + ".docx"; string targetPathDocx = target + ".docx"; string targetPathPdf = target + ".pdf"; System.IO.File.Copy(sourcePath, targetPathDocx, true); Microsoft.Office.Interop.Word.Application appWord = new Microsoft.Office.Interop.Word.Application(); appWord.Visible = false; Microsoft.Office.Interop.Word.Document wordDocument = appWord.Documents.Open(targetPathDocx, ReadOnly: false, Visible: false); wordDocument.Activate(); string ContactoEmpresa = "Teléfono (" + Empresa.E_Lada.ToString() + ") " + Empresa.E_TelefonoFijo.ToString(); string NombreRepresentante = Representante.RL_Nombre + " " + Representante.RL_PrimerApellido + " " + Representante.RL_SegundoApellido; string ContactoRepresentanteLegal = "Teléfono (" + Representante.RL_Lada.ToString() + ") " + Representante.RL_TelefonoFijo.ToString() + " Ext. " + RepresentanteExtensionTelefonica + ", Teléfono móvil: " + Representante.RL_TelefonoCelular.ToString(); try { EmpresaNumeroInterior = Empresa.E_NumeroInterior.ToString(); } catch { } string EmpresaCodigoPostal = ""; try { EmpresaCodigoPostal = Empresa.E_CodigoPostal.ToString(); } catch { } try { RepresentanteNumeroInterior = Representante.RL_NumeroInterior.ToString(); } catch { } string RepresentanteCodigoPostal = ""; try { RepresentanteCodigoPostal = Representante.RL_CodigoPostal.ToString(); } catch { } MetodoGeneral.ReemplazarValoresEnTexto(appWord, "#NombreEmpresa#", Empresa.E_NombreComercial); MetodoGeneral.ReemplazarValoresEnTexto(appWord, "#RFCEmpresa#", Empresa.E_RFC); MetodoGeneral.ReemplazarValoresEnTexto(appWord, "#ContactoEmpresa#", ContactoEmpresa); MetodoGeneral.ReemplazarValoresEnTexto(appWord, "#DomicilioEmpresaCalle#", Empresa.E_Calle); MetodoGeneral.ReemplazarValoresEnTexto(appWord, "#DomicilioEmpresaNExterior#", Empresa.E_NumeroExterior.ToString()); MetodoGeneral.ReemplazarValoresEnTexto(appWord, "#DomicilioEmpresaNInterior#", EmpresaNumeroInterior); MetodoGeneral.ReemplazarValoresEnTexto(appWord, "#DomicilioEmpresaColonia#", Empresa.E_Colonia); MetodoGeneral.ReemplazarValoresEnTexto(appWord, "#DomicilioEmpresaCP#", EmpresaCodigoPostal); MetodoGeneral.ReemplazarValoresEnTexto(appWord, "#DomicilioEmpresaMunicipio#", Empresa.E_Municipio); MetodoGeneral.ReemplazarValoresEnTexto(appWord, "#DomicilioEmpresaEstado#", Empresa.E_EntidadFederativa); MetodoGeneral.ReemplazarValoresEnTexto(appWord, "#NombreRepresentanteLegal#", NombreRepresentante); MetodoGeneral.ReemplazarValoresEnTexto(appWord, "#RFCRepresentanteLegal#", Representante.RL_RFC); MetodoGeneral.ReemplazarValoresEnTexto(appWord, "#ContactoRepresentanteLegal#", ContactoRepresentanteLegal); MetodoGeneral.ReemplazarValoresEnTexto(appWord, "#DomicilioRepresentanteCalle#", Representante.RL_Calle); MetodoGeneral.ReemplazarValoresEnTexto(appWord, "#DomicilioRepresentanteNExterior#", Representante.RL_NumeroExterior.ToString()); MetodoGeneral.ReemplazarValoresEnTexto(appWord, "#DomicilioRepresentanteNInterior#", RepresentanteNumeroInterior); MetodoGeneral.ReemplazarValoresEnTexto(appWord, "#DomicilioRepresentanteColonia#", Representante.RL_Colonia); MetodoGeneral.ReemplazarValoresEnTexto(appWord, "#DomicilioRepresentanteCP#", RepresentanteCodigoPostal); MetodoGeneral.ReemplazarValoresEnTexto(appWord, "#DomicilioRepresentanteMunicipio#", Representante.RL_Municipio); MetodoGeneral.ReemplazarValoresEnTexto(appWord, "#DomicilioRepresentanteEstado#", Representante.RL_EntidadFederativa); MetodoGeneral.ReemplazarValoresEnTexto(appWord, "#Fecha#", Fecha); MetodoGeneral.ReemplazarValoresEnTexto(appWord, "#Clave#", CadenaDatosEncriptada); var shape = wordDocument.Bookmarks["QRCode"].Range.InlineShapes.AddPicture(UrlImagen, false, true); shape.Width = 100; shape.Height = 100; //app.Visible = true; //MetodoGeneral.ReemplazarQRCodeEnTexto(appWord, "#QRCode#", "Jaja", UrlImagen ); wordDocument.Save(); //wordDocument.SaveAs2(targetPathPdf, WdSaveFormat.wdFormatPDF); wordDocument.ExportAsFixedFormat(targetPathPdf, WdExportFormat.wdExportFormatPDF); ((Microsoft.Office.Interop.Word._Document)wordDocument).Close(); ((Microsoft.Office.Interop.Word._Application)appWord).Quit(); #endregion }
public NotificacionesIOP.HeaderInteroperabilidad ObtenerHeaderInteroperabilidad(CatProyectos proyectos, CatRepresentantesLegales ReLegal) { var headerInteroperabilidad = new NotificacionesIOP.HeaderInteroperabilidad() { DestinoNegocio = "T", FolioPeticion = Guid.NewGuid().ToString(), HomoclaveDestino = "CRE-15-022", IdConsumidorIOP = "SENER", IdGlobal = proyectos.P_IdGlobal, IdProductorIOP = "CRE", Identidad = ReLegal.RL_CedulaRFC, OrigenNegocio = "M" }; return(headerInteroperabilidad); }
public ActionResult InsertarPrimerusuario(IEnumerable <HttpPostedFileBase> files, FormCollection form) { LogicaUsuarios Logicausuarios = new LogicaUsuarios(); LogicaEmpresas LogicaEmpresas = new LogicaEmpresas(); LogicaRepresentantesLegales LogicaRepresentantesLegales = new LogicaRepresentantesLegales(); LogicaHome LogicaHome = new LogicaHome(); string FechaActual = DateTime.Now.ToString("yyyy-MM-dd HH.mm.ss"); try { if (Session["Registrando"] == null) { TempData["notice"] = "La sesión ha expirado."; return(RedirectToAction("Logout", "Home")); } Empresa = (CatEmpresas)Session["NuevoAcceso_Empresa"]; Representante = (CatRepresentantesLegales)Session["NuevoAcceso_Representante"]; string ClavePrivada = form["RL_ClavePrivada"]; string Validacion = MetodoGeneral.ValidarFIEL(files, ClavePrivada, Representante.RL_RFC); if (Validacion == "Validación exitosa") { CatEmpresas EmpresaSession = (CatEmpresas)Session["NuevoAcceso_Empresa"]; EmpresaSession.E_CompartirDatos = false; if (form["CompartirDatos"].Equals("2")) { EmpresaSession.E_CompartirDatos = true; } CatUsuarios UsuarioOperativoSession = (CatUsuarios)Session["NuevoAcceso_Usuario"]; //LogicaHome.L_InsertarRegistroSolicitud(EmpresaSession, Representante, UsuarioOperativoSession); string GUID = LogicaHome.L_InsertarRegistroSolicitud(Empresa, Representante, UsuarioOperativoSession); string ext = ""; X509Certificate2 CertificadoParaFirma = new X509Certificate2(); CatRepresentantesLegales NuevoRepresentante = (CatRepresentantesLegales)Session["NuevoAcceso_Representante"]; if (!Directory.Exists(@"C:\inetpub\RepositorioVER\Representantes\" + NuevoRepresentante.RL_IdRepresentanteLegal.ToString())) { DirectoryInfo di = Directory.CreateDirectory(@"C:\inetpub\RepositorioVER\Representantes\" + NuevoRepresentante.RL_IdRepresentanteLegal.ToString()); } int num_archivo = 0; foreach (string inputTagName in Request.Files) { HttpPostedFileBase file = Request.Files[num_archivo]; num_archivo = num_archivo + 1; ext = Path.GetExtension(file.FileName); if (ext != ".cer" && ext != ".key") { bool PdfValido = MetodoGeneral.ReadByteArrayFromFile(file); if ((file.ContentType.ToString().ToLower() == "application/pdf" && PdfValido) || file.ContentType.ToString().ToLower() == "application/x-zip-compressed") { string path = @"C:\inetpub\RepositorioVER\Representantes\" + NuevoRepresentante.RL_IdRepresentanteLegal.ToString() + "\\" + inputTagName + "_PDF_" + FechaActual + ext; using (Stream fs = file.InputStream) { fs.Flush(); fs.Position = 0; CertificadoParaFirma = MetodoGeneral.ObtenerCertificadoParaFirmar(files, ClavePrivada); MetodoGeneral.SignWithThisCert(CertificadoParaFirma, fs, path); } } } } TempData["notice"] = "Los datos han sido registrados exitosamente."; Session.Clear(); Session["TipoAlerta"] = "Correcto"; string target = @"C:\inetpub\RepositorioVER\Representantes\" + NuevoRepresentante.RL_IdRepresentanteLegal.ToString() + "\\" + "AcuseRegistroInversionista_PDF_" + FechaActual; CatRepresentantesLegales DatosRepresentante = LogicaRepresentantesLegales.L_DetallesRepresentanteLegal(NuevoRepresentante.RL_IdRepresentanteLegal); CatEmpresas DatosEmpresa = LogicaEmpresas.L_DetallesEmpresa(DatosRepresentante.RL_IdEmpresa); CrearAcuseRegistroInversionista(GUID, target, DatosEmpresa, DatosRepresentante); //Enviar acuse: new System.Threading.Tasks.Task(() => { try { string CorreoRepresentante = Representante.RL_CorreoElectronico; Representante.RL_FechaRegistro = DateTime.Now.ToString(); Representante.RL_Observaciones = "Solicitud de registro enviada"; //CatRepresentantesLegales DatosRepresentante = LogicaRepresentantesLegales.L_DetallesRepresentanteLegal(NuevoRepresentante.RL_IdRepresentanteLegal); //CatEmpresas DatosEmpresa = LogicaEmpresas.L_DetallesEmpresa(DatosRepresentante.RL_IdEmpresa); System.Net.Mail.MailMessage email = new System.Net.Mail.MailMessage("*****@*****.**", CorreoRepresentante); email.To.Add(new MailAddress(ConfigurationManager.AppSettings["CorreoAdministrador"].ToString())); email.Subject = "Acuse de registro"; email.Attachments.Add(new Attachment(target + ".pdf")); //Obtener la plantilla en HTML: string pathCorreo = ConfigurationManager.AppSettings["Html_AcuseRegistroENREL"].ToString(); string ContenidoCorreo = System.IO.File.ReadAllText(pathCorreo); //Reemplazar información string ContactoEmpresa = "Teléfono (" + DatosEmpresa.E_Lada + ") " + DatosEmpresa.E_TelefonoFijo.ToString(); string NombreRepresentante = DatosRepresentante.RL_Nombre + " " + DatosRepresentante.RL_PrimerApellido + " " + DatosRepresentante.RL_SegundoApellido; string ContactoRepresentanteLegal = "Teléfono (" + DatosRepresentante.RL_Lada + ") " + DatosRepresentante.RL_TelefonoFijo.ToString() + " Ext. " + DatosRepresentante.RL_ExtensionTelefonica + ", Teléfono móvil: " + DatosRepresentante.RL_TelefonoCelular; string EmpresaNumeroInterior = ""; try { EmpresaNumeroInterior = DatosEmpresa.E_NumeroInterior.ToString(); } catch { } string EmpresaCodigoPostal = ""; try { EmpresaCodigoPostal = DatosEmpresa.E_CodigoPostal.ToString(); } catch { } string RepresentanteNumeroInterior = ""; try { RepresentanteNumeroInterior = DatosRepresentante.RL_NumeroInterior.ToString(); } catch { } string RepresentanteCodigoPostal = ""; try { RepresentanteCodigoPostal = DatosRepresentante.RL_CodigoPostal.ToString(); } catch { } ContenidoCorreo = ContenidoCorreo.Replace("#NombreEmpresa#", DatosEmpresa.E_NombreComercial); ContenidoCorreo = ContenidoCorreo.Replace("#RFCEmpresa#", DatosEmpresa.E_RFC); ContenidoCorreo = ContenidoCorreo.Replace("#ContactoEmpresa#", ContactoEmpresa); ContenidoCorreo = ContenidoCorreo.Replace("#DomicilioEmpresaCalle#", DatosEmpresa.E_Calle); ContenidoCorreo = ContenidoCorreo.Replace("#DomicilioEmpresaNExterior#", DatosEmpresa.E_NumeroExterior.ToString()); ContenidoCorreo = ContenidoCorreo.Replace("#DomicilioEmpresaNInterior#", EmpresaNumeroInterior); ContenidoCorreo = ContenidoCorreo.Replace("#DomicilioEmpresaColonia#", DatosEmpresa.E_Colonia); ContenidoCorreo = ContenidoCorreo.Replace("#DomicilioEmpresaCP#", EmpresaCodigoPostal); ContenidoCorreo = ContenidoCorreo.Replace("#DomicilioEmpresaMunicipio#", DatosEmpresa.E_Municipio); ContenidoCorreo = ContenidoCorreo.Replace("#DomicilioEmpresaEstado#", DatosEmpresa.E_EntidadFederativa); ContenidoCorreo = ContenidoCorreo.Replace("#NombreRepresentanteLegal#", NombreRepresentante); ContenidoCorreo = ContenidoCorreo.Replace("#RFCRepresentanteLegal#", DatosRepresentante.RL_RFC); ContenidoCorreo = ContenidoCorreo.Replace("#ContactoRepresentanteLegal#", ContactoRepresentanteLegal); ContenidoCorreo = ContenidoCorreo.Replace("#DomicilioRepresentanteCalle#", DatosRepresentante.RL_Calle); ContenidoCorreo = ContenidoCorreo.Replace("#DomicilioRepresentanteNExterior#", DatosRepresentante.RL_NumeroExterior.ToString()); ContenidoCorreo = ContenidoCorreo.Replace("#DomicilioRepresentanteNInterior#", RepresentanteNumeroInterior); ContenidoCorreo = ContenidoCorreo.Replace("#DomicilioRepresentanteColonia#", DatosRepresentante.RL_Colonia); ContenidoCorreo = ContenidoCorreo.Replace("#DomicilioRepresentanteCP#", RepresentanteCodigoPostal); ContenidoCorreo = ContenidoCorreo.Replace("#DomicilioRepresentanteMunicipio#", DatosRepresentante.RL_Municipio); ContenidoCorreo = ContenidoCorreo.Replace("#DomicilioRepresentanteEstado#", DatosRepresentante.RL_EntidadFederativa); AlternateView htmlView = AlternateView.CreateAlternateViewFromString(ContenidoCorreo, null, "text/html"); //Obtener imágenes: LinkedResource Logotipo_SENER = new LinkedResource(ConfigurationManager.AppSettings["Logotipo_SENER"].ToString()); Logotipo_SENER.ContentId = "Logotipo_SENER"; htmlView.LinkedResources.Add(Logotipo_SENER); LinkedResource Logotipo_MEXICO = new LinkedResource(ConfigurationManager.AppSettings["Logotipo_MEXICO"].ToString()); Logotipo_MEXICO.ContentId = "Logotipo_MEXICO"; htmlView.LinkedResources.Add(Logotipo_MEXICO); email.AlternateViews.Add(htmlView); email.IsBodyHtml = true; email.Priority = MailPriority.High; SmtpClient smtp = new SmtpClient(); smtp.Host = "172.16.70.110"; smtp.Port = 25; smtp.EnableSsl = false; smtp.UseDefaultCredentials = false; smtp.Send(email); email.Dispose(); } catch (Exception ex) { MetodoGeneral.RegistroDeError(ex.Message, "Registro de inversionista: Quinto Paso - Envío de correo"); } }).Start(); return(View()); } else { TempData["notice"] = Validacion; Session["TipoAlerta"] = "Error"; MetodoGeneral.RegistroDeError(Validacion, "Registro de inversionista: Quinto Paso"); Representante = (CatRepresentantesLegales)Session["NuevoAcceso_Representante"]; ViewBag.RFCRepresentante = Representante.RL_RFC; if (Empresa.E_RFC.Length == 12) { ViewBag.MostrarDocumento = true; } else { ViewBag.MostrarDocumento = false; } return(View("DatosAcreditacion")); } } catch (Exception ex) { TempData["notice"] = ConfigurationManager.AppSettings["MensajeError"].ToString(); Session["TipoAlerta"] = "Error"; MetodoGeneral.RegistroDeError(ex.InnerException.ToString(), "Registro de inversionista: Quinto Paso"); if (Empresa.E_IdEmpresa > 0) { LogicaHome.L_EliminarIntentoRegistro(Empresa.E_IdEmpresa); } ViewBag.RFCRepresentante = Representante.RL_RFC; if (Empresa.E_RFC.Length == 12) { ViewBag.MostrarDocumento = true; } else { ViewBag.MostrarDocumento = false; } return(View("DatosAcreditacion")); } }
public NotificacionesIOP.CamposPersonalizados ObtenerCamposPersonalizados(CatProyectos proyectos, CatEmpresas empresas, CatRepresentantesLegales ReLegal) { var empresa = new NotificacionesIOP.Empresa() { Calle = empresas.E_Calle, CodigoPostal = empresas.E_CodigoPostal, Colonia = empresas.E_Colonia, CorreoElectronico = empresas.E_CorreoElectronico, EntidadFederativa = empresas.E_EntidadFederativa, Lada = empresas.E_Lada, Localidad = empresas.E_Localidad, Municipio = empresas.E_Municipio, NombreComercial = empresas.E_NombreComercial, NumeroExterior = empresas.E_NumeroExterior, NumeroInterior = empresas.E_NumeroInterior, RFC = empresas.E_RFC, RazonSocial = empresas.E_RazonSocial, TelefonoFijo = empresas.E_TelefonoFijo, TipoAsentamiento = empresas.E_IdTipoAsentamiento.ToString(), TipoVialidad = empresas.E_IdTipoVialidad.ToString() }; var proyecto = new NotificacionesIOP.Proyecto() { P_Avance = "0", P_CapacidadInstalada = proyectos.P_CapacidadInstalada.ToString(), P_CodigoPostal = proyectos.P_CodigoPostal, P_Colonia = proyectos.P_Colonia, P_EntidadFederativa = proyectos.P_EntidadFederativa, P_EstatusProyecto = proyectos.P_EstatusProyecto, P_FactorPlanta = proyectos.P_FactorPlanta.ToString(), P_Fase = "1", P_FechaRegistro = proyectos.P_FechaRegistro.ToString(), P_GeneracionAnual = proyectos.P_GeneracionAnual.ToString(), P_IdGlobalMacroTramite = proyectos.P_IdGlobal, P_IdTipoAsentamiento = proyectos.P_IdTipoAsentamiento.ToString(), P_IdTipoVialidad = proyectos.P_IdTipoVialidad.ToString(), P_Latitud = proyectos.P_Latitud.ToString(), P_Localidad = proyectos.P_Localidad, P_Longitud = proyectos.P_Longitud.ToString(), P_MontoInversion = proyectos.P_MontoInversion.ToString(), P_Municipio = proyectos.P_Municipio, P_NombreProyecto = proyectos.P_NombreProyecto, P_PorcentajePositivo = proyectos.P_PorcentajePositivo.ToString(), P_Tecnologia = proyectos.P_Tecnologia, P_TipoAsentamiento = proyectos.P_IdTipoAsentamiento.ToString(), P_TipoVialidad = proyectos.P_TipoVialidad, P_Unidades = proyectos.P_Unidades.ToString() }; var representanteLegal = new NotificacionesIOP.RepresentanteLegal() { Apellido = ReLegal.RL_PrimerApellido, CURP = ReLegal.RL_CURP, Calle = ReLegal.RL_Calle, CodigoPostal = ReLegal.RL_CodigoPostal, Colonia = ReLegal.RL_Colonia, CorreoElectronico = ReLegal.RL_CorreoElectronico, EntidadFederativa = ReLegal.RL_EntidadFederativa, ExtensionTelefonica = ReLegal.RL_ExtensionTelefonica, Lada = ReLegal.RL_Lada, Localidad = ReLegal.RL_Localidad, Municipio = ReLegal.RL_IdMunicipio.ToString(), Nombre = ReLegal.RL_Nombre, NumeroExterior = ReLegal.RL_NumeroExterior, NumeroInterior = ReLegal.RL_NumeroInterior, RFC = ReLegal.RL_RFC, SegundoApellido = ReLegal.RL_SegundoApellido, TelefonoCelular = ReLegal.RL_TelefonoCelular, TelefonoFijo = ReLegal.RL_TelefonoFijo, TipoAsentamiento = ReLegal.RL_IdTipoAsentamiento.ToString(), TipoVialidad = ReLegal.RL_TipoCalle }; var camposPersonalizados = new NotificacionesIOP.CamposPersonalizados() { Empresa = empresa, Proyecto = proyecto, RepresentanteLegal = representanteLegal }; return(camposPersonalizados); }
public ActionResult Ingresar(CatUsuarios Usuario) { Session["TipoAlerta"] = ""; try { if (LogicaUsuarios.L_ValidarUsuario(Usuario.U_Nombre, Usuario.U_Password)) { CatUsuarios UsuarioEntrante = (CatUsuarios)Session["Usuario"]; if (UsuarioEntrante.U_Ingreso == false) { switch (UsuarioEntrante.U_IdTipoUsuario) { case 1: Session["TipoUsuario"] = "UsuarioOperativo"; Session["IdEmpresa"] = UsuarioEntrante.U_IdEmpresa; Session["NombreUsuario"] = UsuarioEntrante.U_Nombre; Session["IdUsuario"] = UsuarioEntrante.U_IdUsuario; LogicaUsuarios.L_ActualizarUsuarioEntrada(UsuarioEntrante.U_IdUsuario, true); return(RedirectToAction("InicioInversionista", "Home")); case 2: CatRepresentantesLegales RepresentanteAsociado = new CatRepresentantesLegales(); RepresentanteAsociado = LogicaRepresentanteLegal.L_DetallesRepresentanteLegal(UsuarioEntrante.U_IdRepresentanteAsociado); Session["RFCAsociado"] = RepresentanteAsociado.RL_RFC; Session["TipoUsuario"] = "Inversionista"; Session["IdEmpresa"] = UsuarioEntrante.U_IdEmpresa; Session["NombreUsuario"] = UsuarioEntrante.U_Nombre; Session["IdUsuario"] = UsuarioEntrante.U_IdUsuario; Session["IdRepresentanteActual"] = UsuarioEntrante.U_IdRepresentanteAsociado; LogicaUsuarios.L_ActualizarUsuarioEntrada(UsuarioEntrante.U_IdUsuario, true); return(RedirectToAction("InicioInversionista", "Home")); case 3: Session["TipoUsuario"] = "Consultor"; Session["IdUsuario"] = UsuarioEntrante.U_IdUsuario; Session["NombreUsuario"] = UsuarioEntrante.U_Nombre; LogicaUsuarios.L_ActualizarUsuarioEntrada(UsuarioEntrante.U_IdUsuario, true); return(RedirectToAction("Index", "Consultor")); case 4: Session["TipoUsuario"] = "Administrador"; Session["IdUsuario"] = UsuarioEntrante.U_IdUsuario; Session["NombreUsuario"] = UsuarioEntrante.U_Nombre; LogicaUsuarios.L_ActualizarUsuarioEntrada(UsuarioEntrante.U_IdUsuario, true); return(RedirectToAction("InicioAdministrador", "Home")); default: Session.Clear(); UsuarioEntrante = null; Session["TipoAlerta"] = "Error"; TempData["notice"] = "Tipo de usuario no válido."; return(RedirectToAction("Index", "Home")); } } else { Session.Clear(); //FinalizarSesion(); Session["TipoAlerta"] = "Error"; TempData["notice"] = "Ya existe una sesión con este usuario."; return(RedirectToAction("Index", "Home")); } } else { //FinalizarSesion(); Session.Clear(); Session["TipoAlerta"] = "Error"; TempData["notice"] = "No existe un usuario con este nombre y contraseña."; return(RedirectToAction("Index", "Home")); } } catch (Exception ex) { TempData["notice"] = ConfigurationManager.AppSettings["MensajeError"].ToString(); Session["TipoAlerta"] = "Error"; MetodoGeneral.RegistroDeError(ex.Message, "Home: Ingresar"); return(View("Index", "Home")); } }
public ActionResult AceptarResprepresentanteLegal(int IdEmpresa, int IdRepresentante) { LogicaUsuarios LogicaUsuarios = new LogicaUsuarios(); LogicaRepresentantesLegales LogicaRepresentantesLegales = new LogicaRepresentantesLegales(); LogicaHome LogicaHome = new LogicaHome(); try { CatUsuarios Usuario = (CatUsuarios)Session["Usuario"]; if (Usuario == null || Usuario.U_IdTipoUsuario != 4) { TempData["notice"] = "La sesión ha experiado."; return(RedirectToAction("Logout", "Home")); } else { CatUsuarios UsuarioRepresentante = LogicaUsuarios.L_DetallesUsuarioPorRepresentante(IdRepresentante); UsuarioRepresentante.U_Activo = true; CatRepresentantesLegales Representante = LogicaRepresentantesLegales.L_DetallesRepresentanteLegal(IdRepresentante); string CorreoRepresentante = Representante.RL_CorreoElectronico; Representante.RL_FechaRegistro = DateTime.Now.ToString(); Representante.RL_Observaciones = "Validado"; Representante.RL_IdEstatusSolicitudRepresentante = 3; Representante.RL_Activo = true; Guid DatoAleatorio = new Guid(); DatoAleatorio = Guid.NewGuid(); string clave = "C"; clave = clave + DatoAleatorio.ToString().Substring(0, 8); clave = clave + DatoAleatorio.ToString().Substring(9, 4); string ContraseniaUsuarioRepresentante = MetodoGeneral.EncriptarPassword(clave); LogicaHome.L_ValidarRegistro(Representante, ContraseniaUsuarioRepresentante, clave); new Task(() => { try { MailMessage email = new MailMessage("*****@*****.**", CorreoRepresentante); email.To.Add(new MailAddress(ConfigurationManager.AppSettings["CorreoAdministrador"].ToString())); email.Subject = "Solicitud ENREL aprobada"; //Obtener la plantilla en HTML: string path = ConfigurationManager.AppSettings["Html_AceptarSolicitud"].ToString(); string ContenidoCorreo = System.IO.File.ReadAllText(path); string NombreRepresentanteLegal = Representante.RL_Nombre + " " + Representante.RL_PrimerApellido + " " + Representante.RL_SegundoApellido; ContenidoCorreo = ContenidoCorreo.Replace("#NombreRepresentanteLegal#", NombreRepresentanteLegal); ContenidoCorreo = ContenidoCorreo.Replace("#UsuarioAcreditado#", UsuarioRepresentante.U_Nombre); ContenidoCorreo = ContenidoCorreo.Replace("#Contraseña#", clave); string Enlace = ConfigurationManager.AppSettings["EnlaceENREL"].ToString(); ContenidoCorreo = ContenidoCorreo.Replace("#EnlaceENREL#", Enlace); AlternateView htmlView = AlternateView.CreateAlternateViewFromString(ContenidoCorreo, null, "text/html"); //Obtener imágenes: LinkedResource Logotipo_SENER = new LinkedResource(ConfigurationManager.AppSettings["Logotipo_SENER"].ToString()); Logotipo_SENER.ContentId = "Logotipo_SENER"; htmlView.LinkedResources.Add(Logotipo_SENER); LinkedResource Logotipo_MEXICO = new LinkedResource(ConfigurationManager.AppSettings["Logotipo_MEXICO"].ToString()); Logotipo_MEXICO.ContentId = "Logotipo_MEXICO"; htmlView.LinkedResources.Add(Logotipo_MEXICO); email.AlternateViews.Add(htmlView); email.IsBodyHtml = true; email.Priority = MailPriority.High; SmtpClient smtp = new SmtpClient(); smtp.Host = "172.16.70.110"; smtp.Port = 25; smtp.EnableSsl = false; smtp.UseDefaultCredentials = false; smtp.Send(email); email.Dispose(); } catch (Exception ex) { MetodoGeneral.RegistroDeError(ex.Message, "Registro de inversionista: Quinto Paso - Envío de correo"); } }).Start(); TempData["notice"] = "Se validó el registro"; Session["TipoAlerta"] = "Correcto"; return(RedirectToAction("GestionarSolicitudesRegistro", "Administrador")); } } catch (Exception ex) { CatRepresentantesLegales Representante = new CatRepresentantesLegales(); Representante = LogicaRepresentantesLegales.L_DetallesRepresentanteLegal(IdRepresentante); Representante.RL_FechaRegistro = DateTime.Now.ToString(); Representante.RL_IdEstatusSolicitudRepresentante = 1; Representante.RL_Activo = true; Representante.RL_Observaciones = "Error, es necesario volver a validar"; LogicaRepresentantesLegales.L_ActualizarRepresentanteLegal(Representante); LogicaEmpresas LogicaEmpresa = new LogicaEmpresas(); CatEmpresas Empresa = LogicaEmpresa.L_DetallesEmpresa(Representante.RL_IdEmpresa); ViewBag.DatosEmpresa = Empresa; ViewBag.DatosRepresentante = Representante; string ruta = @"C:\inetpub\RepositorioVER\" + Representante.RL_IdRepresentanteLegal.ToString() + "-"; ViewBag.PoderNotarial = ruta + "PoderNotarial.pdf"; ViewBag.CedulaRFC = ruta + "CedulaRFC.pdf"; ViewBag.ActaConstitutiva = ruta + "ActaConstitutiva.pdf"; ViewBag.IdentificacionOficial = ruta + "Identificacion.pdf"; ViewBag.DatosRepresentante = Representante; TempData["notice"] = ConfigurationManager.AppSettings["MensajeError"].ToString(); Session["TipoAlerta"] = "Error"; MetodoGeneral.RegistroDeError(ex.Message, "RepresentantesLegales: Insertar"); return(View("ValidarSolicitud", new { IdRepresentante = IdRepresentante })); } }
public ActionResult ProyectoTramites() { string IdEstatusProyecto = "NO CAPTURADO"; string resultado = ""; bool ErrorBPM = false; try { CatUsuarios Usuario = (CatUsuarios)Session["Usuario"]; if (Usuario == null || Usuario.U_IdTipoUsuario != 2) { TempData["notice"] = "La sesión ha expirado."; return(RedirectToAction("Logout", "Home")); } int Idproyecto = Convert.ToInt32(Request.Form["IdProyecto"]); CatProyectos Proyecto = LogicaProyecto.L_DetallesProyectos(Idproyecto); string IdProyectoBPM = Idproyecto.ToString(); string Tecnologia = Proyecto.P_Tecnologia.ToLower(); //Crea la instancia de los WS de BPM que vaya a utilizar WSBPM_Nivel0.ProcessNivel0PortTypeClient CrearProyectos = new WSBPM_Nivel0.ProcessNivel0PortTypeClient(); WSBPM_Nivel3.ProcessNivel3PortTypeClient EnviarEstatus = new WSBPM_Nivel3.ProcessNivel3PortTypeClient(); IdEstatusProyecto = LogicaProyecto.L_SeleccionarProyectoSeguimiento(Idproyecto); if (IdEstatusProyecto == "CAPTURADO") { //COMUNICACIÓN: Enviar proyecto a BPM CrearProyectos.InicioNivel0(Idproyecto.ToString(), Proyecto.P_Tecnologia.ToLower()); LogicaProyecto.L_ActualizarProyectoSeguimiento(Idproyecto, 2); MetodoGeneral.RegistroDeError("Datos {IdProyecto: " + Idproyecto.ToString() + ", Tecnología: " + Proyecto.P_Tecnologia.ToLower() + "}", "Invocación Nivel 0 -"); MetodoGeneral.RegistroDeError(CrearProyectos.Endpoint.Address.ToString(), "Invocación Nivel 0 -"); } IdEstatusProyecto = LogicaProyecto.L_SeleccionarProyectoSeguimiento(Idproyecto); if (IdEstatusProyecto == "ENVIADOBPM") { //COMUNICACIÓN: Enviar proyecto a gobmx resultado = MetodoGeneral.RegistrarReferenciaMacroTramite(Proyecto.P_IdGlobal, Usuario.U_RFCRepresentanteAsociado); LogicaProyecto.L_ActualizarProyectoSeguimiento(Idproyecto, 3); LogicaProyecto.L_ActualizarProyectoSeguimiento(Idproyecto, 4); } IdEstatusProyecto = LogicaProyecto.L_SeleccionarProyectoSeguimiento(Idproyecto); if (IdEstatusProyecto == "INICIADO" || IdEstatusProyecto == "SUSPENDIDO") { //Preguntar estatus GOBMX RespuestaConsultaMacroTramite Resultado = MetodoGeneral.ConsultarMacroTramite(Proyecto.P_IdGlobal); //Guardar estatus de GOBMX en BD ENREL if (Resultado.cadenaInteroperabilidad != null && Resultado.cadenaInteroperabilidad.Count > 0) { LogicaTramite.L_ActualizarEstatusTramite(Resultado, Proyecto.P_IdProyecto); } //Obtener estatus de los trámites ya en la base de datos que tienen que ser actualizados en BPM: List <CatTramites> ListaTramitesActualizarBPM = LogicaTramite.L_SeleccionarProyectoTramitesParaEnviarBPM(Idproyecto); //COMUNICACIÓN: Reporta estatus a BPM try { foreach (CatTramites Tramite in ListaTramitesActualizarBPM) { if (Tramite.T_ConfirmacionBPM == false) { EnviarEstatus.receiveTask(Idproyecto.ToString(), Tramite.T_HomoClave, Tramite.T_Estatus.ToLower(), Tramite.T_Prorroga); MetodoGeneral.RegistroDeError("IDPROYECTO = '" + Idproyecto.ToString() + "', HOMOCLAVE ='" + Tramite.T_HomoClave + "', ESTATUS = '" + Tramite.T_Estatus.ToLower() + "'", "Invocación Nivel 3 - "); MetodoGeneral.RegistroDeError(EnviarEstatus.Endpoint.Address.ToString(), "Invocación Nivel 3 - "); } Thread.Sleep(100); } } catch (Exception ex) { Session["TipoAlerta"] = "Error"; MetodoGeneral.RegistroDeError(ex.Message, "ProyectoTramites"); ErrorBPM = true; } } IdEstatusProyecto = LogicaProyecto.L_SeleccionarProyectoSeguimiento(Idproyecto); switch (IdEstatusProyecto) { case "CAPTURADO": Session["TipoAlerta"] = "Error"; TempData["notice"] = "El proyecto se registró en ENREL pero no ha sido sido enviado al gestor de trámites."; return(RedirectToAction("Index")); case "ENVIADOBPM": Session["TipoAlerta"] = "Error"; TempData["notice"] = "El proyecto no ha sido registrado en Gobmx."; return(RedirectToAction("Index")); case "ENVIADOGOBMX": Session["TipoAlerta"] = "Error"; TempData["notice"] = "El proyecto ha sido registrado en Gobmx pero ocurrió un error inesperado"; return(RedirectToAction("Index")); case "CONCLUIDO": bool Resultado = MetodoGeneral.NotificarEstatusMacroTramite(Proyecto.P_IdGlobal, "1", "1"); if (Resultado) { LogicaProyecto.L_ActualizarProyectoSeguimiento(Idproyecto, 7); } break; default: break; } //Obtener estatus de los trámites ya en la base de datos: Thread.Sleep(1000); List <CatTramites> ListaTramites = LogicaTramite.L_SeleccionarProyectoTramites(Idproyecto, Proyecto.P_IdGlobal, Usuario.U_RFCRepresentanteAsociado, Session["OpenId"].ToString()); CatEmpresas Empresa = LogicaEmpresa.L_DetallesEmpresa(Proyecto.P_IdEmpresa); int IdRepresentante = (Int32)Session["IdRepresentanteActual"]; CatRepresentantesLegales RepresentanteLegal = LogicaRepresentanteLegal.L_DetallesRepresentanteLegal(IdRepresentante); List <CatEstatusTramite> TablaEstatus = LogicaTramite.L_TablaEstatusTramite(); CatAvanceTramites AvanceTramites = LogicaTramite.L_AvanceTramites(ListaTramites); CargarDatosProyecto(AvanceTramites, Proyecto, Empresa, RepresentanteLegal); if (ErrorBPM) { Session["TipoAlerta"] = "Error"; TempData["notice"] = "La información podría no estar actualizada"; } return(View(ListaTramites)); } catch (Exception ex) { Session["TipoAlerta"] = "Error"; MetodoGeneral.RegistroDeError(ex.Message, "ProyectoTramites"); switch (IdEstatusProyecto) { case "CAPTURADO": TempData["notice"] = "El proyecto se registró en ENREL pero no ha sido sido enviado al gestor de trámites."; return(RedirectToAction("Index")); case "ENVIADOBPM": TempData["notice"] = "El proyecto no ha sido registrado en Gobmx."; return(RedirectToAction("Index")); case "ENVIADOGOBMX": TempData["notice"] = "El proyecto ha sido registrado en Gobmx pero ocurrió un error inesperado"; return(RedirectToAction("Index")); default: TempData["notice"] = "Error inesperado, por favor consulte a un administrador de la aplicación."; return(RedirectToAction("Index")); } } }
public ActionResult ActualizarRepresentanteLegal(CatRepresentantesLegales Representante, string Accion, IEnumerable <HttpPostedFileBase> files) { CatEmpresas Empresa = new CatEmpresas(); MetodosGenerales MetodoGeneral = new MetodosGenerales(); CatUsuarios Usuario = (CatUsuarios)Session["Usuario"]; if (Usuario == null || Usuario.U_IdTipoUsuario != 2) { TempData["notice"] = "La sesión ha expirado."; RedirectToAction("Logout", "Home"); } try { LogicaEmpresas LogicaEmpresa = new LogicaEmpresas(); Empresa = LogicaEmpresa.L_DetallesEmpresa(Usuario.U_IdEmpresa); string Validacion = ""; string RFCAsociado = ""; RFCAsociado = Session["RFCAsociado"].ToString(); Validacion = MetodoGeneral.ValidarFIEL(files, Representante.RL_ClavePrivada, RFCAsociado); if (Validacion == "Validación exitosa") { Representante.RL_IdEstatusSolicitudRepresentante = 1; Representante.RL_Activo = true; if (LogicaRepresentanteLegal.L_ActualizarRepresentanteLegal(Representante)) { try { string ext = ""; int num_archivo = 0; foreach (string inputTagName in Request.Files) { HttpPostedFileBase file = Request.Files[num_archivo]; num_archivo = num_archivo + 1; ext = Path.GetExtension(file.FileName); if (ext != ".cer" && ext != ".key") { if (file.ContentType.ToString().ToLower() == "application/pdf") { var fileName = Path.GetFileName(file.FileName); //string path = @"C:\Users\jesusalejandro.ramos\Desktop\repositorio\" + Representante.RL_IdRepresentanteL.ToString() + "-" + inputTagName + ext; string path = @"C:\inetpub\RepositorioVER\" + Representante.RL_IdRepresentanteLegal.ToString() + "-" + inputTagName + ext; file.SaveAs(path); } } } TempData["notice"] = "El representante ha sido actualizado, deberá esperar un correo con el resultado de la nueva validación."; Session["TipoAlerta"] = "Correcto"; } catch (Exception ex) { TempData["notice"] = "La información se ha actualizado pero uno o varios archivos no han sido enviados, comunícate con algun administrador de SENER."; Session["TipoAlerta"] = "Error"; } } else { TempData["notice"] = "El representante no ha sido actualizado, por favor revise la información."; Session["TipoAlerta"] = "Error"; } } else { TempData["notice"] = Validacion; Session["TipoAlerta"] = "Error"; } //Despliegue de vista if (Session["TipoAlerta"] == "Error") { CargarListasDesplegables(Representante.RL_CodigoPostal, Representante.RL_IdEntidadFederativa, Representante.RL_IdMunicipio, Representante.RL_IdLocalidad); return(View("Actualizar", Representante)); } else { return(RedirectToAction("Logout", "Home")); } } catch (Exception ex) { TempData["notice"] = ConfigurationManager.AppSettings["MensajeError"].ToString(); Session["TipoAlerta"] = "Error"; MetodoGeneral.RegistroDeError(ex.Message, "RepresentantesLegales: ActualizarRepresentanteLegal"); return(View("Actualizar", Representante)); } }
public ActionResult InsertarRepresentanteLegal(CatRepresentantesLegales Representante, string Accion, IEnumerable <HttpPostedFileBase> files) { CatEmpresas Empresa = new CatEmpresas(); MetodosGenerales MetodoGeneral = new MetodosGenerales(); string FechaActual = DateTime.Now.ToString("yyyy-MM-dd HH.mm.ss"); CatUsuarios Usuario = (CatUsuarios)Session["Usuario"]; if (Usuario == null || Usuario.U_IdTipoUsuario != 2) { TempData["notice"] = "La sesión ha expirado."; RedirectToAction("Logout", "Home"); } try { LogicaEmpresas LogicaEmpresa = new LogicaEmpresas(); Empresa = LogicaEmpresa.L_DetallesEmpresa(Usuario.U_IdEmpresa); string Validacion = ""; string RFCAsociado = ""; RFCAsociado = Session["RFCAsociado"].ToString(); Validacion = MetodoGeneral.ValidarFIEL(files, Representante.RL_ClavePrivada, RFCAsociado); if (Validacion == "Validación exitosa") { int IdRepresentanteLegal = LogicaRepresentanteLegal.L_InsertarRepresentanteLegal(Representante, Usuario.U_IdEmpresa); if (IdRepresentanteLegal > 0) { string ext = ""; if (!Directory.Exists(@"C:\inetpub\RepositorioVER\Representantes\" + IdRepresentanteLegal.ToString())) { DirectoryInfo di = Directory.CreateDirectory(@"C:\inetpub\RepositorioVER\Representantes\" + IdRepresentanteLegal.ToString()); } int num_archivo = 0; foreach (string inputTagName in Request.Files) { HttpPostedFileBase file = Request.Files[num_archivo]; num_archivo = num_archivo + 1; ext = Path.GetExtension(file.FileName); if (ext != ".cer" && ext != ".key") { var fileName = Path.GetFileName(file.FileName); bool PdfValido = MetodoGeneral.ReadByteArrayFromFile(file); if (file.ContentType.ToString().ToLower() == "application/pdf" && PdfValido) { string path = @"C:\inetpub\RepositorioVER\Representantes\" + IdRepresentanteLegal.ToString() + "\\" + inputTagName + "_PDF_" + FechaActual + ext; //string path = @"C:\inetpub\RepositorioVER\" + IdRepresentanteLegal.ToString() + "-" + inputTagName + ext; file.SaveAs(path); } } } TempData["notice"] = "Se ha solicitado la autorización de un nuevo representante al cual, se le hará llegar un correo con la resolución del administrador. "; Session["TipoAlerta"] = "Correcto"; } else { TempData["notice"] = "No se pudo registrar el representante legal, por favor revise la información."; Session["TipoAlerta"] = "Error"; } } else { TempData["notice"] = Validacion; Session["TipoAlerta"] = "Error"; } //Despliegue de vista if (Session["TipoAlerta"] == "Error") { CargarListasDesplegables(Representante.RL_CodigoPostal, Representante.RL_IdEntidadFederativa, Representante.RL_IdMunicipio, Representante.RL_IdLocalidad); return(View("Insertar", Representante)); } else { Usuario = (CatUsuarios)Session["Usuario"]; if (Usuario == null || Usuario.U_IdTipoUsuario != 2) { TempData["notice"] = "La sesión ha expirado."; return(RedirectToAction("Logout", "Home")); } List <CatRepresentantesLegales> ListaRepresentantesLegales = new List <CatRepresentantesLegales>(); ListaRepresentantesLegales = LogicaRepresentanteLegal.L_SeleccionarRepresentantesLegalesPorEmpresa(Usuario.U_IdEmpresa); ViewBag.CantidadRL = ListaRepresentantesLegales.Count(); return(View("Index", ListaRepresentantesLegales)); } } catch (Exception ex) { TempData["notice"] = ConfigurationManager.AppSettings["MensajeError"].ToString(); Session["TipoAlerta"] = "Error"; MetodoGeneral.RegistroDeError(ex.Message, "RepresentantesLegales: InsertarRepresentanteLegal"); return(View("Insertar", Representante)); } }
// Página de inicio de la aplicación public ActionResult Index() { try { if (Session.Keys.Count > 1 && Session["TipoAlerta"] != null) { CatUsuarios UsuarioEntrante = (CatUsuarios)Session["Usuario"]; if (UsuarioEntrante != null) { switch (UsuarioEntrante.U_IdTipoUsuario) { case 1: Session["TipoUsuario"] = "UsuarioOperativo"; Session["IdEmpresa"] = UsuarioEntrante.U_IdEmpresa; Session["NombreUsuario"] = UsuarioEntrante.U_Nombre; Session["IdUsuario"] = UsuarioEntrante.U_IdUsuario; LogicaUsuarios.L_ActualizarUsuarioEntrada(UsuarioEntrante.U_IdUsuario, true); return(RedirectToAction("InicioInversionista", "Home")); case 2: CatRepresentantesLegales RepresentanteAsociado = new CatRepresentantesLegales(); RepresentanteAsociado = LogicaRepresentanteLegal.L_DetallesRepresentanteLegal(UsuarioEntrante.U_IdRepresentanteAsociado); Session["RFCAsociado"] = RepresentanteAsociado.RL_RFC; Session["TipoUsuario"] = "Inversionista"; Session["IdEmpresa"] = UsuarioEntrante.U_IdEmpresa; Session["NombreUsuario"] = UsuarioEntrante.U_Nombre; Session["IdUsuario"] = UsuarioEntrante.U_IdUsuario; Session["IdRepresentanteActual"] = UsuarioEntrante.U_IdRepresentanteAsociado; LogicaUsuarios.L_ActualizarUsuarioEntrada(UsuarioEntrante.U_IdUsuario, true); return(RedirectToAction("InicioInversionista", "Home")); case 3: Session["TipoUsuario"] = "Consultor"; Session["IdUsuario"] = UsuarioEntrante.U_IdUsuario; Session["NombreUsuario"] = UsuarioEntrante.U_Nombre; LogicaUsuarios.L_ActualizarUsuarioEntrada(UsuarioEntrante.U_IdUsuario, true); return(RedirectToAction("Index", "Consultor")); case 4: Session["TipoUsuario"] = "Administrador"; Session["IdUsuario"] = UsuarioEntrante.U_IdUsuario; Session["NombreUsuario"] = UsuarioEntrante.U_Nombre; LogicaUsuarios.L_ActualizarUsuarioEntrada(UsuarioEntrante.U_IdUsuario, true); return(RedirectToAction("InicioAdministrador", "Home")); default: //Session["TipoUsuario"] = null; Session["IdUsuario"] = 0; Session["TipoUsuario"] = "No disponible"; TempData["notice"] = "Este tipo de usuarios no puede ingresar a esta plataforma."; Session["TipoAlerta"] = "Error"; return(View("Index", "Home")); } } } Session["TipoAlerta"] = Session["TipoAlerta"]; TempData["notice"] = TempData["notice"]; Session["MensajePrivacidad"] = ConfigurationManager.AppSettings["MensjaePrivacidad"].ToString(); return(View()); } catch (Exception ex) { TempData["notice"] = ConfigurationManager.AppSettings["MensajeError"].ToString(); Session["TipoAlerta"] = "Error"; Session["MensajePrivacidad"] = ConfigurationManager.AppSettings["MensjaePrivacidad"].ToString(); MetodoGeneral.RegistroDeError(ex.Message, "Home: Inicio"); return(View("Index", "Home")); } }
private void CargarDatosProyecto(CatAvanceTramites AvanceTramites, CatProyectos Proyecto, CatEmpresas Empresa, CatRepresentantesLegales Representante) { int PorcentajePositivo = 0; int PorcentajeNegativo = 100; ViewBag.DatosProyectos = JsonConvert.SerializeObject(Proyecto); ViewBag.DatosEmpresa = JsonConvert.SerializeObject(Empresa); ViewBag.DatosRepresentante = JsonConvert.SerializeObject(Representante); ViewBag.RFCRepresentante = Representante.RL_RFC; ViewBag.NombreProyecto = Proyecto.P_NombreProyecto; ViewBag.FechaInicio = Proyecto.P_FechaRegistro; ViewBag.DiasAgregados = Proyecto.P_DiasAgregados; ViewBag.ImagenMapaTecnologia = ConfigurationManager.AppSettings["Img_MapaTecnologia"].ToString() + Proyecto.P_Tecnologia + ".jpg"; ViewBag.NombreTecnologia = Proyecto.P_Tecnologia; ViewBag.IdProyecto = Proyecto.P_IdProyecto.ToString(); ViewBag.IdGlobal = Proyecto.P_IdGlobal; ViewBag.TramitesFinalizados = AvanceTramites.T_TramitesFinalizados; ViewBag.TramitesTotales = AvanceTramites.T_TramitesTotales; try { PorcentajePositivo = (AvanceTramites.T_TramitesFinalizados * 100) / AvanceTramites.T_TramitesTotales; PorcentajeNegativo = 100 - PorcentajePositivo; } catch (Exception ex) { } ViewBag.PorcentajePositivo = PorcentajePositivo; ViewBag.PorcentajeNegativo = PorcentajeNegativo; LogicaProyecto.L_ActualizarAvanceProyecto(Proyecto.P_IdProyecto, PorcentajePositivo); double Finalizados = ((Convert.ToDouble(ViewBag.TramitesFinalizados))); double totales = ((Convert.ToDouble(ViewBag.TramitesTotales))); double Porcentaje = (Finalizados / totales * 100); string Val = string.Format("{0:0}", Porcentaje); ViewBag.Porcentaje = Val; }
public ActionResult ValidarSolicitud(int IdRepresentante) { CatUsuarios Usuario = (CatUsuarios)Session["Usuario"]; if (Usuario != null && Usuario.U_IdUsuario > 0 && Usuario.U_IdTipoUsuario == 4) { try { LogicaUsuarios LogicaUsuarios = new LogicaUsuarios(); LogicaEmpresas LogicaEmpresa = new LogicaEmpresas(); LogicaRepresentantesLegales LogicaRepresentante = new LogicaRepresentantesLegales(); CatRepresentantesLegales Representante = LogicaRepresentante.L_DetallesRepresentanteLegal(IdRepresentante); CatEmpresas Empresa = LogicaEmpresa.L_DetallesEmpresa(Representante.RL_IdEmpresa); CatUsuarios UsuarioRepresentante = LogicaUsuarios.L_DetallesUsuarioPorRepresentante(IdRepresentante); ViewBag.DatosEmpresa = Empresa; string ruta = @"C:\\inetpub\\RepositorioVER\\Representantes\\" + Representante.RL_IdRepresentanteLegal.ToString(); DirectoryInfo di = new DirectoryInfo(ruta); DateTime FechaPoderNotarial = DateTime.Parse("01/01/1900"); DateTime FechaCedulaRFC = DateTime.Parse("01/01/1900"); DateTime FechaActaConstitutiva = DateTime.Parse("01/01/1900"); DateTime FechaIdentificacionOficial = DateTime.Parse("01/01/1900"); foreach (var fi in di.GetFiles()) { try { string[] Varibales = fi.Name.Split('_'); string TipoDocumento = Varibales[0]; try { FechaDocumento = Varibales[2].Substring(0, 19).Replace('-', '/').Replace('.', ':'); } catch (Exception ex) { } DateTime Fecha = DateTime.Parse(FechaDocumento); switch (TipoDocumento) { case "PoderNotarial": if (FechaPoderNotarial < Fecha) { FechaPoderNotarial = Fecha; } break; case "CedulaRFC": if (FechaCedulaRFC < Fecha) { FechaCedulaRFC = Fecha; } break; case "ActaConstitutiva": if (FechaActaConstitutiva < Fecha) { FechaActaConstitutiva = Fecha; } break; case "NumIdenOficial": if (FechaIdentificacionOficial < Fecha) { FechaIdentificacionOficial = Fecha; } break; default: break; } } catch (Exception exc) { } } ViewBag.PoderNotarial = ruta + "\\PoderNotarial_PDF_" + FechaPoderNotarial.ToString("yyyy-MM-dd HH.mm.ss") + ".pdf"; ViewBag.CedulaRFC = ruta + "\\CedulaRFC_PDF_" + FechaCedulaRFC.ToString("yyyy-MM-dd HH.mm.ss") + ".pdf"; ViewBag.ActaConstitutiva = ruta + "\\ActaConstitutiva_PDF_" + FechaActaConstitutiva.ToString("yyyy-MM-dd HH.mm.ss") + ".pdf"; ViewBag.IdentificacionOficial = ruta + "\\NumIdenOficial_PDF_" + FechaIdentificacionOficial.ToString("yyyy-MM-dd HH.mm.ss") + ".pdf"; ViewBag.DatosRepresentante = Representante; if (Empresa.E_RFC.Length == 12) { ViewBag.MostrarCarta = true; } else { ViewBag.MostrarCarta = false; } return(View()); } catch (Exception ex) { TempData["notice"] = "Se produjo un error en la consulta"; Session["TipoAlerta"] = "Error"; return(RedirectToAction("GestionarSolicitudesRegistro")); } } else { return(RedirectToAction("Logout", "Home")); } }
public ActionResult RechazarRepresentanteLegal(FormCollection form) { LogicaUsuarios LogicaUsuarios = new LogicaUsuarios(); int IdRepresentante = Int32.Parse(form["IdRepresentante"]); string Observaciones = form["Observaciones"]; LogicaRepresentantesLegales LogicaRepresentantesLegales = new LogicaRepresentantesLegales(); CatRepresentantesLegales Representante = new CatRepresentantesLegales(); Representante = LogicaRepresentantesLegales.L_DetallesRepresentanteLegal(IdRepresentante); string CorreoRepresentante = Representante.RL_CorreoElectronico; Representante.RL_Observaciones = Observaciones; Representante.RL_IdEstatusSolicitudRepresentante = 2; Representante.RL_Activo = true; LogicaRepresentantesLegales.L_ActualizarRepresentanteLegal(Representante); try { new Task(() => { try { MailMessage email = new MailMessage("*****@*****.**", CorreoRepresentante); email.To.Add(new MailAddress(ConfigurationManager.AppSettings["CorreoAdministrador"].ToString())); email.Subject = "Solicitud ENREL no aprobada"; //Obtener la plantilla en HTML: string path = ConfigurationManager.AppSettings["Html_RechazarSolicitud"].ToString(); string ContenidoCorreo = System.IO.File.ReadAllText(path); string NombreRepresentanteLegal = Representante.RL_Nombre + " " + Representante.RL_PrimerApellido + " " + Representante.RL_SegundoApellido; ContenidoCorreo = ContenidoCorreo.Replace("#NombreRL#", NombreRepresentanteLegal); ContenidoCorreo = ContenidoCorreo.Replace("#Observaciones#", Observaciones); string Enlace = ConfigurationManager.AppSettings["EnlaceENREL"].ToString(); ContenidoCorreo = ContenidoCorreo.Replace("#EnlaceENREL#", Enlace); AlternateView htmlView = AlternateView.CreateAlternateViewFromString(ContenidoCorreo, null, "text/html"); //Obtener imágenes: LinkedResource Logotipo_SENER = new LinkedResource(ConfigurationManager.AppSettings["Logotipo_SENER"].ToString()); Logotipo_SENER.ContentId = "Logotipo_SENER"; htmlView.LinkedResources.Add(Logotipo_SENER); LinkedResource Logotipo_MEXICO = new LinkedResource(ConfigurationManager.AppSettings["Logotipo_MEXICO"].ToString()); Logotipo_MEXICO.ContentId = "Logotipo_MEXICO"; htmlView.LinkedResources.Add(Logotipo_MEXICO); email.AlternateViews.Add(htmlView); //email.Body = ContenidoCorreo; email.IsBodyHtml = true; email.Priority = MailPriority.High; SmtpClient smtp = new SmtpClient(); smtp.Host = "172.16.70.110"; smtp.Port = 25; smtp.EnableSsl = false; smtp.UseDefaultCredentials = false; smtp.Send(email); email.Dispose(); } catch (Exception ex) { MetodoGeneral.RegistroDeError(ex.Message, "Registro de inversionista: Quinto Paso - Envío de correo"); } }).Start(); return(RedirectToAction("GestionarSolicitudesRegistro", "Administrador")); } catch (Exception ex) { Representante.RL_Observaciones = "Ha ocurrido un error en el servicio y no se pudo enviar el correo con estatus rechazado."; Representante.RL_IdEstatusSolicitudRepresentante = 1; LogicaRepresentantesLegales.L_ActualizarRepresentanteLegal(Representante); LogicaEmpresas LogicaEmpresa = new LogicaEmpresas(); CatEmpresas Empresa = LogicaEmpresa.L_DetallesEmpresa(Representante.RL_IdEmpresa); ViewBag.DatosEmpresa = Empresa; ViewBag.DatosRepresentante = Representante; TempData["notice"] = ConfigurationManager.AppSettings["MensajeError"].ToString(); Session["TipoAlerta"] = "Error"; MetodoGeneral.RegistroDeError(ex.Message, "RepresentantesLegales: Insertar"); return(RedirectToAction("GestionarSolicitudesRegistro", "Administrador")); } }
public NotificacionesIOP.InformacionDeNegocio ObtenerInformacionDeNegocio(CatProyectos proyectos, CatEmpresas empresas, CatRepresentantesLegales REl) { var informacionDeNegocio = new NotificacionesIOP.InformacionDeNegocio() { CamposPersonalizados = ObtenerCamposPersonalizados(proyectos, empresas, REl), Dependencia = "CRE", HomoclaveOrigen = proyectos.P_Tecnologia, Mensaje = "Envío de Información" }; return(informacionDeNegocio); }
public string D_InsertarRegistroSolicitud(CatEmpresas Empresa, CatRepresentantesLegales RepresentanteLegal, CatUsuarios UsuarioOperativo) { bool resultado = false; SqlConnection Conexion = MetodoGeneral.EstablecerConexionBD(); string PasswordEncryptado = ""; string GUID = "Error"; //Insertar Empresa SQLComandoAuxiliar = MetodoGeneral.CrearLlamadaStoredProcedure("SpInsertarEmpresa", Conexion); SQLComandoAuxiliar.Parameters.AddWithValue("@NombreComercial", Empresa.E_NombreComercial); SQLComandoAuxiliar.Parameters.AddWithValue("@RazonSocial", Empresa.E_RazonSocial); SQLComandoAuxiliar.Parameters.AddWithValue("@RFC", Empresa.E_RFC); SQLComandoAuxiliar.Parameters.AddWithValue("@IdTipoCalle", Empresa.E_IdTipoVialidad); SQLComandoAuxiliar.Parameters.AddWithValue("@Calle", Empresa.E_Calle); SQLComandoAuxiliar.Parameters.AddWithValue("@NumeroExterior", Empresa.E_NumeroExterior); if (Empresa.E_NumeroInterior != null) { SQLComandoAuxiliar.Parameters.AddWithValue("@NumeroInterior", Empresa.E_NumeroInterior); } SQLComandoAuxiliar.Parameters.AddWithValue("@IdTipoColonia", Empresa.E_IdTipoAsentamiento); SQLComandoAuxiliar.Parameters.AddWithValue("@Colonia", Empresa.E_Colonia); SQLComandoAuxiliar.Parameters.AddWithValue("@IdLocalidad", Empresa.E_IdLocalidad); //Cambio de código postal //if (Empresa.E_CodigoPostal != null && Empresa.E_CodigoPostal > 0) { } SQLComandoAuxiliar.Parameters.AddWithValue("@CodigoPostal", Empresa.E_CodigoPostal); SQLComandoAuxiliar.Parameters.AddWithValue("@Lada", Empresa.E_Lada); SQLComandoAuxiliar.Parameters.AddWithValue("@TelefonoFijo", Empresa.E_TelefonoFijo); SQLComandoAuxiliar.Parameters.AddWithValue("@CorreoElectronico", Empresa.E_CorreoElectronico); SQLComandoAuxiliar.Parameters.AddWithValue("@Activo", true); SQLComandoAuxiliar.Parameters.AddWithValue("@CompartirDatos", Empresa.E_CompartirDatos); SQLComandoAuxiliar.Parameters.Add("@idEmpresa", SqlDbType.Int).Direction = ParameterDirection.Output; SQLComandoAuxiliar.ExecuteNonQuery(); int IdEmpresa = (int)SQLComandoAuxiliar.Parameters["@idEmpresa"].Value; Empresa.E_IdEmpresa = IdEmpresa; Session["NuevoAcceso_Empresa"] = Empresa; if (IdEmpresa > 1) { //Insertar Representante Legal SQLComandoAuxiliar = MetodoGeneral.CrearLlamadaStoredProcedure("SpInsertarRepresentanteLegal", Conexion); SQLComandoAuxiliar.Parameters.AddWithValue("@Nombre", RepresentanteLegal.RL_Nombre); SQLComandoAuxiliar.Parameters.AddWithValue("@PrimerApellido", RepresentanteLegal.RL_PrimerApellido); SQLComandoAuxiliar.Parameters.AddWithValue("@SegundoApellido", RepresentanteLegal.RL_SegundoApellido); SQLComandoAuxiliar.Parameters.AddWithValue("@CURP", RepresentanteLegal.RL_CURP); SQLComandoAuxiliar.Parameters.AddWithValue("@RFC", RepresentanteLegal.RL_RFC); SQLComandoAuxiliar.Parameters.AddWithValue("@IdTipoCalle", RepresentanteLegal.RL_IdTipoVialidad); SQLComandoAuxiliar.Parameters.AddWithValue("@Calle", RepresentanteLegal.RL_Calle); SQLComandoAuxiliar.Parameters.AddWithValue("@NumeroExterior", RepresentanteLegal.RL_NumeroExterior); if (RepresentanteLegal.RL_NumeroInterior != null) { SQLComandoAuxiliar.Parameters.AddWithValue("@NumeroInterior", RepresentanteLegal.RL_NumeroInterior); } SQLComandoAuxiliar.Parameters.AddWithValue("@IdTipoColonia", RepresentanteLegal.RL_IdTipoAsentamiento); SQLComandoAuxiliar.Parameters.AddWithValue("@Colonia", RepresentanteLegal.RL_Colonia); SQLComandoAuxiliar.Parameters.AddWithValue("@IdLocalidad", RepresentanteLegal.RL_IdLocalidad); //Cambio de código postal //if (RepresentanteLegal.RL_CodigoPostal != null && RepresentanteLegal.RL_CodigoPostal > 0) { SQLComandoAuxiliar.Parameters.AddWithValue("@CodigoPostal", RepresentanteLegal.RL_CodigoPostal); } SQLComandoAuxiliar.Parameters.AddWithValue("@CodigoPostal", RepresentanteLegal.RL_CodigoPostal); if (RepresentanteLegal.RL_Lada != null) { SQLComandoAuxiliar.Parameters.AddWithValue("@Lada", RepresentanteLegal.RL_Lada); } //COMUNICACIÓN: Eliminado temporalmente SQLComandoAuxiliar.Parameters.AddWithValue("@TelefonoFijo", RepresentanteLegal.RL_TelefonoFijo); if (RepresentanteLegal.RL_ExtensionTelefonica != null) { SQLComandoAuxiliar.Parameters.AddWithValue("@ExtensionTelefonica", RepresentanteLegal.RL_ExtensionTelefonica); } SQLComandoAuxiliar.Parameters.AddWithValue("@TelefonoMovil", RepresentanteLegal.RL_TelefonoCelular); SQLComandoAuxiliar.Parameters.AddWithValue("@CorreoElectronico", RepresentanteLegal.RL_CorreoElectronico); SQLComandoAuxiliar.Parameters.AddWithValue("@IdEmpresa", IdEmpresa); SQLComandoAuxiliar.Parameters.AddWithValue("@Activo", true); SQLComandoAuxiliar.Parameters.AddWithValue("@IdEstatusSolicitudRepresentante", 1); SQLComandoAuxiliar.Parameters.Add("@IdRepresentanteLegal", SqlDbType.Int).Direction = ParameterDirection.Output; SQLComandoAuxiliar.Parameters.Add("@GUID", SqlDbType.UniqueIdentifier).Direction = ParameterDirection.Output; SQLComandoAuxiliar.ExecuteNonQuery(); int IdRepresentanteLegal = (int)SQLComandoAuxiliar.Parameters["@IdRepresentanteLegal"].Value; GUID = SQLComandoAuxiliar.Parameters["@GUID"].Value.ToString(); RepresentanteLegal.RL_IdRepresentanteLegal = IdRepresentanteLegal; Session["NuevoAcceso_Representante"] = RepresentanteLegal; if (IdRepresentanteLegal > 1) { //Insertar Usuario Operativo if (UsuarioOperativo != null) { PasswordEncryptado = MetodoGeneral.EncriptarPassword(UsuarioOperativo.U_Password); SQLComandoAuxiliar = MetodoGeneral.CrearLlamadaStoredProcedure("SpInsertarUsuario", Conexion); SQLComandoAuxiliar.Parameters.AddWithValue("@IdEmpresa", IdEmpresa); SQLComandoAuxiliar.Parameters.AddWithValue("@IdTipoUsuario", 1); SQLComandoAuxiliar.Parameters.AddWithValue("@Nombre", UsuarioOperativo.U_Nombre); SQLComandoAuxiliar.Parameters.AddWithValue("@Password", PasswordEncryptado); SQLComandoAuxiliar.Parameters.AddWithValue("@PasswordReal", ""); SQLComandoAuxiliar.Parameters.AddWithValue("@CorreoElectronico", UsuarioOperativo.U_CorreoElectronico); SQLComandoAuxiliar.Parameters.AddWithValue("@IdRepresentanteAsociado", IdRepresentanteLegal); SQLComandoAuxiliar.Parameters.AddWithValue("@Activo", false); SQLComandoAuxiliar.Parameters.AddWithValue("@CreadoDuranteRegistro", true); SQLComandoAuxiliar.Parameters.AddWithValue("@Ingreso", false); SQLComandoAuxiliar.ExecuteNonQuery(); } Guid DatoAleatorio = new Guid(); DatoAleatorio = Guid.NewGuid(); string NombreUsuario = DatoAleatorio.ToString().Substring(0, Guid.NewGuid().ToString().IndexOf("-")); PasswordEncryptado = MetodoGeneral.EncriptarPassword("Temporal0"); SQLComandoAuxiliar = MetodoGeneral.CrearLlamadaStoredProcedure("SpInsertarUsuario", Conexion); SQLComandoAuxiliar.Parameters.AddWithValue("@IdEmpresa", IdEmpresa); SQLComandoAuxiliar.Parameters.AddWithValue("@IdTipoUsuario", 2); SQLComandoAuxiliar.Parameters.AddWithValue("@Nombre", NombreUsuario); SQLComandoAuxiliar.Parameters.AddWithValue("@Password", PasswordEncryptado); SQLComandoAuxiliar.Parameters.AddWithValue("@PasswordReal", ""); SQLComandoAuxiliar.Parameters.AddWithValue("@CorreoElectronico", RepresentanteLegal.RL_CorreoElectronico); SQLComandoAuxiliar.Parameters.AddWithValue("@IdRepresentanteAsociado", IdRepresentanteLegal); SQLComandoAuxiliar.Parameters.AddWithValue("@Activo", false); SQLComandoAuxiliar.Parameters.AddWithValue("@CreadoDuranteRegistro", true); SQLComandoAuxiliar.Parameters.AddWithValue("@Ingreso", false); SQLComandoAuxiliar.ExecuteNonQuery(); } } SQLComandoAuxiliar.Connection.Close(); return(GUID); }
public string L_InsertarRegistroSolicitud(CatEmpresas Empresa, CatRepresentantesLegales Representante, CatUsuarios UsuarioOperativo) { return(DatosAuxiliar.D_InsertarRegistroSolicitud(Empresa, Representante, UsuarioOperativo)); }