-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin_dashboard.aspx.cs
87 lines (81 loc) · 3.19 KB
/
admin_dashboard.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
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Configuration;
using System.Data;
public partial class Default2 : System.Web.UI.Page
{
string strConnString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
string str;
SqlCommand com;
Class1 obj = new Class1();
Class1 username = new Class1();
Class1 email = new Class1();
protected void Page_Load(object sender, EventArgs e)
{
try
{
SqlConnection con = new SqlConnection(strConnString);
con.Open();
str = "select * from login where username='" + Session["username"] + "'";
//str = "SELECT tbl_faculty.f_id,tbl_faculty.f_username,tbl_faculty.dob,tbl_faculty.gender,tbl_fac_info.profession, tbl_fac_info.work_experience,tbl_fac_info.cat_name,tbl_fac_info.course_name,tbl_fac_info.state,tbl_fac_info.city,tbl_fac_info.area,tbl_fac_info.address,tbl_fac_info.fee,tbl_fac_info.phone_no FROM tbl_faculty INNER JOIN tbl_fac_info ON tbl_faculty.f_username=tbl_fac_info.f_username where f_id ='" + Session["l_id"] + "'";
com = new SqlCommand(str, con);
SqlDataAdapter da = new SqlDataAdapter(com);
DataSet ds = new DataSet();
da.Fill(ds);
Label100.Text = ds.Tables[0].Rows[0]["username"].ToString();
Label100.Visible = false;
}
catch
{
Response.Write("<script>alert('You have to log In First');window.location.href='Default.aspx';</Script>");
}
}
protected void Button1_Click(object sender, EventArgs e)
{
email.EmailExist(TextBox1.Text.Trim());
if (email.flag2 == 0)
{
username.UserExist(TextBox2.Text.Trim());
if (username.flag3 == 0)
{
if (TextBox3.Text == TextBox4.Text)
{
obj.ins_admin(TextBox1.Text.Trim(), TextBox2.Text.Trim(),TextBox3.Text.Trim());
// Response.Write("<script>alert('New Admin is Succesfully Added.')</script>");
Label3.Visible = false;
Label1.Visible = false;
Label2.Visible = false;
Label4.Visible = true;
}
else
{
Label3.Visible = false;
Label1.Visible = true;
Label4.Visible = false;
Label2.Visible = false;
// Response.Write("<script>alert('Please enter same Password.')</script>");
}
}
else
{Label4.Visible = false;
Label3.Visible = false;
Label2.Visible = true;
Label1.Visible = false;
}
}
else
{
Label1.Visible = false;
Label2.Visible = false;
Label4.Visible = false;
Label3.Visible = true;
}
}
}