Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

using System;

using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MySql.Data.MySqlClient;
using System.Threading;

namespace FacultyConsultation_NetFramework
{

public partial class Login : System.Web.UI.Page


{
AccessDB adb = new AccessDB();
protected void Page_Load(object sender, EventArgs e)
{

protected void LoginControl_Authenticate(object sender,


AuthenticateEventArgs e)
{
adb.con_person.email = LoginControl.UserName;
adb.con_person.password = LoginControl.Password;
if (e.Authenticated)
{
Response.Redirect("~/Account/Shared/Profile.aspx");
}

if (adb.LoginAccount(adb.con_person))
{
e.Authenticated = true;
}
else
{
e.Authenticated = false;
}
}

protected void LoginControl_LoggedIn(object sender, EventArgs e)


{
Session["AccID"] = adb.con_person.id;
Session["Username"] = LoginControl.UserName;
Session["FN"] = adb.con_person.fn;
Session["MN"] = adb.con_person.mn;
Session["LN"] = adb.con_person.ln;
Session["Email"] = adb.con_person.email;
Session["AccStat"] = adb.con_person.accstat;
Thread.Sleep(500);
if(adb.con_person.accstat == "1")
{
Response.Redirect("~/Account/Admin/CreateAccount.aspx");
}
Response.Redirect("~/Account/Shared/Profile.aspx");
}

}
}

You might also like