public void doDelete()
 {
     if (isMinimumValid())
     {
         EmploymentDAO employmentDao = new EmploymentDAO();
         employmentDao.removeByUserId(view.getUsername(), view.getStartDate());
         view.pageReload();
     }
     else
     {
         view.showFeedback("Error Field vlaues are not valid");
     }
 }
        public void EmploymentDAO_Test()
        {
            /*Context*/
            EmploymentDAO emp_context = new EmploymentDAO();
            AccountDAO account_context = new AccountDAO();

            /*Insert*/
            AccountDTO account = new AccountDTO();
            account.userName = "******";
            account.status = "active";
            account.password = "******";
            account.accountType = "admin";

            account_context.presist(account);

            EmploymentDTO employment = new EmploymentDTO();
            employment.company = "fuzion";
            employment.country = "SA";
            employment.currentEmployer = "Apple";
            employment.empType = "Contract";
            employment.endDate = new DateTime(2012, 12, 30);
            employment.gross = 10000;
            employment.industry = "IT";
            employment.province = "WP";
            employment.responsibilities = "web development";
            employment.startDate = new DateTime(2012, 6, 7);
            employment.title = "web developer";
            employment.town = "cape town";
            employment.userName = "******";

            emp_context.presist(employment);

            bool expected = true;
            bool actual;
            actual = emp_context.isFound("griddy", new DateTime(2012, 6, 7) );
            Assert.AreEqual(expected, actual);

            /*Update*/
            employment.gross = 125000;
            emp_context.merge(employment);

            double expectedUpdate = 125000;
            EmploymentDTO contUpd = emp_context.find("griddy", new DateTime(2012, 6, 7));
            Assert.AreEqual(expectedUpdate, contUpd.gross);

            /*Delete*/
            emp_context.removeByUserId("griddy", new DateTime(2012, 6, 7));
            bool expectedDelete = false;
            bool actualDelete = emp_context.isFound("griddy", new DateTime(2012, 6, 7));
            Assert.AreEqual(expectedDelete, actualDelete);

            account_context.removeByUserId("griddy");
        }