Beispiel #1
0
        private void btnNOACEPTA_Click_1(object sender, EventArgs e)
        {
            this.Hide();
            FRM_LOGIN frm = new FRM_LOGIN();

            frm.ShowDialog();
        }
Beispiel #2
0
        private void btnACEPTA_Click_1(object sender, EventArgs e)
        {
            contraseña_actual = cSeguridad.USUARIOS.EncriptarClave(txtCLAVE_ACTUAL.Text);


            if (oUsuario.Contraseña != contraseña_actual)
            {
                MessageBox.Show("Contraseña actual invalida");
                return;
            }
            if (oUsuario.Contraseña == contraseña_actual)
            {
                if (txtCLAVE_NUEVA.Text != txtCLAVE_NUEVA_CONFIRM.Text)
                {
                    MessageBox.Show("Contraseña nueva invalida");
                    txtCLAVE_NUEVA.Text         = "";
                    txtCLAVE_NUEVA_CONFIRM.Text = "";
                    return;
                }
                else
                {
                    oUsuario.Contraseña = cSeguridad.USUARIOS.EncriptarClave(txtCLAVE_NUEVA.Text);
                    System.Net.Mail.SmtpClient cliente = new System.Net.Mail.SmtpClient();
                    cliente.Credentials = new System.Net.NetworkCredential("*****@*****.**", "uaiseguridad");

                    cliente.Port      = 587;
                    cliente.EnableSsl = true;
                    cliente.Host      = "smtp.gmail.com";
                    try
                    {
                        cliente.Send(cSeguridad.USUARIOS.Enviar_Mail(oUsuario, txtCLAVE_NUEVA.Text, false));
                        oUsuario.EstadoContraseña = "registrada";
                        MessageBox.Show("Mail enviado con los datos!");
                    }
                    catch (Exception)
                    {
                        MessageBox.Show("Error al enviar el mail con los datos, contactarse con administracion!");
                        return;
                    }
                    cSeguridad.USUARIOS.MODIFICAR_USUARIO(oUsuario);

                    if (menu == "menu")
                    {
                        this.Hide();
                        FrmMenu frm = new FrmMenu(oUsuario);
                        frm.ShowDialog();
                    }
                    else
                    {
                        this.Hide();
                        FRM_LOGIN frm = new FRM_LOGIN();
                        frm.ShowDialog();
                    }
                }
            }
        }
Beispiel #3
0
 private void btnNOACEPTA_Click_1(object sender, EventArgs e)
 {
     if (menu == "menu")
     {
         this.Hide();
         FrmMenu frm = new FrmMenu(oUsuario);
         frm.ShowDialog();
     }
     else
     {
         this.Hide();
         FRM_LOGIN frm = new FRM_LOGIN();
         frm.ShowDialog();
     }
 }
Beispiel #4
0
        private void btnACEPTA_Click_1(object sender, EventArgs e)
        {
            if (cSeguridad.USUARIOS.EXISTE_USERNAME_Y_MAIL(txtusername.Text, txtEMAIL.Text) == false)
            {
                MessageBox.Show("Usuario y/o mail no existe");
                return;
            }
            if (cSeguridad.USUARIOS.EXISTE_USERNAME_Y_MAIL(txtusername.Text, txtEMAIL.Text) == true)
            {
                oUsuario = cSeguridad.USUARIOS.OBTENER_USUARIO_USERNAME(txtusername.Text);
                cSeguridad.USUARIOS.RESETEAR_CLAVE(oUsuario);
                //clave = cSeguridad.USUARIOS.Contraseña_azar();
                clave = oUsuario.Dni.ToString();
                oUsuario.Contraseña = cSeguridad.USUARIOS.EncriptarClave(clave);


                System.Net.Mail.SmtpClient cliente = new System.Net.Mail.SmtpClient();
                cliente.Credentials = new System.Net.NetworkCredential("*****@*****.**", "uaiseguridad");

                cliente.Port      = 587;
                cliente.EnableSsl = true;
                cliente.Host      = "smtp.gmail.com";
                try
                {
                    cliente.Send(cSeguridad.USUARIOS.Enviar_Mail_Reseteo(oUsuario, clave));
                    oUsuario.EstadoContraseña = "nueva";
                    MessageBox.Show("Mail enviado!");
                }
                catch (Exception)
                {
                    MessageBox.Show("Error al enviar el mail");
                    return;
                }
                cSeguridad.USUARIOS.MODIFICAR_USUARIO(oUsuario);

                this.Hide();
                FRM_LOGIN frm = new FRM_LOGIN();
                frm.ShowDialog();
            }
        }