public void doReset()
 {
     if (isMinimumValid())
     {
         BasicEduDAO basicEduDao = new BasicEduDAO();
         BasicEduDTO basicEduInfoDto = basicEduDao.find(view.getUsername());
         setBasicEduDto(basicEduInfoDto);
         view.showFeedback("Fields are reset.");
     }
     else
     {
         view.showFeedback("Error Field vlaues are not valid");
     }
 }
        public void BasicEduDAO_Test()
        {
            /*Context*/
            BasicEduDAO edu_context = new BasicEduDAO();
            AccountDAO acc_context = new AccountDAO();

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

            acc_context.presist(acc);

            BasicEduDTO basic_Edu = new BasicEduDTO();
            basic_Edu.userName = "******";
            basic_Edu.country = "South Africa";
            basic_Edu.levelCompleted = 12;
            basic_Edu.province = "WP";
            basic_Edu.school = "Brackenfell High School";
            basic_Edu.town = "Cape Town";

            edu_context.presist(basic_Edu);

            /*Update*/
            basic_Edu.province = "PE";
            edu_context.merge(basic_Edu);

            string expectedUpdate = "PE";
            BasicEduDTO updateEdu = edu_context.find("griddy");
            Assert.AreEqual(expectedUpdate, updateEdu.province);

            ///*Delete*/
            edu_context.removeByUserId("griddy");
            bool expectedDelBasicEdu = false;
            bool actualDelBasicEdu = edu_context.isFound("griddy");
            Assert.AreEqual(expectedDelBasicEdu, actualDelBasicEdu);

            acc_context.removeByUserId("griddy");
        }
예제 #3
0
        protected void rptBasicEdu_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            BasicEduDTO dto;
            BasicEduDAO dao = new BasicEduDAO();
            String element = e.CommandName.ToString();

            if (element.Equals("school"))
            {
                dto = dao.find(getUsername());
                presenter.setBasicEduDto(dto);
                presenter.updateView();
            }
        }