/// <summary> /// 修改 /// </summary> /// <param name="keyValue">主键值</param> /// <param name="userEntity">用户实体</param> /// <returns></returns> public void SaveEntity(string keyValue, NURSE_CONSULTATIONEntity 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(NURSE_CONSULTATIONEntity 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 { NURSE_CONSULTATIONEntity entity = new NURSE_CONSULTATIONEntity() { 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(NURSE_CONSULTATIONEntity model) { NURSE_CONSULTATIONService service = new NURSE_CONSULTATIONService(); service.SaveEntity(model.ID.ToString(), model); }
/// <summary> /// 更新数据,幂等 /// </summary> /// <param name="key"></param> /// <param name="model"></param> public void Put([FromODataUri] string key, NURSE_CONSULTATIONEntity model) { NURSE_CONSULTATIONService service = new NURSE_CONSULTATIONService(); service.UpdateEntity(model); }