protected void Login_Click(object sender, EventArgs e) { string userid = secure.Encrypt(Email.Text, "TSIE-GEHM-TAKUCF"); string pass = secure.Encrypt(Password.Text, "TSIE-GEHM-TAKUCF"); if (find.Students(userid, pass).Rows.Count != 0) { HttpCookie Student_Cookie = new HttpCookie("StudentInfo"); Student_Cookie["S_ID"] = find.Students(userid, pass).Rows[0]["Student_Id"].ToString(); Student_Cookie.Expires.Add(new TimeSpan(3, 0, 0)); Response.Cookies.Add(Student_Cookie); Response.Redirect("User/S_Home.aspx"); } else if (find.Admin(userid, pass).Rows.Count != 0) { HttpCookie Admin_Cookie = new HttpCookie("AdminInfo"); Admin_Cookie["A_ID"] = find.Admin(userid, pass).Rows[0]["Admin_Id"].ToString(); Admin_Cookie.Expires.Add(new TimeSpan(3, 0, 0)); Response.Cookies.Add(Admin_Cookie); Response.Redirect("Admin_/Dashboard.aspx"); } else { } }
protected void Page_Load(object sender, EventArgs e) { if (Admin_ID() == "0" || find.Admin(Admin_ID()).Rows.Count == 0 || find.Admin(Admin_ID()).Rows[0]["Status"].ToString() == "0") { Response.Redirect("~/Login.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if (Admin_ID() != "0") { Admin_Name_box.Text = find.Admin(Admin_ID()).Rows[0]["Name"].ToString(); Contact.Text = secure.Decrypt(find.Admin(Admin_ID()).Rows[0]["Contact"].ToString(), "TSIE-GEHM-TAKUCF"); Email.Text = secure.Decrypt(find.Admin(Admin_ID()).Rows[0]["Email"].ToString(), "TSIE-GEHM-TAKUCF"); Institute.Text = find.Admin(Admin_ID()).Rows[0]["Institute"].ToString(); Institute.Enabled = false; } }
protected void Page_Load(object sender, EventArgs e) { User_lbl.Text = find.Admin(Admin_ID()).Rows.Count != 0 ? find.Admin(Admin_ID()).Rows[0]["Name"].ToString() : "User"; }