コード例 #1
0
        public static UserViewModel GetApplicant(int id)
        {
            var           account   = Repository.GetAccount(id);
            UserViewModel applicant = UserService.SetUser(account);

            applicant.CompletionPercentage = BadgesService.GetCompletionPercentage(account.userID);

            return(applicant);
        }
コード例 #2
0
        public static List <UserViewModel> GetAllApplicants()
        {
            var accounts = Repository.GetAllAccounts();
            List <UserViewModel> applicants = new List <UserViewModel>();

            foreach (Account acc in accounts)
            {
                if (acc.userType.Equals(UserTypeEnum.Applicant.ToString()))
                {
                    UserViewModel applicant = UserService.SetUser(acc);
                    applicant.CompletionPercentage = BadgesService.GetCompletionPercentage(acc.userID);
                    applicants.Add(applicant);
                }
            }

            return(applicants);
        }