예제 #1
0
        public LecturePlan GetLecturePlan(LecturePlan lectureplan)
        {
            LecturePlan result = null;

            foreach (LecturePlan item in lecturePlans)
            {
                if (lectureplan.Equals(item))
                {
                    result = lectureplan;
                }
            }
            if (result == null)
            {
                throw new NullReferenceException();
            }
            return(result);
        }
예제 #2
0
        public LecturePlan GetLecturePlanByID(int id)
        {
            LecturePlan result = null;

            foreach (LecturePlan item in lecturePlans)
            {
                if (id.Equals(item.ID))
                {
                    result = item;
                }
            }

            if (result == null)
            {
                throw new NullReferenceException();
            }

            return(result);
        }
예제 #3
0
        public void RemoveLecturePlanByID(int id)
        {
            LecturePlan lecturePlan = GetLecturePlanByID(id);

            RemoveLecturePlan(lecturePlan);
        }
예제 #4
0
 public void RemoveLecturePlan(LecturePlan lectureplan)
 {
     lecturePlans.Remove(lectureplan);
 }
예제 #5
0
 public int AddLecturePlan(LecturePlan lectureplan)
 {
     lectureplan.ID = this.NextID();
     lecturePlans.Add(lectureplan);
     return(lectureplan.ID);
 }