Exemplo n.º 1
0
        /// <summary>
        /// 관심과목 담기를 한 과목에 대해서 취소하는 메서드
        /// </summary>
        /// <param name="id">현재 사용자의 아이디</param>
        /// <param name="dataControl">데이터 정보를 관리해주는 객체</param>
        public void DeleteInterest(string id, DataControl dataControl)
        {
            string number, division;

            dataControl.MyInterestLectures(id);

            drawUI.DeleteInterestQuestionNumber();

            number = drawUI.GetConsoleIdNumber(6);
            if (number.Equals("back"))
            {
                return;
            }
            drawUI.AddInterestQuestionDivision();
            division = drawUI.GetConsoleIdNumber(3);
            if (division.Equals("back"))
            {
                return;
            }
            //각각 전공, 학수번호, 분반에 대한 예외처리
            if (!exceptionHandler.CheckLectureNumber(number))
            {
                drawUI.NumberError();
                DeleteInterest(id, dataControl);
                return;
            }
            else if (!exceptionHandler.CheckLectureDivision(division))
            {
                drawUI.DivisionError();
                DeleteInterest(id, dataControl);
                return;
            }
            if (dataControl.DeleteInterestList(number, division))
            {
                drawUI.DeleteSuccess();
            }
            else
            {
                drawUI.DeleteFailed();
            }
        }