Exemplo n.º 1
0
        protected void ITEJCPOLYGridView_SelectedIndexChanging(object sender, EventArgs e)
        {
            btn_updateTertiary2.Visible = false;
            btn_updateTertiary1.Visible = true;
            if (radioSelectITEPolyJC.SelectedItem.Text == "ITE" || radioSelectITEPolyJC.SelectedItem.Text == "Junior College")
            {
                btn_updateTertiary1.Visible = true;
                btn_updateTertiary2.Visible = false;
                PolyCoursesTable.Visible    = false;
            }

            if (radioSelectITEPolyJC.SelectedItem.Text == "Polytechnic")
            {
                btn_updateTertiary1.Visible = false;
                btn_updateTertiary2.Visible = true;
                PolyCoursesTable.Visible    = true;

                DataTable     PolyTable = new DataTable();
                SqlConnection con       = new DBManager().getConnection();
                string        sql       = "SELECT DISTINCT school, course_name, gceo_cut_off FROM dbo.OLevelCOP WHERE academic_year = (SELECT MAX(academic_year) FROM OLevelCOP)";
                SqlCommand    cmd       = new SqlCommand(sql, con);
                con.Open();
                SqlDataAdapter adapter = new SqlDataAdapter(cmd);
                adapter.Fill(PolyTable);
                PolyCoursesTable.DataSource = PolyTable;
                PolyCoursesTable.DataBind();
                con.Close();
            }

            string ITEJCPOLYName = (string)ITEJCPOLYTable.DataKeys[ITEJCPOLYTable.SelectedIndex].Value;

            if (radioSelectITEPolyJC.SelectedItem.Text == "Junior College")
            {
                Session["JCName"] = ITEJCPOLYName;
            }
            if (radioSelectITEPolyJC.SelectedItem.Text == "ITE")
            {
                Session["ITEName"] = ITEJCPOLYName;
            }
            if (radioSelectITEPolyJC.SelectedItem.Text == "Polytechnic")
            {
                Session["POLYName"] = ITEJCPOLYName;
            }
        }
        protected void ITEJCPOLYGridView_SelectedIndexChanging(object sender, EventArgs e)
        {
            btnITEJCPOLYSubmit.Visible = true;
            btnITEJCPOLYCont.Visible   = true;

            if (radioSelectITEPolyJC.SelectedItem.Text == "ITE" || radioSelectITEPolyJC.SelectedItem.Text == "Junior College")
            {
                PolyCoursesTable.Visible = false;
            }

            if (radioSelectITEPolyJC.SelectedItem.Text == "Polytechnic")
            {
                PolyCoursesTable.Visible   = true;
                btnITEJCPOLYCont.Visible   = false;
                btnITEJCPOLYSubmit.Visible = false;

                DataTable     PolyTable = new DataTable();
                SqlConnection con       = new DBManager().getConnection();
                string        sql       = "SELECT DISTINCT OLevelCOP.school, OLevelCOP.course_name, Min(OLevelCOP.gceo_cut_off) AS gceo_cut_off FROM [CZ2006 - Life Planner].[dbo].[OLevelCOP] GROUP BY OLevelCOP.school, OLevelCOP.course_name;";
                SqlCommand    cmd       = new SqlCommand(sql, con);
                con.Open();
                SqlDataAdapter adapter = new SqlDataAdapter(cmd);
                adapter.Fill(PolyTable);
                PolyCoursesTable.DataSource = PolyTable;
                PolyCoursesTable.DataBind();
                con.Close();
            }

            string ITEJCPOLYName = (string)ITEJCPOLYTable.DataKeys[ITEJCPOLYTable.SelectedIndex].Value;

            if (radioSelectITEPolyJC.SelectedItem.Text == "Junior College")
            {
                Session["JCName"] = ITEJCPOLYName;
            }
            if (radioSelectITEPolyJC.SelectedItem.Text == "ITE")
            {
                Session["ITEName"] = ITEJCPOLYName;
            }
            if (radioSelectITEPolyJC.SelectedItem.Text == "Polytechnic")
            {
                Session["POLYName"] = ITEJCPOLYName;
            }
        }
        protected void POLYGridView_SelectedIndexChanging(object sender, EventArgs e)
        {
            btnPOLYSubmit2.Visible = true;
            btnPOLYCont2.Visible   = true;

            PolyCoursesTable.Visible = true;

            DataTable     PolyTable = new DataTable();
            SqlConnection con       = new DBManager().getConnection();
            string        sql       = "SELECT DISTINCT OLevelCOP.school, OLevelCOP.course_name, Min(OLevelCOP.gceo_cut_off) AS gceo_cut_off FROM [CZ2006 - Life Planner].[dbo].[OLevelCOP] GROUP BY OLevelCOP.school, OLevelCOP.course_name;";
            SqlCommand    cmd       = new SqlCommand(sql, con);

            con.Open();
            SqlDataAdapter adapter = new SqlDataAdapter(cmd);

            adapter.Fill(PolyTable);
            PolyCoursesTable.DataSource = PolyTable;
            PolyCoursesTable.DataBind();
            con.Close();

            string POLYName = (string)POLYTable.DataKeys[POLYTable.SelectedIndex].Value;

            Session["POLYName"] = POLYName;
        }