コード例 #1
0
 /// <summary>
 /// 修改
 /// </summary>
 /// <param name="keyValue">主键值</param>
 /// <param name="userEntity">用户实体</param>
 /// <returns></returns>
 public void SaveEntity(string keyValue, DischargeRecordEntity entity)
 {
     try
     {
         int itemp = 0;
         if (int.TryParse(keyValue, out itemp))
         {
             if (itemp != 0)
             {
                 this.BaseRepository().Insert(entity);
             }
         }
     }
     catch (Exception ex)
     {
         if (ex is ExceptionEx)
         {
             throw;
         }
         else
         {
             throw ExceptionEx.ThrowServiceException(ex);
         }
     }
 }
コード例 #2
0
 public void UpdateEntity(DischargeRecordEntity entity)
 {
     try
     {
         this.BaseRepository().Update(entity);
     }
     catch (Exception ex)
     {
         if (ex is ExceptionEx)
         {
             throw;
         }
         else
         {
             throw ExceptionEx.ThrowServiceException(ex);
         }
     }
 }
コード例 #3
0
 public void PhysicalDelRecord(string keyValue)
 {
     try
     {
         DischargeRecordEntity entity = new DischargeRecordEntity()
         {
             PATIENTID = keyValue
         };
         this.BaseRepository().Delete(entity);
     }
     catch (Exception ex)
     {
         if (ex is ExceptionEx)
         {
             throw;
         }
         else
         {
             throw ExceptionEx.ThrowServiceException(ex);
         }
     }
 }
コード例 #4
0
        /// <summary>
        /// 插入数据
        /// </summary>
        /// <param name="model"></param>
        public void Post(DischargeRecordEntity model)
        {
            DischargeRecordService service = new DischargeRecordService();

            service.SaveEntity(model.PATIENTID, model);;
        }
コード例 #5
0
        /// <summary>
        /// 更新数据,幂等
        /// </summary>
        /// <param name="key"></param>
        /// <param name="model"></param>
        public void Put([FromODataUri] string key, DischargeRecordEntity model)
        {
            DischargeRecordService service = new DischargeRecordService();

            service.UpdateEntity(model);
        }