-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathForm_main.cs
More file actions
156 lines (124 loc) · 4.06 KB
/
Form_main.cs
File metadata and controls
156 lines (124 loc) · 4.06 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
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;
using Capa_Entidad.Clases;
using Capa_Negocio.Clases;
namespace ITLA_Visitors
{
public partial class Form_main : Form
{
Entidad_login objeuser = new Entidad_login();
Negocio_Login objnuser = new Negocio_Login();
forms.Form_user_admin frm = new forms.Form_user_admin();
public static string user_nombre;
public static string user_apellido;
public static string user_tipo_usuario;
public void p_logeo()
{
DataTable dt = new DataTable();
objeuser.usuario = txtUsuario.Text;
objeuser.contrasena = txtContrasena.Text;
dt = objnuser.N_login(objeuser);
if(dt.Rows.Count > 0)
{
MessageBox.Show("Bienvenido " + dt.Rows[0][1].ToString(), "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
user_nombre = dt.Rows[0][1].ToString();
user_apellido = dt.Rows[0][2].ToString();
user_tipo_usuario = dt.Rows[0][3].ToString();
frm.Show();
this.Hide();
Form_main login = new Form_main();
//login.ShowDialog();
if (login.DialogResult == DialogResult.OK)
{
Application.Run(new forms.Form_user_admin());
}
txtUsuario.Clear();
txtContrasena.Clear();
}
else
{
MessageBox.Show("Usuario o Contraseña Incorrecta", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
public Form_main()
{
InitializeComponent();
panelMain.BringToFront();
}
private void btnCloseTab_Click(object sender, EventArgs e)
{
this.Close();
}
private void btnMinimizar_Click(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Normal)
{
this.WindowState = FormWindowState.Maximized;
}
else if (this.WindowState == FormWindowState.Maximized)
{
this.WindowState = FormWindowState.Normal;
}
}
private void btnMaximizar_Click(object sender, EventArgs e)
{
this.WindowState = FormWindowState.Minimized;
}
private void btnEmpezar_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
panelLogin.SendToBack();
panelMain.Visible = true;
}
private void button2_Click(object sender, EventArgs e)
{
panelMain.Visible = false;
panelLogin.Visible = true;
}
private void btnBack_Click(object sender, EventArgs e)
{
panelMain.Visible = true;
panelLogin.Visible = false;
}
private void panel2_VisibleChanged(object sender, EventArgs e)
{
}
private void panel3_VisibleChanged(object sender, EventArgs e)
{
if (panelLogin.Visible)
{
btnBack.Enabled = true;
}
else
{
btnBack.Enabled = false;
}
}
private void btnEmpezar_Click_1(object sender, EventArgs e)
{
panelMain.Visible = false;
panelMain.SendToBack();
panelLogin.Visible = true;
panelLogin.BringToFront();
}
private void button1_Click_1(object sender, EventArgs e)
{
}
private void cbShow_CheckedChanged(object sender, EventArgs e)
{
}
private void btnLogin_Click(object sender, EventArgs e)
{
p_logeo();
}
}
}