protected void Display(object sender, EventArgs e)
        {
            VacancyByDepartment dept = new VacancyByDepartment();

            if (dropDownList.SelectedIndex == 1)
            {
                List<VacancyDTO> listVacs = dept.getVacanciesByDept(deparments.SelectedValue);
                vacRepeater.DataSource = null;
                vacRepeater.DataSource = listVacs;
                vacRepeater.DataBind();
            }
        }
        public void getVacanciesByDeptTest()
        {
            VacancyByDepartment target = new VacancyByDepartment();
            VacancyDAO vac_context = new VacancyDAO();
            VacancyDTO vac = new VacancyDTO();
            vac.department = "IS";
            vac.description = "Web services";
            vac.manager = "Tom";
            vac.recruiter = "Thumi";
            vac.site = "www.petrosa.co.za";
            vac.startDate = new DateTime(2012, 10, 10);
            vac.endDate = new DateTime(2012, 12, 15);
            vac.description = "desktop support";
            vac.title = "support technician";
            vac.vacancyNumber = "1";
            vac.viewCount = 10;
            vac.viewStatus = "published";
            vac.status = "active";

            vac_context.presist(vac);

            bool expected = true;
            bool actual;
            actual = vac_context.isFound("1");
            Assert.AreEqual(expected, actual);

            VacancyDTO vacTwo = new VacancyDTO();
            vacTwo.department = "Business";
            vacTwo.description = "Money";
            vacTwo.manager = "Marc";
            vacTwo.recruiter = "Mandy";
            vacTwo.site = "Durban";
            vacTwo.startDate = new DateTime(2012, 1, 10);
            vacTwo.endDate = new DateTime(2012, 3, 15);
            vacTwo.description = "desktop support";
            vacTwo.title = "support technician";
            vacTwo.vacancyNumber = "2";
            vacTwo.viewCount = 10;
            vacTwo.viewStatus = "published";
            vacTwo.status = "active";

            vac_context.presist(vacTwo);

            bool expected2 = true;
            bool actual2;
            actual2 = vac_context.isFound("2");
            Assert.AreEqual(expected2, actual2);

            VacancyDTO vacThree = new VacancyDTO();
            vacThree.department = "Business";
            vacThree.description = "Money";
            vacThree.manager = "Roos";
            vacThree.recruiter = "Rick";
            vacThree.site = "Durban";
            vacThree.startDate = new DateTime(2012, 11, 10);
            vacThree.endDate = new DateTime(2012, 12, 20);
            vacThree.description = "desktop support";
            vacThree.title = "support technician";
            vacThree.vacancyNumber = "3";
            vacThree.viewCount = 10;
            vacThree.viewStatus = "published";
            vacThree.status = "active";

            vac_context.presist(vacThree);

            bool expected3 = true;
            bool actual3;
            actual3 = vac_context.isFound("3");
            Assert.AreEqual(expected3, actual3);

            VacancyByDepartment get = new VacancyByDepartment();

            List<VacancyDTO> listVacs = get.getVacanciesByDept("Business");

            foreach (VacancyDTO v in listVacs)
            {
                string vacNo = v.vacancyNumber.ToString();
                Assert.IsNotNull(vacNo);

            }

            vac_context.removeByUserId("1");
            vac_context.removeByUserId("2");
            vac_context.removeByUserId("3");
        }