/// <summary> /// 학과정보, 학수번호, 분반 정보를 가지고 엑셀정보에서 해당 과목 정보를 가져온다. /// </summary> /// <param name="id">현재 접속중인 사용자</param> /// <param name="major">학과 이름</param> /// <param name="number">학수 번호</param> /// <param name="division">분반</param> /// <returns>엑셀에서 관심과목 담고자 하는 과목 정보</returns> public InterestLectureVO GetInterestLecture(string id, string major, string number, string division) { InterestLectureVO interest = new InterestLectureVO(); int count = 1; for (int row = 2; row <= lectureInformation.GetLength(0); row++) { if (Regex.IsMatch(lectureInformation[row, 2].ToString(), major) && lectureInformation[row, 3].Equals(number) && lectureInformation[row, 4].Equals(division)) { interest.Id = id; interest.No = lectureInformation[row, 1].ToString(); interest.Major = lectureInformation[row, 2].ToString(); interest.Number = lectureInformation[row, 3].ToString(); interest.Division = lectureInformation[row, 4].ToString(); interest.Name = lectureInformation[row, 5].ToString(); interest.Completion = lectureInformation[row, 6].ToString(); interest.Grade = lectureInformation[row, 7].ToString(); interest.Credit = lectureInformation[row, 8].ToString(); interest.Time = lectureInformation[row, 9].ToString(); if (lectureInformation[row, 10] != null) { interest.Room = lectureInformation[row, 10].ToString(); } else { interest.Room = ""; } interest.Professor = lectureInformation[row, 11].ToString(); interest.Language = lectureInformation[row, 12].ToString(); return(interest); } count++; } if (count.Equals(lectureInformation.GetLength(0))) { return(null); } else { return(interest); } }
/// <summary> /// 관심과목 추가하기 /// </summary> /// <param name="interest">관심과목정보</param> /// <param name="id">현 사용자 아이디</param> public void AddInterestList(InterestLectureVO interest, string id) { int count = 0; for (int index = 0; index < studentList.Count; index++) { if (studentList[index].Id.Equals(id) && (studentList[index].InterestPoint + Convert.ToInt32(interest.Credit[0] - '0')) < 25) { studentList[index].InterestPoint += Convert.ToInt32(interest.Credit[0] - '0'); break; } count++; } if (studentList.Count.Equals(count)) { return; } else { interestLectureList.Add(interest); } }