Esempio n. 1
0
        /// <summary>
        /// 수강신청을 하는 메서드
        /// </summary>
        /// <param name="register">수강신청 과목정보</param>
        /// <param name="id">현 사용자 아이디</param>
        public void AddRegisterList(RegisterLectureVO register, string id)
        {
            int count = 0;

            if (!exceptionHandler.CheckSameTimeRegisted(registerLectureList, id, register.Time))
            {
                drawUI.ThatTimeNo();
                return;
            }
            for (int index = 0; index < studentList.Count; index++)
            {
                if (studentList[index].Id.Equals(id) && (studentList[index].RegistePoint + Convert.ToInt32(register.Credit[0] - '0')) < 22)
                {
                    studentList[index].RegistePoint += Convert.ToInt32(register.Credit[0] - '0');
                    break;
                }
                count++;
            }
            if (studentList.Count.Equals(count))
            {
                return;
            }
            else
            {
                for (int index = 0; index < interestLectureList.Count; index++)
                {
                    if (interestLectureList[index].Major.Equals(register.Major) && interestLectureList[index].Number.Equals(register.Number) && interestLectureList[index].Division.Equals(register.Division))
                    {
                        interestLectureList.RemoveAt(index);
                    }
                }
                registerLectureList.Add(register);
                drawUI.AddSuccess();
            }
        }