protected void Page_Load(object sender, EventArgs e) { onlineStudent = StudentList.getStudentByStudent_Code("he130022"); Session["onlineStudent"] = onlineStudent; Session["IsUserLogIn"] = true; IsUserLogedIn(); onlineStudent = (Student)Session["onlineStudent"]; if (!IsPostBack) { btnStudent.Text = onlineStudent.StudentShortName.ToLower(); termID = Request.QueryString["term"]; if (termID == null) { termID = DataAccess.GetDataBySql("Select top 1 * from Term order by end_date desc").Rows[0]["term_id"].ToString(); } LoadRpTerm(); depList = GetAllDep(); string depQuery = Request.QueryString["dep"]; if (depQuery == null) { if (depList.Count > 0) { currentDep = depList[0]; } } else { currentDep = depQuery; } LoadRpDep(); string cdIDQuery = Request.QueryString["course"]; if (cdIDQuery == null) { cdID = "0"; } else { cdID = cdIDQuery; } LoadRpSList(); } }
protected void btnSignIn_Click(object sender, EventArgs e) { if (selectCampus.SelectedIndex == 0) { lbErrorCampus.Text = "You must select a campus"; return; } if (selectCampus.SelectedIndex != 1) { lbErrorCampus.Text = "Your account not available in this campus"; return; } string username = tbUsername.Text.ToString(); string password = tbPassword.Text.ToString(); Account temp = null; if (validData()) { if (((temp = getA()) != null)) { if (password.Equals(temp.pass)) { Student s = StudentList.getStudentByStudent_Code(temp.code.Trim()); Session["IsUserLogin"] = true; Session["OnlineStudent"] = s; Response.Redirect("Home.aspx"); } else { lbErrorPass.Text = "Wrong Password"; } } else { lbErrorName.Text = "Username not found"; } } }