Пример #1
0
 /// <summary>
 /// Ghi đè phương thức dùng để lọc request.
 /// Author       :   AnTM - 14/04/2018 - create
 /// </summary>
 /// <param name="actionContext">
 /// Data của 1 request.
 /// </param>
 public override void OnAuthorization(HttpActionContext actionContext)
 {
     if (actionContext.Request.Headers.Authorization == null)
     {
         actionContext.Response = actionContext.Request.CreateResponse(System.Net.HttpStatusCode.Unauthorized, AppMessage.NotAllowed);
     }
     else
     {
         string token            = actionContext.Request.GetAuthorizationHeader();
         var    tokenInformation = JwtAuthenticationExtensions.ExtractTokenInformation(token);
         if (tokenInformation == null)
         {
             actionContext.Response = actionContext.Request.CreateResponse(System.Net.HttpStatusCode.Unauthorized, AppMessage.NotAllowed);
         }
         else if (tokenInformation.IsStudent)
         {
             //actionContext.Response = actionContext.Request.CreateResponse(System.Net.HttpStatusCode.NotAcceptable, AppMessage.NotAccept);
         }
         else
         {
             //var route = actionContext.RequestContext.RouteData;
             //string controller = (string)route.Values["controller"];
             //string action = (string)route.Values["action"];
             //if (!AccountVerification.CheckAuthentication(token, controller, action))
             //{
             //    actionContext.Response = actionContext.Request.CreateResponse(System.Net.HttpStatusCode.NotAcceptable, AppMessage.NotAccept);
             //}
         }
     }
 }
        public DocumentResponseDto UpdateFile(DocumentDto documentDto, string token, string host)
        {
            int    Id        = JwtAuthenticationExtensions.ExtractTokenInformation(token).UserId;
            int    idStudent = context.Students.FirstOrDefault(x => x.UserInfoId == Id && !x.DelFlag).Id;
            string url       = FunctionCommon.SaveFile(documentDto.File, documentDto.DocumentId, documentDto.FileName);
            string urlFile   = context.Documents.FirstOrDefault(x => x.Id == documentDto.DocumentId && x.StudentId == idStudent && !x.DelFlag).Url;
            string strUrl    = host + "/" + url;
            var    doc       = context.Documents.FirstOrDefault(x => !x.DelFlag && x.Id == documentDto.DocumentId);

            context.Documents.Where(x => x.Id == documentDto.DocumentId && x.StudentId == idStudent && !x.DelFlag).Update(x => new Database.Schema.Entity.Document
            {
                Url            = strUrl,
                FileName       = documentDto.FileName,
                StatusId       = 2,
                DocumentTypeId = doc.DocumentTypeId
            });
            context.SaveChanges();
            FunctionCommon.DeleteFile(urlFile.Substring(host.Length, urlFile.Length - host.Length));
            return(context.Documents.Where(x => x.Id == documentDto.DocumentId && !x.DelFlag).Select(x => new DocumentResponseDto
            {
                Id = x.Id,
                DocumentTypeId = x.DocumentTypeId,
                DocumentTypeName = x.DocumentType.Name,
                Url = x.Url,
                StatusId = x.StatusId,
                StatusName = x.Status.Name,
                IsRequired = x.DocumentType.IsRequired,
                ResponseMessage = x.ResponseMessage,
                Description = x.DocumentType.Description,
                FileName = x.FileName
            }).FirstOrDefault());
        }
        public static bool IsAdmin(string token)
        {
            var tokenInformation = JwtAuthenticationExtensions.ExtractTokenInformation(token);

            if (tokenInformation == null)
            {
                return(false);
            }
            return(tokenInformation.GroupName == "Admin");
        }
        private static bool ValidatePermission(string token, int userId)
        {
            var tokenInformation = JwtAuthenticationExtensions.ExtractTokenInformation(token);

            if (tokenInformation == null)
            {
                return(false);
            }
            return(tokenInformation.GroupName == "Admin" ||
                   tokenInformation.GroupName == "Mod" ||
                   tokenInformation.UserId == userId);
        }
        public bool UpdatePass(UpdatePassword updatePassword, string token)
        {
            int Id = JwtAuthenticationExtensions.ExtractTokenInformation(token).UserId;

            if (string.Compare(FunctionCommon.GetMd5(FunctionCommon.GetSimpleMd5(updatePassword.OldPassword)), context.Accounts.FirstOrDefault(x => x.UserInfoId == Id && !x.DelFlag).Password) != 0)
            {
                return(false);
            }
            else
            {
                var TaiKhoan = context.Accounts.FirstOrDefault(x => x.UserInfoId == Id && !x.DelFlag);
                TaiKhoan.Password = FunctionCommon.GetMd5(FunctionCommon.GetSimpleMd5(updatePassword.NewPassword));
                context.SaveChanges();
                return(true);
            }
        }
        public bool DeletionObject(DeletionObject deletionObject, string token)
        {
            int  Id      = JwtAuthenticationExtensions.ExtractTokenInformation(token).UserId;
            var  Student = context.Students.FirstOrDefault(x => x.UserInfoId == Id && !x.DelFlag);
            bool result  = false;

            switch (deletionObject.ObjectType)
            {
            case 0:
            {
                var achievement = context.Achievements.FirstOrDefault(x => x.Id == deletionObject.Id && !x.DelFlag);
                if (achievement != null)
                {
                    achievement.DelFlag = true;
                    result = true;
                }
                break;
            }

            case 1:
            {
                var familyMembers = context.FamilyMembers.FirstOrDefault(x => x.Id == deletionObject.Id && !x.DelFlag);
                if (familyMembers != null)
                {
                    familyMembers.DelFlag              = true;
                    familyMembers.ContactInfo.DelFlag  = true;
                    familyMembers.PersonalInfo.DelFlag = true;
                    result = true;
                }
                break;
            }

            case 2:
            {
                var highSchoolResult = context.HighSchoolResults.FirstOrDefault(x => x.Id == deletionObject.Id && !x.DelFlag);
                if (highSchoolResult != null)
                {
                    highSchoolResult.DelFlag = true;
                    result = true;
                }
                break;
            }
            }

            context.SaveChanges();
            return(result);
        }
        public void UpdateProfile(Profile profile, string token)
        {
            int id       = JwtAuthenticationExtensions.ExtractTokenInformation(token).UserId;
            var student  = context.Students.FirstOrDefault(x => x.UserInfoId == id && !x.DelFlag);
            var userInfo = context.UserInfoes.FirstOrDefault(x => x.Id == id);

            student.IdentificationNumber         = profile.IdentificationNumber;
            userInfo.IdentityInfo.IdentityNumber = profile.IdentityNumber;
            userInfo.LastName          = profile.LastName;
            userInfo.FirstName         = profile.FirstName;
            userInfo.Avatar            = profile.Avatar;
            student.CircumstanceTypeId = profile.CircumstanceTypeId;

            userInfo.IdentityInfo.DateOfIssue       = Convert.ToDateTime(profile.PersonalInfo.DateOfIssue);
            userInfo.IdentityInfo.PlaceOfIssue      = profile.PersonalInfo.PlaceOfIssue;
            userInfo.BirthInfo.DateOfBirth          = Convert.ToDateTime(profile.PersonalInfo.DateOfBirth);
            userInfo.BirthInfo.PlaceOfBirth         = profile.PersonalInfo.PlaceOfBirth;
            userInfo.BirthInfo.Sex                  = profile.PersonalInfo.Sex;
            userInfo.ContactInfo.PhoneNumber        = profile.PersonalInfo.PhoneNumber;
            userInfo.ContactInfo.Email              = profile.PersonalInfo.Email;
            userInfo.ContactInfo.Address            = profile.PersonalInfo.Address;
            student.PersonalInfo.EthnicId           = profile.PersonalInfo.EthnicId;
            student.PersonalInfo.ReligionId         = profile.PersonalInfo.ReligionId;
            student.PersonalInfo.NationalityId      = profile.PersonalInfo.NationalityId;
            student.PersonalInfo.PermanentResidence = profile.PersonalInfo.PermanentResidence;

            student.Class.Name                    = profile.UniversityInfo.ClassName;
            student.Class.Department.Name         = profile.UniversityInfo.DepartmentName;
            student.Class.Department.Faculty.Name = profile.UniversityInfo.FacultyName;
            student.Class.Department.Program.Name = profile.UniversityInfo.ProgramName;
            student.EnrollmentArea.Name           = profile.UniversityInfo.EnrollmentAreaName;
            student.ElectionType.Name             = profile.UniversityInfo.ElectionName;

            student.HightSchoolName = profile.HightSchoolInfo.HightSchoolName;
            if (student.YouthGroupInfoId != null)
            {
                student.YouthGroupInfo.DateOfJoiningYouthGroup = Convert.ToDateTime(profile.HightSchoolInfo.YouthGroupInfo.DateOfJoiningYouthGroup);
                student.YouthGroupInfo.PlaceOfJoinYouthGroup   = profile.HightSchoolInfo.YouthGroupInfo.PlaceOfJoinYouthGroup;
                student.YouthGroupInfo.HavingBooksOfYouthGroup = profile.HightSchoolInfo.YouthGroupInfo.HavingBooksOfYouthGroup;
                student.YouthGroupInfo.HavingCardsOfYouthGroup = profile.HightSchoolInfo.YouthGroupInfo.HavingCardsOfYouthGroup;
            }
            context.SaveChanges();
        }
        public List <DocumentResponseDto> GetListDocument(string token)
        {
            int Id        = JwtAuthenticationExtensions.ExtractTokenInformation(token).UserId;
            int idStudent = context.Students.FirstOrDefault(x => x.UserInfoId == Id && !x.DelFlag).Id;

            return(context.Documents.Where(x => x.StudentId == idStudent && !x.DelFlag).Select(x => new DocumentResponseDto
            {
                Id = x.Id,
                DocumentTypeId = x.DocumentTypeId,
                DocumentTypeName = x.DocumentType.Name,
                Url = x.Url,
                StatusId = x.StatusId,
                StatusName = x.Status.Name,
                IsRequired = x.DocumentType.IsRequired,
                ResponseMessage = x.ResponseMessage,
                Description = x.DocumentType.Description,
                FileName = x.FileName
            }).ToList());
        }
