protected void Page_Load(object sender, EventArgs e) { //Get Logged In User Info from Session Variable try { LUser = (LoginUser)Session["LoggedUser"]; if ((bool)Session["Authenticated"] == false) { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } if (Validator.CanbeAccess("2", LUser.AccessRights) == false) { Debug.WriteLine("Page cannot be accessed"); Validator.AlertBack("Access Denied!", "../block_user.aspx"); } } //if No Logged In User, redirect to Login Screen catch { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } if (!IsPostBack) { //schoolyear = cls.ExecuteScalar("Select SchoolYear From PaceRegistration.dbo.SchoolDays Order By SchoolYear Desc"); Debug.WriteLine(schoolyear); LoadQuarterList(); } }
protected void Page_Load(object sender, EventArgs e) { Session["Quarter"] = Quarter; oDays.ForEach(d => { Session["Days"] = d.Days.ToString(); Session["Registration"] = d.Registration; }); //Check if a User Is Logged In try { LUser = (LoginUser)Session["LoggedUser"]; } //Redirect to Login Page when no User is logged in catch { Response.Redirect(DefaultForms.frm_login); } //Redirect to Default Dashboard Response.Redirect(ResolveUrl(DefaultForms.frm_default_dashboard)); //get the current school year oQuarter = new List<Constructors.Quarter>(cls.getQuarter()); Session["CurrentSchoolYear"] = "2010-2011"; oQuarter.ForEach(q => { if (q.isCurrentSY == "YES") { Session["CurrentSchoolYear"] = q.SchoolYear; } }); }
protected void Page_Load(object sender, EventArgs e) { 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; if ((bool)Session["Authenticated"] == false) { 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) { LoadInfo(); } }
//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)); } }
//Load Event protected void Page_Load(object sender, EventArgs e) { //Try to get Logged in user info in the session variable try { //Fill declared variable with info in the session variable LUser = (LoginUser)Session["LoggedUser"]; //get first name lblLoggedFirstname.Text = LUser.Firstname; //check if usergroup is administrator if ((string)Session["UserGroupID"] == "1") { } //if not administrator else { Response.Write("<script>alert('Access Denied!'); window.location='"+ResolveUrl(DefaultForms.frm_index)+"';</script>"); } } catch { Response.Redirect(ResolveUrl(DefaultForms.frm_login)); } if (IsPostBack == false) { } }
protected void Page_Load(object sender, EventArgs e) { //Check if a User Is Logged In try { LUser = (LoginUser)Session["LoggedUser"]; if (LUser.UserGroupID == "1" || LUser.UserGroupID == "3") { if (LUser.UserGroupID == "1") { imgTeacher.Visible = false; imgAdmin.Visible = true; } else { imgTeacher.Visible = true; imgAdmin.Visible = false; } } else { Response.Write("<script>alert('Access Denied!'); window.location='" + ResolveUrl(DefaultForms.frm_index) + "';</script>"); } } //Redirect to Login Page when no User is logged in catch { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } }
protected void Page_Load(object sender, EventArgs e) { try { LUser = (LoginUser)Session["LoggedUser"]; lblLoggedFirstname.Text = LUser.Firstname; if ((string)Session["UserGroupID"] == "3") { } else { Response.Write("<script>alert('Access Denied!'); window.location='../index.aspx';</script>"); } } catch { Response.Redirect("../login.aspx"); } if (IsPostBack == false) { } }
protected void Page_Load(object sender, EventArgs e) { try { LUser = Session["LoggedUser"] as LoginUser; //check if the user is login and a parent if ((bool)Session["Authenticated"] == false || (string)Session["UserGroupID"] != "P") { Response.Redirect(ResolveUrl(dForms.frm_index)); } } catch { Response.Redirect(ResolveUrl(dForms.frm_index)); } }
protected void Page_Load(object sender, EventArgs e) { //Check if a User Is Logged In try { LUser = (LoginUser)Session["LoggedUser"]; if (LUser.UserGroupID == "1" || LUser.UserGroupID == "3") { } else { Response.Write("<script>alert('Access Denied!'); window.location='" + ResolveUrl(DefaultForms.frm_index) + "';</script>"); } if (Validator.CanbeAccess("18", LUser.AccessRights) == false) { Debug.WriteLine("Page cannot be accessed"); Validator.AlertBack("Access Denied!", "../block_user.aspx"); } } //Redirect to Login Page when no User is logged in catch { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } if (!Page.IsPostBack) { LoadTeachers(Convert.ToInt32(LUser.UserGroupID)); loadLevels(); loadSubjects(); loadSections(); loadAssessmentType(); loadAssessment(); loadAssessmentEvaluation(); } }
protected void Page_Load(object sender, EventArgs e) { //Check if a User Is Logged In try { LUser = (LoginUser)Session["LoggedUser"]; } //Redirect to Login Page when no User is logged in catch { Response.Redirect(ResolveUrl(DefaultForms.frm_login)); } //Fill LUser Class Variable with class stored in the Session Variable LUser = (LoginUser)Session["LoggedUser"]; //Check if Logged In User is an Administrator if ((string)Session["UserGroupID"] == "1") { Response.Redirect(ResolveUrl(DefaultForms.frm_admin_dashboard)); } //Check if Logged In User is a Teacher else if ((string)Session["UserGroupID"] == "3") { Response.Redirect(ResolveUrl(DefaultForms.frm_instructor_dashboard)); } //Check if Logged In User is a Student else if ((string)Session["UserGroupID"] == "S") { Response.Redirect(ResolveUrl(DefaultForms.frm_student_dashboard)); } else if ((string)Session["UserGroupID"] == "P") { Response.Redirect(ResolveUrl(DefaultForms.frm_parent_dashboard)); } //Other Users else { Response.Redirect(ResolveUrl(DefaultForms.frm_login)); } }
protected void Page_Load(object sender, EventArgs e) { try { LUser = Session["LoggedUser"] as LoginUser; if ((bool)Session["Authenticated"] == false || (string)Session["UserGroupID"] != "P") { Response.Redirect(ResolveUrl(dForms.frm_index)); } } catch { Response.Redirect(ResolveUrl(dForms.frm_index)); } if (!IsPostBack) { LoadInformation(); } }
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(); }
protected void Page_Load(object sender, EventArgs e) { //Check if a User Is Logged In try { LUser = (LoginUser)Session["LoggedUser"]; if ((bool)Session["Authenticated"] == false) { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } if (Validator.CanbeAccess("0", LUser.AccessRights) == false) { Debug.WriteLine("Page cannot be accessed."); Validator.AlertBack("Access Denied!", "../block_user.aspx"); } } //Redirect to Login Page when no User is logged in catch { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } if (!IsPostBack) { oDisplaySettings = new List<Constructors.DisplaySettings>(cls.GetDays()); oDisplaySettings.ForEach(ds => { txtDays.Text = ds.Days.ToString(); if (ds.Registration == "Off") chk.Checked = false; else chk.Checked = true; }); } }
protected void Page_Load(object sender, EventArgs e) { 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; LUser = (LoginUser)Session["LoggedUser"]; if ((bool)Session["Authenticated"] == false) { 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) { //get the current school year oQuarter = new List<Constructors.Quarter>(cls.getQuarter()); Session["CurrentSchoolYear"] = "2010-2011"; oQuarter.ForEach(q => { if (q.isCurrentSY == "YES") { Session["CurrentSchoolYear"] = q.SchoolYear; } }); StudentList = new List<Constructors.StudentRegistrationView>(cls.getStudentRegistrationView()); if (Request.QueryString["uid"] != null) { LoadParentInformation(); CanBeActivated(); } else { Validator.AlertBack("Select a Parent First", "parent_maintenance_main.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { //Get Logged In User Info from Session Variable try { LUser = (LoginUser)Session["LoggedUser"]; if ((bool)Session["Authenticated"] == false) { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } if (Validator.CanbeAccess("6", LUser.AccessRights) == false) { Debug.WriteLine("Page cannot be accessed"); Validator.AlertBack("Access Denied!", "../block_user.aspx"); } } //if No Logged In User, redirect to Login Screen catch { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } if (!IsPostBack) { LoadUsergroup(); } if (Request.QueryString["change_stat"] == "1") { SystemProcedures sp = new SystemProcedures(); if (Request.QueryString["stat"] == "A") { if (sp.DeactivateRecord("USergroup", "UserGroupID", Request.QueryString["ugid"], "zeEk") == 1) { Validator.AlertBack("Usergroup has been deactivated successfully.", "usergroup_maintenance_main.aspx"); } } else { if (sp.ActivateRecord("USergroup", "UserGroupID", Request.QueryString["ugid"], "zeEk") == 1) { Validator.AlertBack("Usergroup has been activated successfully.", "usergroup_maintenance_main.aspx"); } } } }
///////////////////////// //---------------------// //--- System Events ---// //---------------------// ///////////////////////// //Page Load Event protected void Page_Load(object sender, EventArgs e) { //Validate if a User is Logged in try { LUser = (LoginUser)Session["LoggedUser"]; //Check if Logged in User is an Administrator if ((bool)Session["Authenticated"] == false) { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } if (Validator.CanbeAccess("3", LUser.AccessRights) == false) { Validator.AlertBack("Access Denied!", "../block_user.aspx"); } } //Redirects to the Login Page when no User is Logged In catch { Response.Redirect(ResolveUrl(DefaultForms.frm_login)); } //Checks if Postback if (IsPostBack == false) { LoadUserAccounts(); } //validate if URL is for activation if (Convert.ToInt32(Request.QueryString["sid"]) > 0 && (string)Request.QueryString["action"] == "activate") { int AffectedRows = sys.ActivateRecord("Student", "StudentID", Request.QueryString["sid"], LUser.Username); if (AffectedRows > 0) { Response.Write("<script>alert('Student Account has been activated successfully.'); window.location='" + ResolveUrl(DefaultForms.frm_student_maintenance_main) + "'</script>"); } else { Response.Write("<script>alert('Action cannot continue. Please check your entry')</script>"); } } //validate if URL is for deactivation else if (Convert.ToInt32(Request.QueryString["sid"]) > 0 && (string)Request.QueryString["action"] == "deactivate") { int AffectedRows = sys.DeactivateRecord("Student", "StudentID", Request.QueryString["sid"], LUser.Username); if (AffectedRows > 0) { Response.Write("<script>alert('Student Account has been deactivated successfully.'); window.location='" + ResolveUrl(DefaultForms.frm_student_maintenance_main) + "'</script>"); } else { Response.Write("<script>alert('Action cannot continue. Please check your entry')</script>"); } } //redirect to the student maintenance main page else { ResolveUrl(DefaultForms.frm_student_maintenance_main); } }
protected void Page_Load(object sender, EventArgs e) { //Get Logged In User Info from Session Variable try { LUser = (LoginUser)Session["LoggedUser"]; if ((bool)Session["Authenticated"] == false) { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } } //if No Logged In User, redirect to Login Screen catch { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } if (!IsPostBack) { LoadModules(); if (Request.QueryString["ugid"] != null) { LoadUsergroupDetails(); if (string.IsNullOrEmpty(lblUsergroup.Text)) { Response.Redirect("usergroup_maintenance_main.aspx"); } if (Request.QueryString["ugid"] == "1") { chkMaintenance.Enabled = false; chklMaintenance.Enabled = false; chkAssessment.Enabled = false; chklAssessment.Enabled = false; chkAcademic.Enabled = false; chklAcademic.Enabled = false; } else if (Request.QueryString["ugid"] == "2") { //chkAcademic.Enabled = false; //chklAcademic.Enabled = false; } } else { Validator.AlertBack("Select a usergroup first","usergroup_maintenance_main.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { //Check if a User Is Logged In try { LUser = (LoginUser)Session["LoggedUser"]; if ((bool)Session["Authenticated"] == false) { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } if (Validator.CanbeAccess("7", LUser.AccessRights) == false) { //Debug.WriteLine("Page cannot be accessed"); Validator.AlertBack("Access Denied!", "../block_user.aspx"); } } //Redirect to Login Page when no User is logged in catch { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } if (IsPostBack == false) { //set the quarter ddlQuarter.SelectedValue = Session["Quarter"].ToString(); if (LUser.UserGroupID == "1") { LoadAssessment(); } else if (LUser.UserGroupID == "3") { LoadTeacherAssessment(); } } //Check if has assessment if (Convert.ToInt32(Request.QueryString["aid"]) > 0) { //Check if the action to be taken is deactivate if (Request.QueryString["action"] == "deactivate") { //Updating the status of assessment int AffectedRows = sys.DeactivateRecord("Assessment", "AssessmentID", Request.QueryString["aid"], LUser.Username); if (AffectedRows > 0) { Response.Write("<script>alert('Assessment has been deactivated successfully.'); window.location='" + ResolveUrl(DefaultForms.frm_quizcreation_main) + "'</script>"); } else { Response.Write("<script>alert('Action cannot continue. Please check your entry'); window.location='" + ResolveUrl(DefaultForms.frm_quizcreation_main) + "'</script>"); } } //Check if the actionto to be take is activate else if (Request.QueryString["action"] == "activate") { //Updating the status of assessment int AffectedRows = sys.ActivateRecord("Assessment", "AssessmentID", Request.QueryString["aid"], LUser.Username); if (AffectedRows > 0) { Response.Write("<script>alert('Assessment has been activated successfully.'); window.location='" + ResolveUrl(DefaultForms.frm_quizcreation_main) + "'</script>"); } else { Response.Write("<script>alert('Action cannot continue. Please check your entry'); window.location='" + ResolveUrl(DefaultForms.frm_quizcreation_main) + "'</script>"); } } else if (Request.QueryString["action"] == "open") { //check if the assessment is already taken string AssessmentID = cls.ExecuteScalar("SELECT * FROM PaceAssessment.dbo.StudentAnswers where AssessmentID='" + Request.QueryString["aid"] + "'"); if (string.IsNullOrEmpty(AssessmentID)) { AssessmentID = cls.ExecuteScalar("Select AssessmentID from PaceAssessment.dbo.Assessment where AssessmentID='" + Request.QueryString["aid"] + "' and Status='A'"); if (string.IsNullOrEmpty(AssessmentID)) { Response.Write("<script>alert('Action cannot continue. Please check if the assessment is active.'); window.location='" + ResolveUrl(DefaultForms.frm_quizcreation_main) + "'</script>"); } else { string qry = "Update PaceAssessment.dbo.Assessment set ScheduleStatus='Open',LastUpdateUser='******',LastUpdateDate=getdate(),DateStart=getdate() where AssessmentID='" + Request.QueryString["aid"] + "'"; cls.ExecuteNonQuery(qry); Response.Write("<script>alert('Assessment has been opened successfully.'); window.location='" + ResolveUrl(DefaultForms.frm_quizcreation_main) + "'</script>"); } } else { Response.Write("<script>alert('Action cannot continue. The assessment has already been closed.'); window.location='" + ResolveUrl(DefaultForms.frm_quizcreation_main) + "'</script>"); } } else if (Request.QueryString["action"] == "close") { string AssessmentID = cls.ExecuteScalar("Select AssessmentID from PaceAssessment.dbo.Assessment where AssessmentID='" + Request.QueryString["aid"] + "' and Status='A'"); if (string.IsNullOrEmpty(AssessmentID)) { Response.Write("<script>alert('Action cannot continue. Please check if the assessment is active.'); window.location='" + ResolveUrl(DefaultForms.frm_quizcreation_main) + "'</script>"); } else { string qry = "Update PaceAssessment.dbo.Assessment set ScheduleStatus='Close',LastUpdateUser='******',LastUpdateDate=getdate(),DateEnd=getdate() where AssessmentID='" + Request.QueryString["aid"] + "'"; cls.ExecuteNonQuery(qry); Response.Write("<script>alert('Assessment has been closed successfully.'); window.location='" + ResolveUrl(DefaultForms.frm_quizcreation_main) + "'</script>"); } } } }
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; if ((bool)Session["Authenticated"] == false) { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } if (Validator.CanbeAccess("1", LUser.AccessRights) == false) { Debug.WriteLine("Page cannot be accessed"); Validator.AlertBack("Access Denied!","../block_user.aspx"); //Response.Redirect("../block.aspx"); } } //Redirect to the Index Page catch { //Redirect to the Index page Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } if (!IsPostBack) { LoadParents(); } if (Request.QueryString["approve"] == "1") { sp.ActivateParent("[User]", "UserID", Request.QueryString["uid"], LUser.Username); Response.Redirect("parent_maintenance_main.aspx?success=1"); } if (Request.QueryString["view_students"] == "1") { //Request.QueryString["view_students"] = "2"; mpeStudentVerification.Show(); //LoadChild(); } }
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"]; if ((bool)Session["Authenticated"] == false || (string)Session["UserGroupID"] != "P") { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } //Get Current Student Info from the Session Variable //CStudent = (CurrentStudent)Session["CurrentStudent"]; string Trigger = LUser.Username; } //Redirect to the Index Page catch { //Redirect to the Index page Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } if (!IsPostBack) { //load all child that has been selected by the parent LoadChild(); cboSubjects.Items.Add(new ListItem("--- Select Subject ---", "0")); //add a datasource to the main gridview to show that nothing has been selected yet DataTable dt = new DataTable(); dt.Columns.Add("Blank Column"); grdStudentsList.DataSource = dt; grdStudentsList.DataBind(); } }
///////////////////////// //---------------------// //--- 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) { //Get Logged In User Info from Session Variable try { LUser = (LoginUser)Session["LoggedUser"]; if (LUser.UserGroupID == "1") { } else { Response.Write("<script>alert('Access Denied!'); window.location='" + ResolveUrl(DefaultForms.frm_index) + "';</script>"); } } //if No Logged In User, redirect to Login Screen catch { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } if (IsPostBack == false) { //Load all teacher LoadTeacher(); //Load all assessment type LoadAssessmentType(); //Load all level LoadLevel(); //Load all subject LoadSubject(); //Load all question LoadQuestion(); //Loading/Creating of new Data Table for Feedback LoadFeedBack(); //load of topic LoadTopic(); LoadQuestionBank(""); rdoSchedule.SelectedIndex = 0; Visibility(); //set the quarter ddlQuarter.SelectedValue = Session["Quarter"].ToString(); ddlQuarter.Enabled = false; //Removed the Feedback dgFeedback.Visible = false; lblFeedback.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { LoadSiteMapDetails(); //Get Logged In User Info from Session Variable try { LUser = (LoginUser)Session["LoggedUser"]; if ((bool)Session["Authenticated"] == false) { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } } //if No Logged In User, redirect to Login Screen catch { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } tid = Convert.ToInt32(Request.QueryString["tid"]); if (!IsPostBack) { cboSubject.Items.Add(new ListItem("--- Select Subject ---", "0")); LoadLevels(); if (Request.QueryString["mode"] == "edit") { LoadLevels(); LoadTopicDetails(); } } }
//Page Load Event protected void Page_Load(object sender, EventArgs e) { //Validates if a User is Logged In try { LUser = (LoginUser)Session["LoggedUser"]; //Check if User is Administrator LUser = (LoginUser)Session["LoggedUser"]; if ((bool)Session["Authenticated"] == false) { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } if (Validator.CanbeAccess("4", LUser.AccessRights) == false) { Debug.WriteLine("Page cannot be accessed"); Validator.AlertBack("Access Denied!", "../block_user.aspx"); } } //Redirects to the Login Page catch { Response.Redirect(ResolveUrl(DefaultForms.frm_login)); } //Checks if Postback if (IsPostBack == false) { LoadUserAccounts(); if (Convert.ToInt32(Request.QueryString["activate"]) > 0) { Debug.WriteLine("Activate: " + Request.QueryString["activate"]); LUser = (LoginUser)Session["LoggedUser"]; //Update Query string qry = "Update [PaceAssessment].dbo.[Student] set AdminVerified = '1', LastUpdateUser='******', LastUpdateDate=GETDATE() WHERE StudentID='" + Request.QueryString["activate"] + "'"; //Checks if Affected Rows are more than 1 if (cls.ExecuteNonQuery(qry) > 0) { Debug.WriteLine("***Successfully Updated Student***"); try { StudentAccountList = new List<Constructors.StudentAccount>(cls.getStudentAccounts()); StudentRegistrationView = new List<Constructors.StudentRegistrationView>(cls.getStudentRegistrationView()); //loop through the list StudentAccountList.ForEach(sa => { //find the students to be activated if (sa.StudentID.ToString() == Request.QueryString["activate"]) { //check if has student number if (!string.IsNullOrEmpty(sa.StudentNumber.Trim())) { StudentRegistrationView.ForEach(sr => { if (sr.SchoolYear == Session["CurrentSchoolYear"].ToString() && sr.StudentNumber.ToLower() == sa.StudentNumber.ToLower()) { qry = "UPDATE PaceAssessment.dbo.Student SET FirstName='" + sr.FirstName + "', LastName='" + sr.LastName + "' WHERE StudentID='" + Request.QueryString["activate"] + "'"; cls.ExecuteNonQuery(qry); } }); } } }); } catch { } Response.Write("<script>alert('Student has been activated successfully.'); window.location='"+ResolveUrl(DefaultForms.frm_pending_student_accounts)+"';</script>"); } else { Debug.WriteLine("ERROR: Action cannot continue. Please review your entry."); Debug.WriteLine("Query String: " + qry); Response.Write("<script>alert('Action cannot continue. Please review your entry.')</script>"); } } } }
///////////////////////// //---------------------// //--- 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) { //Try to get Logged in User Details in the Session Variable try { LUser = (LoginUser)Session["LoggedUser"]; if ((bool)Session["Authenticated"] == false) { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } } //Redirect to the Login Screen if no User is Logged in catch { Response.Redirect(ResolveUrl(DefaultForms.frm_login)); } //Load Details of the Site Map Control LoadSiteMapDetails(); //Check if URL Parameter contains the Student ID if (Convert.ToInt32(Request.QueryString["sid"]) > 0 && Request.QueryString["action"] == "edit") { //Check if Load Type is Postback if (IsPostBack == false) { RegistrationViewList = new List<Constructors.StudentRegistrationView>(cls.getStudentRegistrationView()); //Load Student Account Details LoadStudentDetails(); } } //If Parameter is not in the URL else { //Redirect to the Student Maintenance Main Page Response.Redirect(ResolveUrl(DefaultForms.frm_student_maintenance_main)); } }
protected void Page_Load(object sender, EventArgs e) { //Get Logged In User Info from Session Variable try { LUser = (LoginUser)Session["LoggedUser"]; if (LUser.UserGroupID == "1" || LUser.UserGroupID == "3") { } else { Response.Write("<script>alert('Access Denied!'); window.location='" + ResolveUrl(DefaultForms.frm_index) + "';</script>"); } if (Validator.CanbeAccess("14", LUser.AccessRights) == false) { Debug.WriteLine("Page cannot be accessed"); Validator.AlertBack("Access Denied!", "../block_user.aspx"); } } //if No Logged In User, redirect to Login Screen catch { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } //Load url in sitemap LoadSiteMap(); //Check if the page is not postback if (!IsPostBack) { //Get all the assigned subject for the teacher LoadTeachers(Convert.ToInt32(LUser.UserGroupID)); } }
protected void Page_Load(object sender, EventArgs e) { //Get Logged In User Info from Session Variable try { LUser = (LoginUser)Session["LoggedUser"]; if ((bool)Session["Authenticated"] == false) { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } } //if No Logged In User, redirect to Login Screen catch { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } LoadSiteMap(); //schoolyear = cls.ExecuteScalar("Select SchoolYear From PaceRegistration.dbo.SchoolDays Order By SchoolYear Desc"); if (!Page.IsPostBack) { LoadQuarterData(); //Response.Redirect("quarter_maintenance.aspx"); Debug.WriteLine(schoolyear); } }
protected void Page_Load(object sender, EventArgs e) { //Get Logged In User Info from Session Variable try { LUser = (LoginUser)Session["LoggedUser"]; if ((bool)Session["Authenticated"] == false) { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } } //if No Logged In User, redirect to Login Screen catch { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } LoadSiteMapDetails(); if (Request.QueryString["mode"] == "edit") { if (!IsPostBack) { LoadUserGroupDetails(); } if (Request.QueryString["ugid"] != null) { ug_id = Convert.ToInt32(Request.QueryString["ugid"]); } else { Validator.AlertBack("Please select a user group", "usergroup_maintenance_main.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { //Get Logged In User Info from Session Variable try { LUser = (LoginUser)Session["LoggedUser"]; if ((bool)Session["Authenticated"] == false) { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } if (Validator.CanbeAccess("8", LUser.AccessRights) == false) { Debug.WriteLine("Page cannot be accessed"); Validator.AlertBack("Access Denied!", "../block_user.aspx"); } } //if No Logged In User, redirect to Login Screen catch { Response.Redirect(ResolveUrl(DefaultForms.frm_index)); } if (IsPostBack == false) { //Loading of Assessment Type LoadAssessment(); //Loading of Levels LoadLevels(); //Loading of Subjects LoadSubjects(); //Loading/Creating of new Data Table for Question LoadQuestion(); //Loading/Creating of new Data Table for Feedback LoadFeedBack(); //load of topic LoadTopic(); //Loading of Question Bank LoadQuestionBank(""); //Removed the Feedback dgFeedback.Visible = false; lblFeedback.Visible = false; rdoSchedule.SelectedIndex = 0; Visibility(); } LoadSiteMap(); ddlQuarter.SelectedValue = Session["Quarter"].ToString(); }