Exemple #1
0
        // GET: Course
        public ActionResult JoinACourse(string courseCode)
        {
            CourseGetResponse  cgr = _courseCom.GetCourse(courseCode);
            DisplayCourseModel dcm = new DisplayCourseModel();

            if (cgr != null)
            {
                dcm.CourseCode             = cgr.CourseCode;
                dcm.CourseDescription      = cgr.CourseDescription;
                dcm.CourseName             = cgr.CourseName;
                dcm.DesiredSkillSets       = cgr.DesiredSkillSets;
                dcm.GroupSize              = (int)cgr.GroupSize;
                dcm.GroupType              = cgr.GroupType;
                dcm.PreferSimiliarSkillSet = (bool)cgr.PreferSimiliarSkillSet;
                dcm.Users     = new List <GT.BuddyUp.WebApp.Models.DisplayCourseUser>();
                dcm.Questions = new List <GT.BuddyUp.WebApp.Models.DsiplayQuestion>();
            }
            foreach (var user in cgr.UserList)
            {
                dcm.Users.Add(new DisplayCourseUser()
                {
                    emailId = user.EmailID,
                    name    = user.Name,
                    role    = user.RoleCode
                });
            }

            QuestionnaireGetResponse qgr = _questionnaireCom.GetQuestionnaire(cgr.QuestionnaireCode);

            if (qgr != null)
            {
                foreach (var q in qgr.Questions)
                {
                    dcm.Questions.Add(new GT.BuddyUp.WebApp.Models.DsiplayQuestion()
                    {
                        QuestionText  = q.questionText,
                        QuestionType  = q.questionType,
                        AnswerChoices = q.answerChoices
                    });
                }
            }
            return(View(dcm));
        }
Exemple #2
0
        public ActionResult Create(string courseCode)
        {
            GroupCreateModel  gcm = new GroupCreateModel();
            CourseGetResponse cgr = _courseCom.GetCourse(courseCode);

            if (cgr != null)
            {
                gcm.GroupTypeCode = cgr.GroupType;
                if (cgr.GroupSize.HasValue)
                {
                    gcm.MaxNumberOfUsers = cgr.GroupSize;
                }
            }
            gcm.timeZones  = TimeZoneInfo.GetSystemTimeZones().Select(x => x.DisplayName).ToList();
            gcm.CourseCode = courseCode;
            return(View(gcm));
        }