xc
This commit is contained in:
parent
1732e02b48
commit
db301ead3c
@ -145,8 +145,14 @@ namespace YD_AllHeartRates.Api.Services.Impl
|
|||||||
{
|
{
|
||||||
var student = await _sportsContext.Student.Where(x => x.StudentNo == dto.StudentNo).FirstOrDefaultAsync();
|
var student = await _sportsContext.Student.Where(x => x.StudentNo == dto.StudentNo).FirstOrDefaultAsync();
|
||||||
|
|
||||||
if (student == null)
|
if (student != null)
|
||||||
throw new Exception($"学号:{dto.StudentNo}的学生不存在!");
|
throw new Exception($"学号:{dto.StudentNo}的学生已存在!");
|
||||||
|
|
||||||
|
var device = await _sportsContext.Device.Where(x => x.Code == dto.Code).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
if (device != null)
|
||||||
|
throw new Exception($"设备编号:{dto.Code}的学生已存在!");
|
||||||
|
|
||||||
|
|
||||||
var entity = new S_Device()
|
var entity = new S_Device()
|
||||||
{
|
{
|
||||||
@ -176,8 +182,8 @@ namespace YD_AllHeartRates.Api.Services.Impl
|
|||||||
|
|
||||||
var student = await _sportsContext.Student.Where(x => x.StudentNo == dto.StudentNo).FirstOrDefaultAsync();
|
var student = await _sportsContext.Student.Where(x => x.StudentNo == dto.StudentNo).FirstOrDefaultAsync();
|
||||||
|
|
||||||
if (student == null)
|
if (student != null)
|
||||||
throw new Exception($"学号:{dto.StudentNo}的学生不存在!");
|
throw new Exception($"学号:{dto.StudentNo}的学生已存在!");
|
||||||
|
|
||||||
device.StudentNo = dto.StudentNo;
|
device.StudentNo = dto.StudentNo;
|
||||||
device.DeviceType = dto.DeviceType;
|
device.DeviceType = dto.DeviceType;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user