コード例 #1
0
ファイル: GoodWS.java プロジェクト: Kerey-pharm/AIS
 public void deleteGood(@WebParam(name = "id") Long id) throws WebServiceException {
   try {
     if (id == null || id == 0)
       throw new WebServiceException(Constants.objectIsNull, "ID is null or empty");
     bean.deleteGood(id);
   } catch (ServicesException ex) {
     throw new WebServiceException(ex.getErrorCode(), ex.getComment());
   }
 }
コード例 #2
0
ファイル: GoodWS.java プロジェクト: Kerey-pharm/AIS
 public void createGood(@WebParam(name = "good") GoodWrapper good) throws WebServiceException {
   try {
     validator.validate(good);
     bean.createGood(good);
   } catch (ValidatorException ex) {
     throw new WebServiceException(ex.getErrorCode(), ex.getComment());
   } catch (ServicesException ex) {
     throw new WebServiceException(ex.getErrorCode(), ex.getComment());
   }
 }
コード例 #3
0
ファイル: GoodWS.java プロジェクト: Kerey-pharm/AIS
 public void changeGoodProperty(
     @WebParam(name = "id") Long id,
     @WebParam(name = "property") GoodProperty property,
     @WebParam(name = "newValue") String newValue)
     throws WebServiceException {
   if (id == null || id == 0)
     throw new WebServiceException(Constants.objectIsNull, "ID is null or empty");
   if (property == null || newValue == null || newValue.trim().length() == 0)
     throw new WebServiceException(
         Constants.fieldNotFilledProperly, "PropertyName or newValue is NULL");
   try {
     bean.changeGoodProperty(id, property, newValue);
   } catch (ServicesException ex) {
     throw new WebServiceException(ex.getErrorCode(), ex.getComment());
   }
 }
コード例 #4
0
ファイル: GoodWS.java プロジェクト: Kerey-pharm/AIS
 public List<GoodWrapper> getGoodList(
     @WebParam(name = "params") PageParam params,
     @WebParam(name = "nameFilter") String nameFilter,
     @WebParam(name = "barcode") String barcode)
     throws WebServiceException {
   if (params != null)
     if (params.getPaged() == null
         || (params.getPaged()
             && (params.getPageNum() == null
                 || params.getPageNum() == 0
                 || params.getPerPage() == null
                 || params.getPerPage() == 0)))
       throw new WebServiceException(Constants.rangeIsIncorrect, "Request range is incorrect");
   try {
     return bean.getGoodList(params, nameFilter, barcode);
   } catch (ServicesException ex) {
     throw new WebServiceException(ex.getErrorCode(), ex.getComment());
   }
 }