コード例 #1
0
        public ActionResult Inactive()
        {
            var userInfo = UserHelper.GetCurrentUserInfo();

            if (userInfo.IsInRole(UserRoleCode.Career))
            {
                var inactiveMentors = _mentorService.Search(m => m.Status == MentorStatus.Inactive);

                var mentorModel = new AllMentorsModel
                {
                    Inactive = ToMentorModelCollection(inactiveMentors)
                };
                return(View(mentorModel));
            }

            return(View("Unauthorized"));
        }
コード例 #2
0
        public ActionResult Rejected()
        {
            var userInfo = UserHelper.GetCurrentUserInfo();

            if (userInfo.IsInRole(UserRoleCode.Career))
            {
                var rejectedMentors = _mentorService.Search(m => m.Status == MentorStatus.Rejected);

                var mentorModel = new AllMentorsModel
                {
                    Rejected = ToMentorModelCollection(rejectedMentors),
                };

                return(View(mentorModel));
            }

            return(View("Unauthorized"));
        }
コード例 #3
0
        public ActionResult PendingRenewal()
        {
            var userInfo = UserHelper.GetCurrentUserInfo();

            if (userInfo.IsInRole(UserRoleCode.Career))
            {
                var pendingRenewalMentors = _mentorService.Search(m => m.Status == MentorStatus.PendingRenewal);

                var mentorModel = new AllMentorsModel
                {
                    PendingRenewal = ToMentorModelCollection(pendingRenewalMentors),
                };

                return(View(mentorModel));
            }

            return(View("Unauthorized"));
        }
コード例 #4
0
        public ActionResult ByStatus()
        {
            var userInfo = UserHelper.GetCurrentUserInfo();

            if (userInfo.IsInRole(UserRoleCode.Career))
            {
                var mentorsWithSlots    = _mentorService.Search(m => m.Status == MentorStatus.Active && m.Mentees.Count > 0 && m.Mentees.Count < m.MaxMentees);
                var mentorsWithoutSlots = _mentorService.Search(m => m.Status == MentorStatus.Active && m.Mentees.Count > 0 && m.Mentees.Count == m.MaxMentees);

                var mentorModel = new AllMentorsModel
                {
                    MentorsWithSlots    = ToMentorModelCollection(mentorsWithSlots),
                    MentorsWithoutSlots = ToMentorModelCollection(mentorsWithoutSlots),
                };
                return(View(mentorModel));
            }

            return(View("Unauthorized"));
        }