예제 #1
0
        private void HandleSudentLine(IList<string> line)
        {
            var student = new Student()
            {
                FirstName = line.Col(FirstName),
                IsMale = true,
                LastName = line.Col(SecondName)
            };
            student.Group = GetGroup(line);
            if (student.Group == null)
            {
                this.Info.Scipped.Add(line.Join("  "));
                return;
            }

            var fatherName = line.Col(FatherName);
            if (!fatherName.IsEmpty() && fatherName != "*")
                student.FirstName += ' ' + fatherName;
            if (StudentManager.MergeOrCreate(student))
                this.Info.New++;
        }
예제 #2
0
        protected Entities.Group GetGroup(IList<string> line)
        {
            var groupName = line.Col(Group);
            if (groupName.IsEmpty())
                return null;
            groupName = prepareGroupName(groupName);

            var group = Groups.GetOrDefault(groupName);
            if (group == null)
            {
                group = new Group() { Name = groupName };
                Groups.Add(group.Name, group);
                GroupManager.Create(group);
            }
            return group;
        }