protected void btnMostActive_Click(object sender, EventArgs e)
        {
            string ActivityID = DetailsView1.DataKey.Value.ToString();

            PanelMostActive1.Visible = true;
            string    MostActive1   = "SELECT Top 15 CountVolunteerJoinActivity.V_ID ,NoJoin, V_Name, V_LastName,V_MobileNo1, V_MobileNo2, V_Email FROM Volunteer, CountVolunteerJoinActivity WHERE CountVolunteerJoinActivity.V_ID = Volunteer.V_ID and CountVolunteerJoinActivity.V_ID not in(SELECT VolunteerJoinActivities.V_ID FROM VolunteerJoinActivities WHERE Activity_ID = " + ActivityID + " ) ORDER BY NoJoin DESC   ;";
            DataTable dtMostActive1 = dbconn.QueryExecuteScalar(MostActive1);

            GridViewMostActive1.DataSource = dtMostActive1;
            GridViewMostActive1.DataBind();
            dbconn.Close();
            lblMostActive.Text = GridViewMostActive1.Rows.Count.ToString();
        }
        protected void SaveMostActive2_Click(object sender, EventArgs e)
        {
            //int maxPost = Convert.ToInt32(dt.Rows[0]["MAXPost"]);

            CheckBox chkbox = new CheckBox();

            foreach (GridViewRow grdRow in GridViewMostActive1.Rows)
            {
                chkbox = (CheckBox)Convert.ChangeType(((CheckBox)grdRow.FindControl("chk")), typeof(CheckBox));
                if (chkbox.Checked)
                {
                    string keyID = (string)GridViewMostActive1.DataKeys[grdRow.RowIndex].Value.ToString();
                    string sqlSelectVolunteer = "Insert into VolunteerJoinActivities(V_ID,VJA_Status,Activity_ID) Values (" + keyID + ",'Selected'," + DetailsView1.SelectedValue + ") ;";
                    dbconn.QueryExecuteScalar(sqlSelectVolunteer);
                }
            }

            GridViewMostActive1.DataBind();
            dbconn.Close();
        }
        protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            string id = GridView1.SelectedRow.Cells[1].Text;

            string    SearchType = "SELECT AT_ID FROM Activities WHERE Activity_ID = " + id + ";";
            DataTable dt         = dbconn.QueryExecuteScalar(SearchType);
            string    AT         = dt.Rows[0]["AT_ID"].ToString();

            if (AT == "1")
            {
                PanelHardAction.Visible = true;
            }
            else if (AT == "2")
            {
                PanelColdAction.Visible = true;
            }
            else
            {
                PanelBoth.Visible = true;
            }
            PanelCamDetail.Visible = true;
            Panel1.Visible         = false;
            Panel2.Visible         = false;



            string    ActivityID    = GridView1.SelectedRow.Cells[1].Text;
            string    MostActive1   = "SELECT Top 15 CountVolunteerJoinActivity.V_ID ,NoJoin, V_Name, V_LastName,V_MobileNo1, V_MobileNo2, V_Email FROM Volunteer, CountVolunteerJoinActivity WHERE CountVolunteerJoinActivity.V_ID = Volunteer.V_ID AND CountVolunteerJoinActivity.V_ID NOT IN (SELECT V_ID FROM VolunteerJoinActivities WHERE Activity_ID = " + ActivityID + ") ORDER BY NoJoin DESC;";
            DataTable dtMostActive1 = dbconn.QueryExecuteScalar(MostActive1);

            GridViewMostActive1.DataSource = dtMostActive1;
            GridViewMostActive1.DataBind();

            lblMostActive.Text = GridViewMostActive1.Rows.Count.ToString();



            lblMostActive2.Text = GridViewMostActive1.Rows.Count.ToString();

            string    NVDA2   = "SELECT VolunteerJoinActivities.V_ID, V_Name, V_LastName , V_MobileNo1, V_MobileNo2,V_Email From VolunteerJoinActivities, Volunteer,Activities WHERE VolunteerJoinActivities.V_ID = Volunteer.V_ID AND VolunteerJoinActivities.Activity_ID = Activities.Activity_ID AND Activity_Name = 'NVDA'  AND V_Status <> 'Deactive';";
            DataTable dtNVDA2 = dbconn.QueryExecuteScalar(NVDA2);

            GridViewNVDA1.DataSource = dtNVDA2;
            GridViewNVDA1.DataBind();

            lblNVDA.Text = GridViewNVDA1.Rows.Count.ToString();

            PanelMostActive3.Visible = true;
            //  string ActivityID = DetailsView1.DataKey.Value.ToString();
            string    MostActive3   = "SELECT Top 15 CountVolunteerJoinActivity.V_ID ,NoJoin, V_Name, V_LastName, V_MobileNo1, V_MobileNo2, V_Email FROM Volunteer, CountVolunteerJoinActivity WHERE CountVolunteerJoinActivity.V_ID = Volunteer.V_ID AND CountVolunteerJoinActivity.V_ID not in(SELECT VolunteerJoinActivities.V_ID FROM VolunteerJoinActivities WHERE Activity_ID = " + ActivityID + ") ORDER BY NoJoin DESC ;";
            DataTable dtMostActive3 = dbconn.QueryExecuteScalar(MostActive3);

            GridViewMostActive3.DataSource = dtMostActive3;
            GridViewMostActive3.DataBind();

            lblMostActive3.Text = GridViewMostActive3.Rows.Count.ToString();

            string    NVDA3   = "SELECT VolunteerJoinActivities.V_ID, V_Name, V_LastName , V_MobileNo1, V_MobileNo2,V_Email From VolunteerJoinActivities, Volunteer,Activities WHERE VolunteerJoinActivities.V_ID = Volunteer.V_ID AND VolunteerJoinActivities.Activity_ID = Activities.Activity_ID AND Activity_Name = 'NVDA'  AND V_Status <> 'Deactive';";
            DataTable dtNVDA3 = dbconn.QueryExecuteScalar(NVDA3);

            GridviewNVDA3.DataSource = dtNVDA3;
            GridviewNVDA3.DataBind();
            lblNVDA3.Text = GridviewNVDA3.Rows.Count.ToString();
            dbconn.Close();

            ddlSkillType.Items.Add(new ListItem("กรุณาเลือกประเภททักษะ", "0"));
            ddlSkill.Items.Add(new ListItem("กรุณาเลือกทักษะ", "0"));
            ddlSI1.Items.Add(new ListItem("กรุณาเลือกรายการทักษะ", "0"));
        }