-
Notifications
You must be signed in to change notification settings - Fork 1
/
securityPassword.cs
66 lines (59 loc) · 1.83 KB
/
securityPassword.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace MundoMusical.DB.DUMPS
{
public partial class securityPassword : BaseForm
{
private dbop db;
public bool result = false;
public securityPassword()
{
InitializeComponent();
this.Text = "Seguridad SMP";
this.db = new dbop();
this.MinimizeBox = false;
this.txtpass.KeyPress += (a, b) => { if (b.KeyChar == (char)Keys.Enter) this.verify(); };
}
private void securityPassword_Load(object sender, EventArgs e)
{
this.ActiveControl = this.txtpass;
}
private void verify()
{
if (genericDefinitions.globalsesion != null)
{
if (this.txtpass.Text.Trim() == this.db.usrget(genericDefinitions.globalsesion.idusuario).contraseña + "setsoftware")
{
this.result = true;
this.Close();
}
else
{
genericDefinitions.error("Password Incorrecto");
this.txtpass.Text = "";
this.txtpass.Focus();
}
}
else
{
genericDefinitions.error("Imposible Realizar la Operación.");
this.Close();
}
}
private void button1_Click(object sender, EventArgs e)
{
this.verify();
}
private void button2_Click(object sender, EventArgs e)
{
this.txtpass.Text = "";
}
}
}