Пример #9
0
        public void UpdateEmployeeProfile(UpdateEmployeeProfile updateEmployeeProfile, string token)
        {
            int id       = JwtAuthenticationExtensions.ExtractTokenInformation(token).UserId;
            var userInfo = context.UserInfoes.FirstOrDefault(x => !x.DelFlag && x.Id == id);

            if (userInfo != null)
            {
                userInfo.FirstName                   = updateEmployeeProfile.FirstName;
                userInfo.LastName                    = updateEmployeeProfile.LastName;
                userInfo.Avatar                      = updateEmployeeProfile.Avatar;
                userInfo.BirthInfo.DateOfBirth       = updateEmployeeProfile.DateOfBirth;
                userInfo.BirthInfo.PlaceOfBirth      = updateEmployeeProfile.PlaceOfBirth;
                userInfo.BirthInfo.Sex               = updateEmployeeProfile.Sex;
                userInfo.ContactInfo.PhoneNumber     = updateEmployeeProfile.PhoneNumber;
                userInfo.ContactInfo.Email           = updateEmployeeProfile.Email;
                userInfo.ContactInfo.Address         = updateEmployeeProfile.Address;
                userInfo.IdentityInfo.IdentityNumber = updateEmployeeProfile.IdentityNumber;
            }
            context.SaveChanges();
        }
        public AchievementResponseDto UpdateAddAchievement(Achievement achievement, string token)
        {
            int Id      = JwtAuthenticationExtensions.ExtractTokenInformation(token).UserId;
            var Student = context.Students.FirstOrDefault(x => x.UserInfoId == Id && !x.DelFlag);

            if (achievement.Id == 0)
            {
                achievement.Id = context.Achievements.Max(x => x.Id) + 1;
                context.Achievements.Add(new Database.Schema.Entity.Achievement
                {
                    StudentId          = Student.Id,
                    AchievementLevelId = achievement.AchievementLevelId,
                    AchievementPrizeId = achievement.AchievementPrizeId,
                    AchievementTypeId  = achievement.AchievementTypeId,
                    Description        = achievement.Description
                });
            }
            else
            {
                context.Achievements.Where(x => x.StudentId == Student.Id && x.Id == achievement.Id && !x.DelFlag).Update(x => new Database.Schema.Entity.Achievement
                {
                    AchievementLevelId = achievement.AchievementLevelId,
                    AchievementPrizeId = achievement.AchievementPrizeId,
                    AchievementTypeId  = achievement.AchievementTypeId,
                    Description        = achievement.Description
                });
            }
            context.SaveChanges();

            return(new AchievementResponseDto()
            {
                Id = achievement.Id,
                AchievementLevelId = achievement.AchievementLevelId,
                AchievementLevelName = context.AchievementLevels.FirstOrDefault(x => x.Id == achievement.AchievementLevelId).Name,
                AchievementPrizeId = achievement.AchievementPrizeId,
                AchievementPrizeName = context.AchievementPrizes.FirstOrDefault(x => x.Id == achievement.AchievementLevelId).Name,
                AchievementTypeId = achievement.AchievementTypeId,
                AchievementTypeName = context.AchievementTypes.FirstOrDefault(x => x.Id == achievement.AchievementTypeId).Name,
                Description = achievement.Description
            });
        }
        public HighSchoolResultResponseInfo UpdateAddHighSchoolResult(HighSchoolResult HighSchoolResult, string token)
        {
            int Id      = JwtAuthenticationExtensions.ExtractTokenInformation(token).UserId;
            var Student = context.Students.FirstOrDefault(x => x.UserInfoId == Id && !x.DelFlag);

            if (HighSchoolResult.Id == 0)
            {
                HighSchoolResult.Id = context.HighSchoolResults.Max(x => x.Id) + 1;
                context.HighSchoolResults.Add(new Database.Schema.Entity.HighSchoolResult
                {
                    StudentId         = Student.Id,
                    HightSchoolYearId = HighSchoolResult.HightSchoolYearId,
                    ConductTypeId     = HighSchoolResult.ConductTypeId,
                    LearningAbilityId = HighSchoolResult.LearningAbilityId,
                    GPAScore          = HighSchoolResult.GPAScore
                });
            }
            else
            {
                context.HighSchoolResults.Where(x => x.StudentId == Student.Id && x.Id == HighSchoolResult.Id && !x.DelFlag).Update(x => new Database.Schema.Entity.HighSchoolResult
                {
                    HightSchoolYearId = HighSchoolResult.HightSchoolYearId,
                    ConductTypeId     = HighSchoolResult.ConductTypeId,
                    LearningAbilityId = HighSchoolResult.LearningAbilityId,
                    GPAScore          = HighSchoolResult.GPAScore
                });
            }
            context.SaveChanges();
            return(new HighSchoolResultResponseInfo()
            {
                Id = HighSchoolResult.Id,
                ConductTypeId = HighSchoolResult.ConductTypeId,
                GPAScore = HighSchoolResult.GPAScore,
                HightSchoolYearId = HighSchoolResult.HightSchoolYearId,
                LearningAbilityId = HighSchoolResult.LearningAbilityId,
                ConductTypeName = context.ConductTypes.FirstOrDefault(x => !x.DelFlag && x.Id == HighSchoolResult.ConductTypeId).Level,
                HightSchoolYear = context.HightSchoolYears.FirstOrDefault(x => !x.DelFlag && x.Id == HighSchoolResult.HightSchoolYearId).Year,
                LearningAbilityName = context.LearningAbilities.FirstOrDefault(x => !x.DelFlag && x.Id == HighSchoolResult.LearningAbilityId).Level
            });
        }
        public TuitionDetail GetTuitionDetail(string token)
        {
            int           id             = JwtAuthenticationExtensions.ExtractTokenInformation(token).UserId;
            var           classOfStudent = context.Students.FirstOrDefault(x => x.UserInfoId == id && !x.DelFlag).Class;
            TuitionDetail tuitionDetail  = new TuitionDetail();

            tuitionDetail.TuitionTypes = context.TuitionTypes.Where(x => !x.DelFlag).Select(x => new TuitionType
            {
                Id          = x.Id,
                Name        = x.Name,
                Money       = x.Money,
                Description = x.Description
            }).ToList();

            tuitionDetail.TuitionFee = classOfStudent.Department.Program.Fees;
            tuitionDetail.TotalOfFee = tuitionDetail.TuitionFee;
            foreach (TuitionType tuitionType in tuitionDetail.TuitionTypes)
            {
                tuitionDetail.TotalOfFee += tuitionType.Money;
            }
            return(tuitionDetail);
        }
