Example #1
0
        private void btnCompilar_Click(object sender, EventArgs e)
        {
            ValoresGlobales.valores().LimpiarDatos();
            ValoresGlobales.valores().elementoRaiz = ucdfd1.ObtenerRaiz();

            AnalizadorSintactico analisSintactico  = new AnalizadorSintactico();
            AnalizadorSemantico  analisisSemantico = new AnalizadorSemantico();
            GenerarCodigo        generarCodigo     = new GenerarCodigo();

            analisSintactico.GenerarArbol();
            if (!ValoresGlobales.valores().tablaDeErrores.Existen())
            {
                analisisSemantico.AnalizarTipos();
            }
            //Se verifica si existen errores o no dentro del codigo antes de compilarlo
            if (!ValoresGlobales.valores().tablaDeErrores.Existen())
            {
                if (txtNombre.Text == "")
                {
                    txtNombre.Text = "Ejecutable";
                }
                generarCodigo.GenerarEjecutable(txtNombre.Text);
                System.Diagnostics.Process.Start(txtNombre.Text + ".exe");
            }
            else
            {
                FrmTablaDeErrores frmTablaDeErrores = new FrmTablaDeErrores();
                frmTablaDeErrores.Show();
            }
        }
Example #2
0
        public async Task <ActionResult> ReenviarCorreo(string id)
        {
            try
            {
                ApplicationDbContext db = new ApplicationDbContext();
                var userManager         = new UserManager <ApplicationUser>(new UserStore <ApplicationUser>(db));
                var user          = userManager.FindById(id);
                var contrasenaTmp = GenerarCodigo.Generar(CuotasCodigos.CuotaInferiorCodigo, CuotasCodigos.CuotaSuperiorCodigo);
                await userManager.RemovePasswordAsync(user.Id);

                await userManager.AddPasswordAsync(user.Id, Convert.ToString(contrasenaTmp));

                user.EmailConfirmed = false;
                await userManager.UpdateAsync(user);

                string htmlData = InfoMail.CreacionCuentaTrabajador();
                //Send email
                EnviarCorreo.Enviar(user.Email, Mensaje.CreacionCuentaTrabajador, "<b> " + Mensaje.ContrasenaTemporal + Convert.ToString(contrasenaTmp) + "</b><br/><br/><br/>" + htmlData);
                db.Dispose();
            }
            catch (Exception)
            {
                throw;
            }

            return(RedirectToAction("ListarTrabajador"));
        }