/// <summary>
 /// 保存用户表单(新增、修改)
 /// </summary>
 /// <param name="keyValue">主键值</param>
 /// <param name="userEntity">用户实体</param>
 /// <returns></returns>
 public void SaveEntity(string keyValue, DeptAndWardEntity deptAndWard)
 {
     try
     {
         if (string.IsNullOrEmpty(keyValue))
         {
             deptAndWard.ID = GetKey();
             deptAndWard.ID = "99";
             this.BaseRepository().Insert(deptAndWard);
         }
         else
         {
             this.BaseRepository().Update(deptAndWard);
         }
     }
     catch (Exception ex)
     {
         if (ex is ExceptionEx)
         {
             throw;
         }
         else
         {
             throw ExceptionEx.ThrowServiceException(ex);
         }
     }
 }
 public void UpdateEntity(DeptAndWardEntity deptAndWard)
 {
     try
     {
         this.BaseRepository().Update(deptAndWard);
     }
     catch (Exception ex)
     {
         if (ex is ExceptionEx)
         {
             throw;
         }
         else
         {
             throw ExceptionEx.ThrowServiceException(ex);
         }
     }
 }
 public void PhysicalDelRecord(string keyValue)
 {
     try
     {
         DeptAndWardEntity entity = new DeptAndWardEntity()
         {
             ID = keyValue,
         };
         this.BaseRepository().Delete(entity);
     }
     catch (Exception ex)
     {
         if (ex is ExceptionEx)
         {
             throw;
         }
         else
         {
             throw ExceptionEx.ThrowServiceException(ex);
         }
     }
 }