protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Current_screen_LB.Text = "Manage/Check Consent Forms";
                //CreateFormBtn.Visible = true;
                //ManageFormBtn.Visible = false;
                classListDiv.Visible          = false;
                FormInfoDiv.Visible           = false;
                confirmationOverlay.Visible   = false;
                foodprefcard.Visible          = false;
                foodprefcardupdate.Visible    = false;
                updateFormDiv.Visible         = false;
                modalOverlay.Visible          = false;
                FoodRadioButton.SelectedIndex = 0;
                CreateConsentFormDiv.Visible  = false;
                DraftList.Visible             = false;
                UserBO        userbo              = new UserBO();
                ConsentFormBO consentformbo       = new ConsentFormBO();
                String        currentLoggedInUser = Request.Cookies["CurrentLoggedInUser"].Value;
                List <String> TeachingClasses     = userbo.getTeachersTeachingClasses(currentLoggedInUser);

                List <ConsentForm> consentFormRecordsDrafts = consentformbo.getDraftConsentFormsBySenderID(currentLoggedInUser);

                if (consentFormRecordsDrafts == null || consentFormRecordsDrafts.Count == 0)
                {
                    DraftFormErrorMsg.Text = "There are no drafts created.";
                }
                DraftFormErrorMsg.Visible = false;
                List <ConsentForm> consentFormRecords = consentformbo.getConsentFormsBySenderID(currentLoggedInUser);
                if (consentFormRecords == null || consentFormRecords.Count == 0)
                {
                    formErrorMsg.Text = "There are no forms created.";
                }
                else
                {
                    consentFormRecords.Reverse(); //sorts by latest at the top
                }
                classesDropDownList.DataSource = TeachingClasses;
                classesDropDownList.DataBind();

                string currentSchool = userbo.getUserById(Request.Cookies["CurrentLoggedInUser"].Value).school;
                classesDropDownList.SelectedIndex = 0;
                string      selectedClass    = classesDropDownList.SelectedValue;
                List <user> studentClassList = userbo.retrieveClassListBySchoolAndClass(currentSchool, selectedClass);
                classListGridView.DataSource = studentClassList;
                classListGridView.DataBind();

                SelectedClassesListBox.DataSource = TeachingClasses;
                SelectedClassesListBox.DataBind(); //binds the data of classes that the user teaches
                updateSelectedClassesListBox.DataSource = TeachingClasses;
                updateSelectedClassesListBox.DataBind();
                DraftList.DataSource = consentFormRecordsDrafts;
                DraftList.DataBind();
                ConsentFormList.DataSource = consentFormRecords;
                ConsentFormList.DataBind(); //bind entries
            }
        }
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (SelectedClassesListBox_Selected.SelectedItem == null)
     {
         System.Web.HttpContext.Current.Response.Write("<script>alert(\"Please select an item\")</script>"); //js function to call alert when no item is selected
     }
     else
     {
         SelectedClassesListBox.ClearSelection(); //clear selection to prevent multiple selection exception
         SelectedClassesListBox.Items.Add(SelectedClassesListBox_Selected.SelectedItem);
         SelectedClassesListBox_Selected.Items.Remove(SelectedClassesListBox_Selected.SelectedItem);
         SelectedClassesListBox.ClearSelection();//clear selection to prevent multiple selection exception
     }
 }