-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDefault.aspx.cs
More file actions
54 lines (49 loc) · 1.69 KB
/
Default.aspx.cs
File metadata and controls
54 lines (49 loc) · 1.69 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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
DS_STUDENT.STUDENT_SELECTDataTable SDT = new DS_STUDENT.STUDENT_SELECTDataTable();
DS_STUDENTTableAdapters.STUDENT_SELECTTableAdapter SAdapter = new DS_STUDENTTableAdapters.STUDENT_SELECTTableAdapter();
DS_ADMIN.ADMIN_SELECTDataTable ADT = new DS_ADMIN.ADMIN_SELECTDataTable();
DS_ADMINTableAdapters.ADMIN_SELECTTableAdapter AAdapter = new DS_ADMINTableAdapters.ADMIN_SELECTTableAdapter();
protected void Page_Load(object sender, EventArgs e)
{
lbl.Text = "";
}
protected void Button1_Click(object sender, EventArgs e)
{
if (rdolibrary.Checked == true)
{
ADT = AAdapter.Select_for_LOGIN(txtuname.Text, txtupass.Text);
if (ADT.Rows.Count > 0)
{
Session["aid"] = ADT.Rows[0]["aid"].ToString();
Session["email"] = txtuname.Text;
Session["name"] = ADT.Rows[0]["name"].ToString();
Response.Redirect("Home.aspx");
}
else
{
lbl.Text = "Invalid Credential";
}
}
else
{
SDT = SAdapter.Select_for_LOGIN(txtuname.Text, txtupass.Text);
if (SDT.Rows.Count > 0)
{
Session["sid"] = SDT.Rows[0]["sid"].ToString();
Session["email"]=txtuname.Text;
Response.Redirect("Student/Default.aspx");
}
else
{
lbl.Text = "Invalid Credential";
}
}
}
}