Exemplo n.º 1
0
        public List <GroupStudentDTO> GetGroupDemoOrder()
        {
            List <GroupStudent> currentGroupStudentList = _groupStudentDBManager.GetAll();
            List <GroupStudent> groupStudentDemoOrder   = currentGroupStudentList.OrderBy(group => new Random().Next()).ToList();

            return(DTOUtil.MapGroupStudentDTOList(groupStudentDemoOrder));
        }
Exemplo n.º 2
0
        /// <summary>
        /// 5 grupos =>
        /// 3 grupos de 4 integrantes
        /// &
        /// 2 grupos de 5 integrantes
        /// </summary>
        /// <returns></returns>
        public List <GroupStudentDTO> GetNewGroupStudentList()
        {
            // Retrieve all students from database
            List <Student> allStudents = _studentDBManager.GetAll();

            List <Student> unOrderStudentList =
                allStudents.OrderBy(student => new Random().Next()).ToList();

            List <Student> studentsInBigGroupsFirst =
                unOrderStudentList.OrderBy(student => WasInBigGroup(student) ? 0 : 1).ToList();

            List <GroupStudent> newGroupStudentList = new List <GroupStudent>();

            // Process all stundents
            foreach (Student student in studentsInBigGroupsFirst)
            {
                int groupNumnber;
                if (WasInBigGroup(student))
                {
                    groupNumnber = GetAGroupNumber(1, 3);
                }
                else
                {
                    groupNumnber = GetAGroupNumber(1, 5);
                }
                AssignGroup(groupNumnber, newGroupStudentList, student);
            }

            return(DTOUtil.MapGroupStudentDTOList(newGroupStudentList));
        }
Exemplo n.º 3
0
        public List <GroupStudentDTO> GetCurrentGroupStudentList()
        {
            List <GroupStudent> groupStudentList = _groupStudentDBManager.GetAll();

            return(DTOUtil.MapGroupStudentDTOList(groupStudentList));
        }
Exemplo n.º 4
0
 public List <GroupDTO> GetAll()
 {
     return(DTOUtil.MapGroupDTOList(_groupDBManager.GetAll()));
 }