Exemple #1
0
        /// <summary>
        /// 根据学生编号获取学生详情信息
        /// <para>作     者:Huang GaoLiang </para>
        /// <para>创建时间: 2018-11-06 </para>
        /// </summary>
        /// <param name="studentId">学生编号</param>
        /// <returns>返回学生详细信息</returns>
        public StudentDetailResponse GetStudent(long studentId)
        {
            // 根据学生编号获取学信息
            TblCstStudent student = _studentRepository.Value.GetCstStudentId(studentId);

            if (student == null)
            {
                return(null);
            }
            StudentDetailResponse res = new StudentDetailResponse
            {
                StudentId           = student.StudentId,
                StudentNo           = student.StudentNo,
                StudentName         = student.StudentName,
                Birthday            = student.Birthday,
                Age                 = Age.GetAge(student.Birthday),
                Sex                 = student.Sex,
                SexName             = EnumName.GetDescription(typeof(SexEnum), student.Sex),
                Balance             = new WalletService(_schoolId, studentId).Balance,
                AreaId              = student.AreaId,
                ContactPerson       = JsonConvert.DeserializeObject <List <GuardianRequest> >(student.ContactPerson),
                ContactPersonMobile = student.ContactPersonMobile,
                CurrentSchool       = student.CurrentSchool,
                CustomerFromNumber  = student.CustomerFrom,
                CustomerFrom        = EnumName.GetDescription(typeof(ListSource), student.CustomerFrom),
                HeadFaceUrl         = student.HeadFaceUrl,
                HomeAddress         = student.HomeAddress,
                HomeAddressFormat   = JsonConvert.DeserializeObject <HomeAddressFormatRequest>(student.HomeAddressFormat),
                IDNumber            = student.IDNumber,
                IDType              = student.IDType,
                IdTypeName          = EnumName.GetDescription(typeof(IDType), student.IDType),
                LinkMail            = student.LinkMail,
                LinkMobile          = student.LinkMobile,
                ParentId            = student.ParentId,
                Remark              = student.Remark
            };

            return(res);
        }
        public StudentDetailResponse GetStudentDetails()
        {
            StudentDetailResponse studentDetailResponse = _studentService.GetStudents();

            return(studentDetailResponse);
        }