/// <summary> /// 修改 /// </summary> /// <param name="keyValue">主键值</param> /// <param name="userEntity">用户实体</param> /// <returns></returns> public void SaveEntity(string keyValue, DiagnosisEntity entity) { try { if (keyValue != "") { entity.ID = keyValue; } else { entity.ID = GetKey(); } this.BaseRepository().Insert(entity); } catch (Exception ex) { if (ex is ExceptionEx) { throw; } else { throw ExceptionEx.ThrowServiceException(ex); } } }
public void UpdateEntity(DiagnosisEntity entity) { try { this.BaseRepository().Update(entity); } catch (Exception ex) { if (ex is ExceptionEx) { throw; } else { throw ExceptionEx.ThrowServiceException(ex); } } }
public void PhysicalDelRecord(string keyValue) { try { DiagnosisEntity entity = new DiagnosisEntity() { ID = keyValue }; this.BaseRepository().Delete(entity); } catch (Exception ex) { if (ex is ExceptionEx) { throw; } else { throw ExceptionEx.ThrowServiceException(ex); } } }
/// <summary> /// 插入数据 /// </summary> /// <param name="model"></param> public void Post(DiagnosisEntity model) { DiagnosisService service = new DiagnosisService(); service.SaveEntity(model.ID, model); }
/// <summary> /// 更新数据,幂等 /// </summary> /// <param name="key"></param> /// <param name="model"></param> public void Put([FromODataUri] string key, DiagnosisEntity model) { DiagnosisService service = new DiagnosisService(); service.UpdateEntity(model); }