-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathValidate.aspx.cs
54 lines (45 loc) · 1.25 KB
/
Validate.aspx.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
using AccessBd;
using Domain;
using Security;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace SalesSystem
{
public partial class Validate : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Validation.Login(Session["User"]))
{
Response.Redirect("Login.aspx", false);
}
}
protected void btnValidatePass_Click(object sender, EventArgs e)
{
UsersAccess accessU = new UsersAccess();
try
{
Users User = (Users)Session["user"];
bool equals= accessU.validatePass(User.Id,txtValidatePass.Text);
if (equals)
{
int send = 1;
Response.Redirect("Register.aspx?changes=" + send, false);
}
else
{
Response.Redirect("Login.aspx", false);
}
}
catch (Exception ex)
{
Session.Add("error", ex);
Response.Redirect("error.aspx", false);
}
}
}
}