예제 #1
0
        private void AddEditPersonalCare(Student student)
        {
            StudentPersonalCareData personaCareData = new StudentPersonalCareData(dbc);

            foreach (StudentPersonalCare spc in student.PersonalCare)
            {
                if (spc.StudentPersonalCareId == 0)
                {
                    personaCareData.Add(spc, student.PersonId);
                }
                else
                {
                    personaCareData.Update(spc);
                }
            }

            foreach (object obj in student.RemovedObjects)
            {
                if (obj is StudentPersonalCare)
                {
                    personaCareData.Remove(((StudentPersonalCare)obj).StudentPersonalCareId);
                }
            }
        }
        public StudentPersonalCareAddEdit(Student student, DBCommand dbc) : base(student, dbc)
        {
            StudentPersonalCareData personaCareData = new StudentPersonalCareData(dbc);

            foreach (StudentPersonalCare spc in student.PersonalCare)
            {
                if (spc.StudentPersonalCareId == 0)
                {
                    personaCareData.Add(spc, student.PersonId);
                }
                else
                {
                    personaCareData.Update(spc);
                }
            }

            foreach (object obj in student.RemovedObjects)
            {
                if (obj is StudentPersonalCare)
                {
                    personaCareData.Remove(((StudentPersonalCare)obj).StudentPersonalCareId);
                }
            }
        }