protected void btnSave_Click(object sender, EventArgs e)
        {
            Whitelist whitelist = new Whitelist();

            if (divWhitelist.Visible != true)
            {
                whitelist.add(txtReason.Text, Convert.ToDateTime(from.Text), Convert.ToDateTime(to.Text), 0, Convert.ToInt32(ddlWorkstation.SelectedValue));
                lblText.Text = "<br />Record inserted successfully<br />";

                divForm.Visible = false;
                txtReason.Text  = "";
                from.Text       = "";
                to.Text         = "";
            }
            else
            {
                whitelist.edit(Convert.ToInt32(lbl.Text), txtReason.Text, Convert.ToDateTime(from.Text), Convert.ToDateTime(to.Text), 0, Convert.ToInt32(ddlWorkstation.SelectedValue));
                lblText.Text           = "<br />Record modified successfully<br />";
                divForm.Visible        = false;
                divWhitelist.Visible   = false;
                lbl.Text               = "";
                gvWhitelists.EditIndex = -1;
            }

            // Bind the GridView control to the courseInfo collection.
            gvWhitelists.DataSource = whitelist.load();
            gvWhitelists.DataBind();
            btnInsert.Visible = true;
        }
        protected void gvWhitelists_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
        {
            gvWhitelists.EditIndex = -1;
            //Int32 classroomID = Convert.ToInt32(ddlClassroom.SelectedValue);
            // Select course information based on department ID.
            Whitelist whitelist = new Whitelist();

            // Bind the GridView control to the courseInfo collection.
            gvWhitelists.DataSource = whitelist.load();
            gvWhitelists.DataBind();
        }
        protected void gvWhitelists_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            Whitelist whitelist = new Whitelist();

            whitelist.delete(Convert.ToInt32(e.Keys[0].ToString()));


            gvWhitelists.EditIndex  = -1;
            gvWhitelists.DataSource = whitelist.load();
            gvWhitelists.DataBind();


            btnInsert.Visible = true;
        }
        //List<BLL.Classroom> cl = new List<BLL.Classroom>();


        protected void Page_Load(object sender, EventArgs e)
        {
            /*ecomanagementContext = new EcoManagementEntities();
             *
             * BLL.Classroom classroom = new BLL.Classroom();
             *
             * foreach (BLL.Classroom c in ecomanagementContext.Classrooms)
             * {
             *  cl.Add(c);
             *
             * }*/



            Whitelist whitelist = new Whitelist();

            // Bind the GridView control to the courseInfo collection.
            gvWhitelists.DataSource = whitelist.load();
            gvWhitelists.DataBind();
        }