コード例 #1
0
        public async Task <MessageModel <bool> > UpdateClass(long studentId, long classId)
        {
            StudentInfo studentInfo = await _studentInfoService.QueryById(studentId);

            studentInfo.StudentClassID = classId;
            bool update = await _studentInfoService.Update(studentInfo);

            if (update)
            {
                return(new MessageModel <bool>()
                {
                    msg = "修改成功",
                    status = 200,
                    success = true,
                    response = update
                });
            }
            else
            {
                return(new MessageModel <bool>()
                {
                    msg = "修改失败",
                    success = false,
                });
            }
        }
コード例 #2
0
        public async Task <MessageModel <bool> > PostAddReport(StudentReportCardModel studentReport)
        {
            if (ModelState.IsValid)
            {
                StudentInfo result = await _studentInfoService.QueryById(studentReport.Id);

                long add = await _reportCardService.Add(
                    new ReportCard()
                {
                    Chinese = studentReport.Chinese,
                    Math    = studentReport.Math,
                    English = studentReport.English
                }
                    );

                result.ReportCardID = add;
                bool update = await _studentInfoService.Update(result);

                return(new MessageModel <bool>()
                {
                    msg = "添加成绩完成",
                    status = 200,
                    success = true,
                    response = update
                });
            }
            else
            {
                return(new MessageModel <bool>()
                {
                    msg = "添加成绩失败",
                    success = false
                });
            }
        }
コード例 #3
0
        public async Task <MessageModel <bool> > PostStudentClass(long id, long studentClassId)
        {
            StudentInfo studentInfo = await _studentInfoService.QueryById(id);

            studentInfo.StudentClassID = studentClassId;
            bool update = await _studentInfoService.Update(studentInfo);

            return(new MessageModel <bool>()
            {
                msg = "添加班级成功",
                response = update,
                success = true,
                status = 200
            });
        }