//page load protected void Page_Load(object sender, EventArgs e) { //Check if a User is Logged In try { //Get Logged in User Details from the Session Variable LUser = (LoginUser)Session["LoggedUser"]; //check if the user is login and a student if ((bool)Session["Authenticated"] == false || (string)Session["UserGroupID"] != "S") { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } //Add First name in the Header lblLoggedFirstname.Text = LUser.Firstname; //Get Student Details from the Session Variable CurrentStudent CStudent = (CurrentStudent)Session["CurrentStudent"]; string DebugLine = "LEVEL ID: " + CStudent.LevelID + "\r\nSECTION ID: " + CStudent.SectionID; Debug.WriteLine(DebugLine); } //If no User is logged in, redirect to login page catch { //Redirect to the Login Page Response.Redirect(ResolveUrl(DefaultForms.frm_login)); } }
protected void Page_Load(object sender, EventArgs e) { try { LUser = (LoginUser)Session["LoggedUser"]; CStudent = (CurrentStudent)Session["CurrentStudent"]; if (LUser.UserGroupID == "S") { } else { Response.Write("<script>alert('Access Denied!'); window.location='"+ResolveUrl(DefaultForms.frm_index)+"';</script>"); } } catch { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } LoadSitemapDetails(); }
///////////////////////// //---------------------// //--- System Events ---// //---------------------// ///////////////////////// //Page Load Event protected void Page_Load(object sender, EventArgs e) { //Check if a User is Logged In try { //Get Login User Info from the Session Variable LUser = (LoginUser)Session["LoggedUser"]; //Get Current Student Info from the Session Variable CStudent = (CurrentStudent)Session["CurrentStudent"]; //check if the user is login and a student if ((bool)Session["Authenticated"] == false || (string)Session["UserGroupID"] != "S") { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } string Trigger = LUser.Username; } //Redirect to the Index Page catch { //Redirect to the Index page Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } if (Convert.ToInt32(Request.QueryString["assid"]) <= 0) { Response.Redirect(ResolveUrl(Request.RawUrl)+"?assid=1"); } if(IsPostBack == false) { Debug.WriteLine("--- First Loading of Details ---"); grdAssessment.PageSize = 10; LoadAssessmentDetails(); ConvertToDataTable(); LoadQuestionsDetails(); } }
///////////////////////// //---------------------// //--- System Events ---// //---------------------// ///////////////////////// //Page Load Event protected void Page_Load(object sender, EventArgs e) { //Check if a User is Logged In try { //Get Login User Info from the Session Variable LUser = (LoginUser)Session["LoggedUser"]; //Get Current Student Info from the Session Variable CStudent = (CurrentStudent)Session["CurrentStudent"]; string Trigger = LUser.Username; //check if the student is login and a student if ((bool)Session["Authenticated"] == false || (string)Session["UserGroupID"] != "S") { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } } //Redirect to the Index Page catch { //Redirect to the Index page Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } if (Convert.ToInt32(Request.QueryString["assid"]) <= 0) { Response.Redirect(ResolveUrl(Request.RawUrl)+"?assid=1"); } if (IsPostBack == false) { //Load Sitemap LoadSitemapDetails(); //Load Assessment Details [Assessment Info] LoadAssessmentDetails(); //Set Page size of the Assessment Grid grdAssessment.PageSize = 10; //Create Data Table holding the questions ConvertToDataTable(); //Load Answers of the Student LoadStudentAnswers(); //Create DataTable holding the Remarks for each choices CreateRemarkDataTable(); //Create DataTable holding the Remarks for each Correct Answer CreateCARemarkDataTable(); //Bind Datatables to the GridViews LoadQuestionsDetails(); } }
protected void Page_Load(object sender, EventArgs e) { //Check if a User is Logged In | try { LUser = (LoginUser)Session["LoggedUser"]; CStudent = (CurrentStudent)Session["CurrentStudent"]; if ((bool)Session["Authenticated"] == true && (string)Session["UserGroupID"] == "S") { } else { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } } //redirect to default screen catch { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } //if page load is postback if (IsPostBack == false) { ConvertAssessmentListToDataTable(); //Load Assessments available to the currently logged in student LoadAvailableAssessments(); } //Load Sitemap Details for navigation LoadSitemapDetails(); }
//Pack Logged In Student to Class public void StudentLoginClass(string Username, string Password) { Debug.WriteLine("***Packing Student Info To Class***"); LUser = new LoginUser(); Username = Username.Trim(); Password = Password.Trim(); StudentAccountList.ForEach(sa => { if (sa.StudentNumber == Username && sa.Password == Password) { LUser.UserID = sa.StudentID; LUser.UserGroupID = "S"; LUser.Username = Username; LUser.Password = Password; LUser.Lastname = sa.Lastname; LUser.Firstname = sa.Firstname; LUser.DateCreated = sa.DateCreated; LUser.UserCreated = sa.UserCreated; LUser.LastUpdateDate = sa.LastUpdateDate; LUser.LastUpdateUser = sa.LastUpdateUser; LUser.Description = "Student"; LUser.Status = sa.Status; LUser.DateToday = DateTime.Today.ToShortDateString(); Session["Authenticated"] = true; Session["LoggedUser"] = LUser; Session["UserGroupID"] = LUser.UserGroupID; return; } }); CurrentStudent CStudent = new CurrentStudent(); string qry = "SELECT * FROM PaceRegistration.dbo.StudentRegistrationView WHERE StudentNumber='" + Username + "'"; Debug.WriteLine(qry); SqlDataReader dr = cls.ExecuteReader(qry); dr.Read(); if (dr.HasRows) { CStudent.StudentID = (int)dr["StudentID"]; CStudent.StudentNumber = dr["StudentNumber"].ToString(); CStudent.SectionID = (int)dr["SectionID"]; CStudent.LevelID = (int)dr["CurrentLevelID"]; CStudent.SchoolYear = dr["SchoolYear"].ToString(); Session["CurrentStudent"] = CStudent; } }
protected void Page_Load(object sender, EventArgs e) { //Check if a User is Logged In try { //Get Login User Info from the Session Variable LUser = (LoginUser)Session["LoggedUser"]; //Get Current Student Info from the Session Variable CStudent = (CurrentStudent)Session["CurrentStudent"]; string Trigger = LUser.Username; //check if the user is login and a student if ((bool)Session["Authenticated"] == false || (string)Session["UserGroupID"] != "S") { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } } //Redirect to the Index Page catch { //Redirect to the Index page Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } if (Convert.ToInt32(Request.QueryString["aid"]) <= 0) { Response.Redirect(ResolveUrl(Request.RawUrl) + "?aid=1"); } if (IsPostBack == false) { Debug.WriteLine("First Load."); //Load site map for navogation LoadSitemapDetails(); //Load Assessment details LoadAssessmentDetails(); //Load Questions LoadQuestion(); //Load Student answer LoadStudentAnswers(); //Load remarks LoadRemarks(); //Load correct remarks LoadCorrectRemarks(); //Set the page size of the grid to 10 dgAssessment.PageSize = 10; //Bind all data BindData(); //load the students score LoadStudentsScore(); } }
//DynamicallyTemplatedGridViewHandler Event; protected void Page_Load(object sender, EventArgs e) { //Get Logged In User Info from Session Variable try { //Get Login User Info from the Session Variable LUser = (LoginUser)Session["LoggedUser"]; //Get Current Student Info from the Session Variable CStudent = (CurrentStudent)Session["CurrentStudent"]; string Trigger = LUser.Username; //check if the user is login and a student if ((bool)Session["Authenticated"] == false || (string)Session["UserGroupID"] != "S") { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } } //Redirect to the Index Page catch { //Redirect to the Index page Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } if (IsPostBack == false) { ddlQuarter.SelectedValue = Session["Quarter"].ToString(); //Load all assessment type LoadAssessmentType(); //Load all past assessment LoadAssessmentHistory(); } //Load site maps for navigation LoadSitemapDetails(); }