/// <summary> /// 更新体重 /// </summary> /// <param name="input">更新体重输入</param> /// <returns></returns> public async Task UpdateWeight(UpdateWeightInput input) { var patient = await _context.Patient.FindAsync(input.PatientId); patient.Weight = input.Weight; patient.UpdateTime = DateTime.Now; }
public async Task <IActionResult> UpdateWeightTH([FromBody] UpdateWeightInput input) { if (input.id == null || input.weight == null || input.weight < 20) { return(BadRequest("参数有误!")); } var entity = await _patVisitApp.GetForm(input.id); entity.F_WeightTH = input.weight; await _patVisitApp.UpdateForm(entity); return(Ok("操作成功")); }
public async Task <IActionResult> UpdateIdeaWeight([FromBody] UpdateWeightInput input) { if (input.id == null || input.weight == null || input.weight < 20) { return(BadRequest("参数有误!")); } var entity = await _patVisitApp.GetForm(input.id); if (entity == null || string.IsNullOrEmpty(entity.F_Pid)) { return(BadRequest("主键ID有误!")); } //修改干体重记录 await _patientApp.UpdateWeight(entity.F_Pid, _usersService.GetCurrentUserId(), input.weight.ToFloat(2)); return(Ok("操作成功")); }
/// <summary> /// 更新体重 /// </summary> /// <param name="input">更新体重输入</param> /// <returns>是否更新成功</returns> public async Task <OutputBase> UpdateWeight(UpdateWeightInput input) { await _repository.UpdateWeight(input); return(_unitWork.Commit() ? OutputBase.Success("更新成功") : OutputBase.Fail("更新失败")); }
public async Task <OutputBase> UpdateWeight([FromBody] UpdateWeightInput input) { return(await _service.UpdateWeight(input)); }