-
Notifications
You must be signed in to change notification settings - Fork 3
/
login.aspx.cs
43 lines (40 loc) · 1.37 KB
/
login.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace DayCareWebsite
{
public partial class login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
Classes.ClearText tx = new Classes.ClearText();
Classes.Login lo = new Classes.Login();
lo.Email = TextBox1.Text;
lo.Password = TextBox2.Text;
lo.GetLogin(lo);
if (lo.role == "Admin" && lo.cond == true)
{
Response.Write("<script>alert('Welcome Admin')</script>");
Session["AdminInfo"] = TextBox1.Text;
Response.Redirect("AdminHome.aspx");
}
else if(lo.role == "User" && lo.cond == true)
{
Response.Write("<script>alert('Welcome User')</script>");
Session["UserInfo"] = TextBox1.Text;
Response.Redirect("index.aspx");
}
if(lo.cond == false)
{
Response.Write("<script>alert('Invalid User Id Or Password')</script>");
}
tx.ClearTextbox(TextBox1,TextBox2);
}
}
}