Пример #13
0
        public EmployeeProfile GetEmployeeProfile(string token)
        {
            int id = JwtAuthenticationExtensions.ExtractTokenInformation(token).UserId;
            var employeeProfile = context.UserInfoes.Where(x => !x.DelFlag && x.Id == id).Select(x => new EmployeeProfile
            {
                FirstName      = x.FirstName,
                LastName       = x.LastName,
                Avatar         = x.Avatar,
                DateOfBirth    = x.BirthInfo.DateOfBirth,
                PlaceOfBirth   = x.BirthInfo.PlaceOfBirth,
                Sex            = x.BirthInfo.Sex,
                PhoneNumber    = x.ContactInfo.PhoneNumber,
                Email          = x.ContactInfo.Email,
                Address        = x.ContactInfo.Address,
                IdentityNumber = x.IdentityInfo.IdentityNumber
            }).FirstOrDefault();
            var account = context.Accounts.FirstOrDefault(x => !x.DelFlag && x.UserInfoId == id);

            employeeProfile.UserName         = account.UserName;
            employeeProfile.AccountGroupName = account.AccountGroup.Name;
            return(employeeProfile);
        }
        public FamilyMemberResponseDto UpdateAddFamilyMember(FamilyMember FamilyMember, string token)
        {
            int Id      = JwtAuthenticationExtensions.ExtractTokenInformation(token).UserId;
            var Student = context.Students.FirstOrDefault(x => x.UserInfoId == Id && !x.DelFlag);

            if (FamilyMember.Id == 0)
            {
                var familyMember = context.FamilyMembers.Add(new Database.Schema.Entity.FamilyMember
                {
                    StudentId    = Student.Id,
                    Name         = FamilyMember.Name,
                    RelationId   = FamilyMember.RelationId,
                    YearOfBirth  = FamilyMember.YearOfBirth,
                    CareerTypeId = FamilyMember.CareerTypeId,
                });
                context.PersonalInfoes.Add(new Database.Schema.Entity.PersonalInfo
                {
                    Id                 = familyMember.PersonalInfoId,
                    EthnicId           = FamilyMember.EthnicId,
                    ReligionId         = FamilyMember.ReligionId,
                    NationalityId      = FamilyMember.NationalityId,
                    PermanentResidence = FamilyMember.Address
                });
                context.ContactInfoes.Add(new Database.Schema.Entity.ContactInfo
                {
                    Id          = familyMember.ContactId,
                    PhoneNumber = FamilyMember.PhoneNumber,
                    Email       = "*****@*****.**",
                    Address     = FamilyMember.Address,
                });
            }
            else
            {
                var family = context.FamilyMembers.FirstOrDefault(x => x.Id == FamilyMember.Id && !x.DelFlag);
                context.FamilyMembers.Where(x => x.StudentId == Student.Id && x.Id == FamilyMember.Id && !x.DelFlag).Update(x => new Database.Schema.Entity.FamilyMember
                {
                    Name         = FamilyMember.Name,
                    RelationId   = FamilyMember.RelationId,
                    YearOfBirth  = FamilyMember.YearOfBirth,
                    CareerTypeId = FamilyMember.CareerTypeId
                });

                context.PersonalInfoes.Where(x => x.Id == family.PersonalInfoId && !x.DelFlag).Update(x => new Database.Schema.Entity.PersonalInfo
                {
                    EthnicId           = FamilyMember.EthnicId,
                    ReligionId         = FamilyMember.ReligionId,
                    NationalityId      = FamilyMember.NationalityId,
                    PermanentResidence = FamilyMember.Address
                });
                context.ContactInfoes.Where(x => x.Id == family.ContactId && !x.DelFlag).Update(x => new Database.Schema.Entity.ContactInfo
                {
                    PhoneNumber = FamilyMember.PhoneNumber,
                    Email       = FamilyMember.Email,
                    Address     = FamilyMember.Address
                });
            }
            context.SaveChanges();
            return(new FamilyMemberResponseDto()
            {
                Id = FamilyMember.Id
            });
        }
        public ProfileResponseDto GetStudentProfileByIdAccount(string token)
        {
            int Id      = JwtAuthenticationExtensions.ExtractTokenInformation(token).UserId;
            var account = context.Accounts.FirstOrDefault(x => x.UserInfoId == Id && !x.DelFlag);

            if (account == null)
            {
                return(null);
            }
            var user          = account.UserInfo;
            var student       = user.Students.FirstOrDefault(x => !x.DelFlag);
            var familyMembers = student.FamilyMembers.Where(x => !x.DelFlag).Select(x => new FamilyMemberResponseDto()
            {
                Id              = x.Id,
                Name            = x.Name,
                Address         = x.ContactInfo.Address,
                CareerTypeId    = x.CareerTypeId,
                CareerTypeName  = x.CareerType.Name,
                Email           = x.ContactInfo.Email,
                EthnicId        = x.PersonalInfo.EthnicId,
                EthnicName      = x.PersonalInfo.Ethnic.Name,
                NationalityId   = x.PersonalInfo.NationalityId,
                NationalityName = x.PersonalInfo.Nationality.Name,
                PhoneNumber     = x.ContactInfo.PhoneNumber,
                RelationId      = x.RelationId,
                RelationName    = x.RelationType.Name,
                ReligionId      = x.PersonalInfo.ReligionId,
                ReligionName    = x.PersonalInfo.Religion.Name,
                YearOfBirth     = x.YearOfBirth
            }).ToList();
            var personalInfo = new PersonalInfoResponseDto()
            {
                Address            = user.ContactInfo.Address,
                DateOfBirth        = user.BirthInfo.DateOfBirth,
                DateOfIssue        = user.IdentityInfo.DateOfIssue,
                Email              = user.ContactInfo.Email,
                EthnicId           = student.PersonalInfo.EthnicId,
                NationalityId      = student.PersonalInfo.NationalityId,
                PermanentResidence = student.PersonalInfo.PermanentResidence,
                PhoneNumber        = user.ContactInfo.PhoneNumber,
                PlaceOfBirth       = user.BirthInfo.PlaceOfBirth,
                PlaceOfIssue       = user.IdentityInfo.PlaceOfIssue,
                ReligionId         = student.PersonalInfo.ReligionId,
                Sex = user.BirthInfo.Sex
            };

            var universityInfo = new UniversityInfoResponseDto()
            {
                ClassName             = student.Class.Name,
                DepartmentName        = student.Class.Department.Name,
                ProgramName           = student.Class.Department.Program.Name,
                FacultyName           = student.Class.Department.Faculty.Name,
                ElectionName          = student.ElectionType.Name,
                EnrollmentAreaName    = student.EnrollmentArea.Name,
                UniversityExamResults = student.UniversityExamResults
                                        .Select(e => new UniversityExamResultResponseDto()
                {
                    Id          = e.Id,
                    Score       = e.Score,
                    SubjectName = e.Subject.Name
                }).ToList()
            };

            var hightSchoolInfo = new HightSchoolInfoResponseDto()
            {
                HightSchoolName = student.HightSchoolName,
                YouthGroupInfo  = student.YouthGroupInfo != null
                ? new YouthGroupInfoResponseDto()
                {
                    DateOfJoiningYouthGroup = student.YouthGroupInfo.DateOfJoiningYouthGroup,
                    HavingBooksOfYouthGroup = student.YouthGroupInfo.HavingBooksOfYouthGroup,
                    HavingCardsOfYouthGroup = student.YouthGroupInfo.HavingCardsOfYouthGroup,
                    PlaceOfJoinYouthGroup   = student.YouthGroupInfo.PlaceOfJoinYouthGroup
                }
                : null,
                Achievements = student.Achievements.Where(x => !x.DelFlag).Select(a => new AchievementResponseDto()
                {
                    Id = a.Id,
                    AchievementLevelId   = a.AchievementLevelId,
                    AchievementLevelName = a.AchievementLevel.Name,
                    AchievementPrizeId   = a.AchievementPrizeId,
                    AchievementPrizeName = a.AchievementPrize.Name,
                    AchievementTypeId    = a.AchievementTypeId,
                    AchievementTypeName  = a.AchievementType.Name,
                    Description          = a.Description
                }).ToList(),
                HighSchoolResults = student.HighSchoolResults.Where(x => !x.DelFlag).Select(h => new HighSchoolResultResponseInfo()
                {
                    Id                  = h.Id,
                    ConductTypeId       = h.ConductTypeId,
                    GPAScore            = h.GPAScore,
                    HightSchoolYearId   = h.HightSchoolYearId,
                    LearningAbilityId   = h.LearningAbilityId,
                    ConductTypeName     = h.ConductType.Level,
                    HightSchoolYear     = h.HightSchoolYear.Year,
                    LearningAbilityName = h.LearningAbility.Level
                }).ToList(),
                Positions = student.HightSchoolPositions.Where(x => !x.DelFlag).Select(p => p.PositionTypeId).ToList(),
                Talents   = student.Talents.Where(x => !x.DelFlag).Select(t => t.TalentTypeId).ToList()
            };

            return(new ProfileResponseDto()
            {
                Avatar = user.Avatar,
                FirstName = user.FirstName,
                LastName = user.LastName,
                IdentityNumber = user.IdentityInfo.IdentityNumber,
                IdentificationNumber = student.IdentificationNumber,
                CircumstanceTypeId = student.CircumstanceTypeId,
                FamilyMembers = familyMembers,
                PersonalInfo = personalInfo,
                UniversityInfo = universityInfo,
                HightSchoolInfo = hightSchoolInfo
            });
        }