public Group ParseStringIntoGroup(string info)
 {
     if (info == string.Empty) return null;
     Group group = new Group();
     group.NameLetter = info.Split('-')[1];
     group.NameNumber = Convert.ToInt32(info.Split('-')[0]);
     return group;
 }
예제 #2
0
        public void UpdateGroup(Group group)
        {
            var copies = this.unitOfWork.GroupRepository.GetMany(
                g => ((g.NameNumber == group.NameNumber) && (g.NameLetter == group.NameLetter)));

            if (copies.ToList().Count == 0)
            {
                this.unitOfWork.GroupRepository.Update(group);
                this.unitOfWork.SaveChanges();
            }
        }
예제 #3
0
        public static ViewGroup CreateSimpleGroup(Group g)
        {
            ViewGroup temp = Mapper.Map<Group, ViewGroup>(g);
            List<ViewPupil> pupils = new List<ViewPupil>();
            ViewPupil p = new ViewPupil();

            if (g.Pupils != null)
            {
                foreach (var v in g.Pupils)
                    pupils.Add(Mapper.Map<SchoolWebProject.Domain.Models.Pupil, ViewPupil>(v));

                temp.ViewPupils = pupils;
            }

            return temp;
        }